wxaui frame management usage:
1. general steps
# Install wxpython2.8 .*. *
Import wx. AUI
# initialize a wxaui management framework object
Mgr = wx. AUI. auimanager ()
# notify self as the parent object for managing all sub-objects
# self can be any sub-object of wxwindow
Mgr. setmanagedwindow (Self)
# Place the control in the specified position (For details, refer to "2. layout step ")
Mgr. addpane (wxwindow * window, const wxauipaneinfo & pane_info)
# "commit" all changes made to framemanager
Mgr. update ()
2. layout step
call the methods provided in wxauipaneinfo (), for example:
pane1 = wx. panel (Self)
Mgr. addpane (pane1, wx. AUI. auipaneinfo ().
name ("test1 "). caption ("pane1 ").
closebutton (true ). maximizebutton (true)
the following four steps are most important:
(1) Direction: first, determine the center object, in this way, you can determine the control that is stretched around.
determine the left, right, top, and bottom.
(2) layer: controls with the same layer can be considered as a whole, similar to boxsizer,
Objects close to the center start from the center to the four sides (the center itself is not calculated)Which is the default value of layer (0 ).The number indicates the number of rows and columns used to complete the layout. Do not calculate the number in the center. Haha
(3) position: the order in which controls are placed in the same direction and layer. By default
Horizontal and vertical
(4) Row: in the same direction and layer, change the default placement mode.
3. Function details
(1) minsize ()
Only act on the first control in one direction
(2) fixed ()
After a panel, Mgr. Update () does not respond to the onsize () event, that is, it does not call the layout () method,
Therefore, you must call layout () in the panel ()
(3) setdocksizeconstraint (double widthpct, double heightpc)
Adjust the ratio of the dock between two windows
Wxauimanager by default limits the size of any new dock to 1/3 of the window size
Wxaui frame management usage