|
wxMaxima
|
Declares AddToolbarPane() and SetToolbarPaneProperties(), which give the main toolbar's wxAUI pane its properties – both when the pane is first added and again after a stored perspective has been loaded over it. More...
#include <wx/aui/framemanager.h>#include <wx/aui/auibar.h>Go to the source code of this file.
Functions | |
| wxAuiPaneInfo & | SetToolbarPaneProperties (wxAuiPaneInfo &pane, const wxAuiToolBar *toolbar) |
| Sets the main toolbar pane's properties, its size included. | |
| void | AddToolbarPane (wxAuiManager &manager, wxAuiToolBar *toolbar, wxAuiPaneInfo pane) |
Adds the main toolbar to manager, with SetToolbarPaneProperties(). | |
Declares AddToolbarPane() and SetToolbarPaneProperties(), which give the main toolbar's wxAUI pane its properties – both when the pane is first added and again after a stored perspective has been loaded over it.
| void AddToolbarPane | ( | wxAuiManager & | manager, |
| wxAuiToolBar * | toolbar, | ||
| wxAuiPaneInfo | pane | ||
| ) |
Adds the main toolbar to manager, with SetToolbarPaneProperties().
Use this instead of calling wxAuiManager::AddPane() directly: since wxWidgets 3.3.4, AddPane() also makes a pane's best size the size of the dock the pane is in. That size is the dock's outer one, though, so the pane's border is taken off it, and the toolbar would end up two pixels shorter than its contents need. This function lets the dock be sized from the toolbar instead, as older wxWidgets versions always did.
| manager | The frame's AUI manager. |
| toolbar | The toolbar; Realize() must already have been called on it. |
| pane | The pane's name and dock position. |
| wxAuiPaneInfo & SetToolbarPaneProperties | ( | wxAuiPaneInfo & | pane, |
| const wxAuiToolBar * | toolbar | ||
| ) |
Sets the main toolbar pane's properties, its size included.
The toolbar's height follows entirely from its contents – icon size, which depends on the display's resolution, and the height of the controls in it, which depends on the font and the platform's theme. It is nothing the user can set, so it must be taken from the toolbar every time and never from a stored layout.
wxAuiManager::SavePerspective() stores it anyway (as the pane's best size, and as the size of the dock the pane sits in), and LoadPerspective() restores the stored value over the one wxAuiManager::AddPane() had just taken from the toolbar. From then on nothing in wxAUI recomputes it: the toolbar is sized to whatever the previous session saved, which that session in turn had from the one before. So a size that once came out wrong is kept forever, and on the platforms without DPI-independent pixels (MS Windows) wxAUI additionally rescales the stored best size whenever the window changes to a display with a different DPI – rounding every time, so the value can drift from one session to the next.
Calling this after LoadPerspective() takes the size from the toolbar again. It also re-applies the pane's flags, which LoadPerspective() equally replaces by whatever an older wxMaxima stored: without DockFixed() the dock keeps its stored size instead of being sized from its contents on the next layout.
The dock direction is left alone, as the user may have moved the toolbar to the bottom.
| pane | The toolbar's pane. |
| toolbar | The toolbar itself; Realize() must already have been called on it so that its hint size is up to date. |
pane, so that further settings can be chained.