User interface for an OpenGL project? - c++

I am working on an OpenGL project for a solar system using Visual C++. I am done with quite a bit of the coding, but I need to implement it as a user learning module, which includes an overview button, a stop button and an info button. I want to make it like a form, with a panel containing the buttons and the a panel for viewing the animation. I tried using GLUI but it's not very useful for my implementation. Is it possible to create a form in Visual Studio, and import this code in the panel function?

Have you considered using QT for the GUI portions of your project ? You can create a panel for QT buttons and GUIs. You could use the QGLWidget for your panel to view the animation.
A good tutorial for using Qt Creator with Opengl (http://www.youtube.com/watch?v=1nzHSkY4K18).
There are also many good examples of the OpenGL + QT + Visual studio in the "C:\QtInstallPath\examples\opengl" directory.
If you wanted didn't want to use QT you could use C++\CLI to assist with the GUI portions of the code. The following link shows how to create an OpenGL view on a windows form in managed C++. http://www.codeproject.com/Articles/16051/Creating-an-OpenGL-view-on-a-Windows-Form.

Related

How to create an Evernote kind of widget for global menu of a MacOS/X desktop using QT?

How to create an application which stays in top of MacOS, something similar to below image. You can see the Evernote elephant icon.
I don't want to use xcode - because my application already built in QT, it has nice GUI, now I wanted to add extended feature something similar to Evernote. If I click on an elephant it will open a dialog box to write notes. In my case- it's a simple event like on/off buttons.
I have tried and created GUI widget apps but how to make one which resides like Evernote app ?
A custom pop up menu like the one pictured can be done several ways in Qt.
QML is the most modern way of making the menu with the customized styling you are looking for.
Apply the appropriate flags to the window/widget so it appears as a popup.
The same effects can also be done in QWidgets, but takes more code and probably will take longer to make. The flags you are looking for will be found under Qt Window Flags and/or under Qt Widget Attributes.
The stock stylings for Qt for different OS's deal mostly with title bars, status bars, buttons, drop downs, etc.
The base styles for Mac can be found here:
http://doc.qt.io/qt-5/gallery-macintosh.html
Once you go to a customized popup, you have to draw all of it yourself... but the native drawing elements in Qt are friendly enough and get you that look you are trying to do.
There are even some tools for exporting from Photoshop or Gimp directly to QML.
http://doc.qt.io/qtcreator/quick-export-to-qml.html
Hope that helps.
You are looking for a tray icon. Qt implements it in QSystemTrayIcon.
Further information
You may take a look at the System Tray Icon Example.
Many StackOverflow posts exist on this topic.
If you already have a program written for Qt, then you can compile and run it under MacOS/X much the same way you could compile it under (whatever OS you're using now). You'll need to install Xcode because Xcode includes the C++ compiler (clang) you'll need in order to compile your Qt program, but you don't have to use the Xcode IDE if you don't want to. Rather, you can either use the QtCreator IDE under MacOS/X, or you can simply open up a Terminal window and do a "qmake ; make" in the directory where your Qt-based program's .pro file is, and build it from the command line that way.
If, on the other hand, your question is actually about how to add an icon to the global menu of a MacOS/X desktop, then I don't think Qt has an API for that, so you'll need to drop down to using one of MacOS/X's native APIs. That will probably involve learning some Objective-C (or Objective-C++, if you prefer), but integrating a bit of Objective-C/C++ into your Qt app is doable with a bit of work.

Integrating CLIPS with Qt

I've been trying to build a GUI with Qt. However, I have no idea how to integrate CLIPS with the signals and slots of Qt.
For example, in the GUI if a user presses ctrl+r it should run the source file entered. Similarly, the agenda has a different window which updates as the rules are loaded. How can I integrate all of this with Qt?
I'm also open to any ideas you may have about building a frontend for CLIPS.
Thanks
Take a look at CLIPSShell on SourceForge: https://sourceforge.net/projects/clipsshell/. It's written in Qt.

Backgroung color toolbar and menubar in windows 7

I want to change the backgroung color of the toolbar and the menu bar of my application in Windows 7.
I have this look:
but I want this look:
So I'd like to know - this problem is connected with Visual Styles, and can be solved with some functions / changes of color scheme of application or I should write my own classes and set the particular color in RGBenter image description here.
If you have any example code, I would glad to see it.
As Cody indicated, you need to use visual styles. When you create a new project in Visual Studio, you’re given the opportunity to specify a visual style.
The new application uses the CMFCVisualManager class to render the individual UI components.
CMFCVisualManager...
Provides support for changing the appearance of your application at a
global level. The CMFCVisualManager class works together with a class
that provides instructions to draw the GUI controls of your
application using a consistent style.
If you’re dealing with an existing application, you would need to add the VisualManager class to your code. I would suggest you create a sample application and look at the code that gets generated. Once you understand how the code works, you can port what you need to your application.

How do you create a textbox in C++ and DirectX 9 for games?

I'm currently working on the menu for a game and I've tried searching for information on how to create a textbox within the menu for some particular options such as the name of the player, and I haven't found any useful information about it.
I am using DirectInput for the keyboard input for the game itself, but it seems that would be far too 'over-sensitive' for typing into a textbox. How would I create a textbox that could reliably accept input?
When it comes to game UIs, they rely upon non-OS primitives so that they can be styled and flow exactly as the game designers intend. Also using non-OS primitives allows better integration with the game engine. A popular open source game UI toolkit is CEGUI. If you want a UI toolkit for debug purposes I'd look at AntTweakBar. And finally a UI toolkit provided by the DirectX SDK is the DXUT (Look at DX9 SDK samples for the DXUT 9 version).

Controls on main window using Visual C++ designer?

Is is possible to draw controls using Visual C++ designer on the main window, in the same way you can design dialogs? I'd preferably like to be able to design the main window controls this way without using MFC, rather than creating them on WM_CREATE.
EDIT: I don't want a dialog-based app, just to be able to design the main window graphically similar to what can be done using Windows Forms Designer in .NET?
Your options are:
Use MFC and create a main window that has a dialog view (based on the CFormView class).
Use WinForms/.NET
Use Qt.
If you're starting a new project and you want to stick with C++, then I highly recommend Qt. Not only is it an excellent framework, but it's cross-platform so your app could be built on Linux and the Mac.
http://www.qtsoftware.com/products/
A Visual C++ plugin is available and you can design your main window visually using a tool called Qt Designer.
I'm not sure if I understand what you want your app to look like. If you want your application to be a dialog, then make it a dialog app.
Just create a new MFC Application, and set it to "Dialog based". Now your application will start at that dialog.
If you want to use a native win32 app, just create the dialog in your InitInstance, using CreateDialog (instead of CreateWindow).
In both cases, you use the resource editor to create the dialog.