wxWidgets in C++: how to make a wxGauge appear on top of a wxGLCanvas

676 Views Asked by At

I have an app made in C++ with wxWidgets that downloads tiles from OpenStreetMap and displays the map inside a wxGLCanvas. I also made a progress bar with wxGauge that shows download progress. The map and the progress bar are both inside a wxGridBagSizer, I also tried with a wxBoxSizer, but the same problems happen.

wxGLCanvas map

Now I want to make the progress bar display on top of the canvas, not above like it is now. Simply positioning it with wxPoint sends it behind the canvas.

I also tried to put it at the bottom, after the canvas, but because I use wxEXPAND to make the canvas draw properly, the map always expands all the way to the bottom of the screen and it is displayed on top of everything that should be at the bottom of the screen (other columns with widgets that are defined as being at the bottom instead appear underneath the map).

How could I make it display on top, or at least make the canvas to not expand all over my other widgets ?

1

There are 1 best solutions below

0
On

To prevent the guage disappearing when in the same panel as the canvas, you need to specify a minimum size for the guage

To float the guage on top of the canvas, you need to place the guage in its own frame with a parent of the main frame and the style wxFRAME_FLOAT_ON_PARENT