Dear imgui, How to create buttons with icons and text? - imgui

I want to create a button with icons and text in the window of dear imgui, but I did not find the relevant interface.enter image description here

You might take a look on the iconfont
https://github.com/juliettef/IconFontCppHeaders

Related

WinUI3 : How to put an translucent grey overlay on Canvas

I'm working on a WinUI3 desktop application in c++. I was trying to achieve an experience where we can show a ProgressRing in the center of the screen when there is a delay in screen update. In my application, my window has a Canvas as its content and that canvas contains many widgets. I want to put a new Canvas as an overlay on top of the existing Canvas and show a ProgressRing on the new Overlay Canvas and I was able to achieve an experience like this.
The overlay Canvas in the image has a background color as transparent, I wanted to make the overlay canvas translucent. So that all the widgets below the overlay canvas will look like grayed-out non-interactive widgets.
I would be of great help if you could help me with this issue.
Thank you,
Harshithraj P
One way to do that is to set the Background("Black" maybe?) and the Opacity depending on how you want it to look.

Display image thumbnails with closing button in Qt

I have a widget that should display images that user has chosen (something like they are shown on the screenshot) and I need to allow users to remove images from this widget. Is there already some widget capable of doing this in Qt or I need to implement such widget by myself?
So, basically I need to display a small image with small closing button in top-right corner.
Yeah, you can. Make a custom widget

View all content inside win32 window

I cannot see text/graphics at the very bottom of my win32 window, because it extends larger than my screen can fit. Even when I go in fullscreen mode, I cannot see the bottom text.
Is there a way for me to adjust my window or zoom-out of my window in order to see the stuff at the bottom? Or am I supposed to shrink all the contents inside the window?
I'm not exactly sure what I should do, but any guidance would be appreciated. Also I'm using C++.
Thanks.
You pretty much have two options:
Add a scrollbar (Adjust the window style or add a scrollbar control)
Stretch/shrink/resize the content

Create borders around controls in MFC Form

I have an MFC form, basic stuff, a few group boxes, a few text boxes, some buttons, and a list box. What I'd like to do is add a border around all of it, preferably without a group box. Like, drawing lines along the right areas. I was told this is bad to do on a dialog though. What would I need to go about doing something like that?
I am currently using MFC C++ with Visual Studio 2008.
The easiest way is to add a Picture control to the dialog and set the style to have a border only. If the control has a width or height of 0 you can get a single line. Doing it in the dialog editor will only give you positioning down to the dialog unit, if you need pixel level control you'll have to create or reposition it in OnInitDialog.

Writing controls like a button in C++\Win32 (not MFC or CLI)?

I have several questions concerning the controls like a button, if You could answer i would be very much pleased.
Questions:
Is there any way to create a control like a button, but not-standard, i mean, not that strict-rectangled button
How do I handle mouse hover events within the control
Regards,
Galymzhan Sh
It's relatively easy. If you want the same behaviour as a button (click, hover etc etc), then the best bet is to subclass the button control.
Have a read of the following MSDN articles:
http://msdn.microsoft.com/en-us/library/bb773183.aspx
http://msdn.microsoft.com/en-us/library/ms997565.aspx
http://msdn.microsoft.com/en-us/library/ms633569.aspx
This one is tricky one.
I developed my own GUI, it is advance topic.
Here is how i developed mine.
Create class called button
In button class, create all
variables needed like the width and
Height of the button
Have a render function
If you gonna let users load their own
texture for the button, you should
include a load function
Create class for wrapper
Have a Add button function and use ids for buttons
Have a EventProc that checks for hovers, clicks...
Have a Render controls function to render all buttons
This is just simple way to write buttons