Probably an easy question for those in the know.
When a toolbar is created, what is the best/easiest method of determining it's size?
Take for example a horizontal toolbar. When the orientation is changed to vertical, I need to specify a new BestSize for the toolbar. How would/should I determine this?
Does anyone have code to share?
Kirix Support Forums
wxAuiBar size determination
2 posts
• Page 1 of 1
Re: wxAuiBar size determination
Hello,
Good question. We've needed to do this in a couple of places as well. Here's how to do it:
You may need to set the min size as well as the best size, however, since wxAuiToolBar uses sizers internally for layout. If you want to do this, you'd do the following:
All the best,
Dave.
Good question. We've needed to do this in a couple of places as well. Here's how to do it:
- Code: Select all
wxAuiPaneInfo& pane = aui_mgr.GetPane(aui_toolbar);
wxSize s = aui_toolbar->GetMinSize();
pane.BestSize(s);
aui_mgr.Update();
You may need to set the min size as well as the best size, however, since wxAuiToolBar uses sizers internally for layout. If you want to do this, you'd do the following:
- Code: Select all
wxAuiPaneInfo& pane = aui_mgr.GetPane(aui_toolbar);
wxSize s = aui_toolbar->GetMinSize();
pane.MinSize(s).BestSize(s);
aui_mgr.Update();
All the best,
Dave.
Dave Williams
Kirix Support Team
Kirix Support Team
-
Dave - Kirix Support Team
- Posts: 32
- Joined: Wed Sep 21, 2005 11:07 pm
2 posts
· Page 1 of 1
Return to wxAUI Questions, Thoughts & Feedback