wxAUI tool bar layout

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Widgets
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 534
Joined: Thu Jun 01, 2006 4:36 pm
Location: Right here!

wxAUI tool bar layout

Post by Widgets »

In my current project, my wxAUI tool bar is rather full.
wxAuiToolbar-full.jpg
wxAuiToolbar-full.jpg (15.33 KiB) Viewed 1079 times
If I try to reduce the width, some tool bar items remain with a lot of empty space on the right, while other items are dropped
wxAuiToolbar-shrink.jpg
wxAuiToolbar-shrink.jpg (12.74 KiB) Viewed 1079 times
For example the red 'x' below the menu item 'workspace' is dropped, as is the second button in the next field, while the green 'gear' & red 'flag' still have blank space to their right.
All tool bars are sized according to the number of item in each, with each 'button' allocated 24x24 pixels.
FWIW, the complete layout was created with wxCrafter, though I don't see if or why that would affect the sizing if the individual buttons.
this is not really a show stopper, but it would be nice to at least under stand the issue better, which might help finding a 'fix'
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7479
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxAUI tool bar layout

Post by ONEEYEMAN »

Hi,
Are you testing on the HighDPI display?
What format are those buttons - JPEG? PNG?

Thank you.
Widgets
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 534
Joined: Thu Jun 01, 2006 4:36 pm
Location: Right here!

Re: wxAUI tool bar layout

Post by Widgets »

All images for the buttons are PNGs.

Where and how does highDPI affect this issue?
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7479
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxAUI tool bar layout

Post by ONEEYEMAN »

Hi,
I don't know how HighDPI will or will not affect this. I'm just trying to eliminate all possibilities.

If you are using HighDPI - try it on the regular monitor.
Maybe some scaling code inside AUI does something that makes it not working.

According to Vadim (main wx-developer) AUI is doing its own scaling, so maybe this is related.

It also might be theme related as some themes may set different sizes for button. But again - this is just a guess.

Thank you.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxAUI tool bar layout

Post by PB »

I have a vague recollection of tracing this, i.e., when the right-most buttons moved from the toolbar to the overflow menu after toolbar being made narrower. You probably do not create your toolbars with wxAUI_TB_OVERFLOW so they just "disappear".

I do not remember if this was bug (incorrect calculation of space) or not. When I reproduce the issue in the AUI sample, it seems that there really is not enough space left, even if the now empty space looks wide: There is a quite big highlight-border around the toolbar item...
Widgets
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 534
Joined: Thu Jun 01, 2006 4:36 pm
Location: Right here!

Re: wxAUI tool bar layout

Post by Widgets »

AFAIK, none of my displays are, or might be classified as, hdpi - 24" monitor(s) with max 1680x1050 resolution;
As well, afaik, nothing related to themes has been requested in the code.

Seems then it is the wxAUI code, but it would be way too much work to 'climb that mountain' by trying to debug the issue.

My main question was intended to clarify whether I might be missing some more obvious and easily corrected configuration.
Thank you for your thoughts.
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxAUI tool bar layout

Post by PB »

Widgets wrote: Fri Dec 03, 2021 6:48 pm AFAIK, none of my displays are, or might be classified as, hdpi - 24" monitor(s) with max 1680x1050 resolution;
In this context, hidpi means:
1. You changed (increased) your display DPI from the default, this does not generally depend on the resolution.
2. You marked your application as DPI-aware, usually with an application manifest.

Widgets wrote: Fri Dec 03, 2021 6:48 pm My main question was intended to clarify whether I might be missing some more obvious and easily corrected configuration.
I agree it looks bad visually but see my previous post about whether there really is enough space for another toolbar button including its highlight border (may be a difference of just 1 pixel) or not.

EDIT
Actually, in the AUI sample, not all buttons move from toolbar from the overflow menu when there is not enough space. Those from the toolbar with the question icons do, those from the toolbar with the folder icons do not and just disappear. Looking at the sample source code, the former is created with wxAUI_TB_HORIZONTAL style while the latter is not. No idea if this is what makes it behave differently.
Widgets
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 534
Joined: Thu Jun 01, 2006 4:36 pm
Location: Right here!

Re: wxAUI tool bar layout

Post by Widgets »

@PB My apologies, with my troubles of not being able to login for some time, I did not scroll back far enough to see your reply.
I have tried all sorts of option & styles for the various tool bars & buttons, but none made much difference and no matter what I do, none of the tool bar panels move to an overflow - presumable a second rot of tool bar panels??
In fact when I shrink the wxauidemo frame, it does more or less the same as my app. Buttons from the existing tool bar panels simply disappear, with the one difference it seems that in the sample, those on the right disappear first, but leave no trace of their panel at all.
In my case, buttons disappear 'more evenly', including ones from the far left, as the frame shrinks.

Unfortunately, there are some many options and styles that sorting out which combination is needed for a specific layout and reaction, seems a bit daunting.
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxAUI tool bar layout

Post by PB »

Widgets wrote: Fri Dec 03, 2021 8:02 pm Buttons from the existing tool bar panels simply disappear, with the one difference it seems that in the sample, those on the right disappear first, but leave no trace of their panel at all.
I tried sample from the master and 3.1.5 and observed what I wrote before, i.e., the difference between the toolbars with question mark and folder icons.
Widgets wrote: Fri Dec 03, 2021 8:02 pm In my case, buttons disappear 'more evenly', including ones from the far left, as the frame shrinks.
I see, I did not notice such behaviour either in your screenshots or in the sample.

Out of curiosity, if you create the toolbar with wxAUI_TB_OVERFLOW | wxAUI_TB_HORIZONTAL style, do the buttons disappear or move to the overflow menu?

Unfortunately, I do not think I can help you with this. Perhaps someone else can, but wxAUI may be the weakest part of wxWidgets, riddled with issues and no active maintainer...
Widgets
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 534
Joined: Thu Jun 01, 2006 4:36 pm
Location: Right here!

Re: wxAUI tool bar layout

Post by Widgets »

I much appreciate the time you have spent on this already.

I did notice, that all of the graphics are bitmaps from the art provider.
Is there really any 'overflow' and what should/could one expect from it?
As I said, it is not a show stopper, though it is a bit of an ugly second best look.
No big surprise that there is no maintainer; it would likely take more like a dedicated team to get to know the code well enough to be effective.
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxAUI tool bar layout

Post by PB »

Widgets wrote: Fri Dec 03, 2021 9:29 pm Is there really any 'overflow' and what should/could one expect from it?
I am not sure I understand but the "overflow" is the small ">>" at the end of a wxAuiToolbar (top right in a horizontal one). Clicking it shows the overflow menu showing buttons that did not fit into the toolbar.

You do not have them in your screenshots but they are used in the AUI sample.
Widgets
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 534
Joined: Thu Jun 01, 2006 4:36 pm
Location: Right here!

Re: wxAUI tool bar layout

Post by Widgets »

Thank you; either I never noticed or have forgotten about those little 'chevrons'. Never thought to click on them.
It seems that what I understand to be the 'grippers', appear whether or not I have that style enabled. If I hover over them, the 'move' cursor shows up, but if I move any, the whole tool bar layout goes 'weird'. Partly because of that, I sort of ignored the 'overflow' button.

The reason the overflow chevrons do not show on my screenshots is, because as part of my efforts to find a reasonable arrangement, I had turned that style off in the version I used for the screen shots.
Now that you explained these 'little 'buttons', and I have enabled that style, it all seems to work as expected. The buttons which disappeared from the tool bar pane, do show in a drop down and thus are usable.

That is probably the best 'fix/workaround' for now and I am very happy I asked :-)
Thank you
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
Post Reply