I am developing a MFC dialog based windows application in VS2019 C++. Is there any library available for the UI design, such as adding background images, colors, font styles, buttons etc?
If anyone has any suggestions regarding the UI design of MFC C++ dialog applications, please tell me. I want to have a modern style UI and it is also not possible to change the framework.
Related
I have made an ATL control (ActiveX) and I can display it easily in MFC CDialog. Now I need to display it in CView of MFC single document project by using the code (just like the picture below).
Don't use CForm because my customer don't need it. They need exactly Control display in CView by code.
Are there any tutorial or suggestion for this task?
The MFC CView class doesn't directly support hosting of Win32 or ActiveX controls on its surface. That functionality is built into the CFormView class. If you want to readily host controls on your view, you should be using CFormView.
Is in Qt something like GTK.headerbar or any other possibility to add wiget (button for example) in window title?
Thanks in advance.
Short answer is 'no', Qt doesn't implement any kind of window decorations (except QWS which is a different story).
In Linux the title bars (window decorations) are carried by Window Managers, like Metacity or Compiz. Windows and OSX use their own window decorations. Qt has almost no control over what happens on the window title bars.
Gnome3/GTK3 (and not Gnome2) allows you to use widgets in the title bar but it's not the case for many other Desktop Environments / Window Managers. Your options are:
Use the API provided by the window manager / OS
Pros: native look.
Cons: you need to maintain separate implementation for each OS / DE. Not all support doing such.
Hide window decorations and implement you own
Pros: code once, use everywhere. Google Chrome and Vivaldi do that, for example.
Cons: you need to implement window resize and move
Use an overlay widget on top of the system title bar that will always follow the window
Pros: pretty much straightforward to do but I don't recommend it.
Cons: the widget will always lag when moving the main window. Native look still has to be implemented. Take into account that user can switch the theme and the widget will look odd.
I have in my editor few editing modes. I can choose specific mode using buttons that are placed on a toolbar. I want to indicate which mode is currently on. When I press appropriate button - I want to make the clicked button remain pushed. How do I do that in WinAPI? My toolbar uses bitmaps for icons if that's relevant.
There used to be a way to get something like the look and feel of a toolbar by using a normal check box with the BS_PUSHLIKE style set. But that got broken a bit with Windows XP because of mouse hover effects, so it's not widely used any more.
If you want to create your own toolbar, without the help of MFC, there is an MSDN article that covers the creation and management of a toolbar window (actually a dedicated window class as part of the Common Controls Library).
I am designing a UI engine that needs to render into popup (WS_POPUP) windows. As these windows cannot be children of other windows, each instance is given its own taskbar icon.
I need a way to prevent the taskbar icons from appearing for certain windows that are created as "dialogs". I cannot use an OS-provided dialog because they all have frames (and I can't figure out how to render into them) or a tool-created custom dialog (which seem to require the CLR).
I am not an expert with the windows API and I feel that I have missed something obvious...
Also: Anything involving CLI/CLR is not an option.
EDIT:
The WS_EX_NOACTIVATE style can be used for this purpose as well, though the activation behavior would need to be emulated by the program.
If you set the WS_EX_TOOLWINDOW extended style for your window, it won't be shown in the task bar or Alt+Tab list. This does cause the window to be rendered slightly differently, however (thinking floating tool palette).
I'm starting a C++ project using OpenGL and Qt for the UI in eclipse. I would like to create a UI where a portion of the window contains a frame for OpenGL rendering and the rest would contain other Qt widgets such as buttons and so on.
I haven't used Qt or the GUI editor in eclipse before and I'm wondering what the best approach would be? Should I create the UI by hand coding or would it be easier to use eclipse's GUI designer - I had a quick look at this and there doesn't seem to be an OpenGL widget built in.
Thanks
If you are using Qt Designer (which I think is available via Eclipse Integration), you can place a base QWidget in the layout and then "promote" that widget to a QGLWidget. To do this:
Add the QWidget to the desired place in the layout
Right-click on the widget
Select "Promote To"
Enter QGLWidget as the class name and as the header
Hit Add
Select the QGLWidget from the list of promoted widgets at the top of the dialog
Hit Promote
This way you don't have to go through the placeholder route and create an additional layer.
Why won't you use Qt Eclipse Integration? It works flawlessly, enables you to edit UIs directly from Eclipse.
I had the same problem, while using Qt Designer. I used a simple frame as a placeholder for the OpenGL widget, then, in main window constructor, I created OpenGL widget manually and assigned it to the placeholder frame (as a child).
The main advantage here is that you see, where the OpenGL widget should be while designing your interface. The main disadvantage is that some coding is still required to set up the GUI.