Sizers
Automatically manage resizing controls
Sizers take care of resizing and repositioning controls within a window whenever
the window is resized. Sizers may be nested within each other to create complex
relationships between the controls in a window.
The most common sizer used will be the wxBoxSizer.
Functions/Procedures
- proc add_sizer_to_sizer( atom sizer1, atom sizer2, atom option, atom flag, atom border )
- proc add_window_to_sizer( atom sizer, atom window, atom option, atom flag, atom border )
- proc detatch_sizer( atom sizer, atom detach )
- func fit_window( atom sizer, atom window )
- func get_sizer_minsize( atom sizer )
- func get_sizer_position( atom sizer )
- func get_sizer_size( atom sizer )
- func get_sizer_window( atom sizer )
- proc layout_sizer( atom sizer )
- func replace_sizer_item( atom sizer, atom old_item, atom new_item, atom recursive )
- proc set_sizer( atom window, atom sizer )
- proc show_sizer_item_sizer( atom sizer, atom item, atom show, atom recursive )
- proc show_sizer_item_win( atom sizer, atom item, atom show, atom recursive )
- func sizer_calc_min( atom sizer )
- func sizer_item_shown( atom sizer, atom item )
- proc space_sizer( atom sizer, atom width, atom height, atom option, atom flag, atom border)
Subtopics
Sizers
[proc]
add_sizer_to_sizer ( atom sizer1, atom sizer2, atom option, atom flag, atom border )
Category:
Sizers
This adds sizer2 to sizer1.
- option can be any integer greater than or equal to 0. For wxBoxSizer, 0 means that
the sizer cannot grow in the main direction of the sizer (either wxHORIZONTAL
or wxVERTICAL--see wxBoxSizer). Greater than 0 means that the sizer will grow
in proportion to the option values of the other controls placed in the sizer.
- flag may take on any of several values (use wx_or_all() to combine multiple):
- wxGROW: grow to fill entire space
- wxSHAPED: grow proportionately
- wxTOP: the border may be applied at the top of the sizer
- wxBOTTOM: the border may be applied at the bottom of the sizer
- wxRIGHT: the border may be applied at the right of the sizer
- wxLEFT: the border may be applied at the left of the sizer
- wxALIGN_CENTER_HORIZONTAL
- wxALIGN_LEFT
- wxALIGN_TOP
- wxALIGN_RIGHT
- wxALIGN_BOTTOM
- wxALIGN_CENTER_VERTICAL
- border is the size of the border
Sizers
[proc]
add_window_to_sizer ( atom sizer, atom window, atom option, atom flag, atom border )
Category:
Sizers
This adds the specified window (i.e., control) to the sizer.
- option can be any integer greater than or equal to 0. For wxBoxSizer, 0 means that
the control cannot grow in the main direction of the sizer (either wxHORIZONTAL
or wxVERTICAL--see wxBoxSizer). Greater than 0 means that the control will grow
in proportion to the option values of the other controls placed in the sizer.
- flag may take on any of several values (use wx_or_all() to combine multiple):
- wxGROW: grow to fill entire space
- wxSHAPED: grow proportionately
- wxTOP: the border may be applied at the top of the sizer
- wxBOTTOM: the border may be applied at the bottom of the sizer
- wxRIGHT: the border may be applied at the right of the sizer
- wxLEFT: the border may be applied at the left of the sizer
- wxALIGN_CENTER_HORIZONTAL
- wxALIGN_LEFT
- wxALIGN_TOP
- wxALIGN_RIGHT
- wxALIGN_BOTTOM
- wxALIGN_CENTER_VERTICAL
- border is the size of the border
Sizers
Category:
Sizers
Detach a child from the sizer without destroying it. his method does not cause any layout or resizing to take place,
call layout_sizer() to update the layout "on screen" after detaching a child from the sizer.
Sizers
Category:
Sizers
Tell the sizer to resize the window to match the sizer's minimal size. Returns the new size.
Sizers
Category:
Sizers
Returns the minimal size of the sizer. This is either the combined minimal
size of all the children and their borders or the minimal size set by set_sizer_min_size(),
depending on which is bigger
Sizers
Category:
Sizers
Returns the current position of the sizer.
Sizers
Category:
Sizers
Returns the current size of the sizer.
Sizers
Category:
Sizers
Returns the window this sizer is used in or NULL if none.
Sizers
Category:
Sizers
Call this to force layout of the children anew, e.g. after having added a child to or removed a child (window, other sizer or space)
from the sizer while keeping the current dimension.
Sizers
[func]
replace_sizer_item ( atom sizer, atom old_item, atom new_item, atom recursive )
Category:
Sizers
Replaces one item with another. Both old_itm and new_item must be either sizers, or
both must be objects derived from a wxWindow.
Use parameter recursive to search the given element recursively in subsizers.
You must call layout_sizer() to have the sizer adjust the display.
Sizers
Category:
Sizers
This must be called before a sizer will resize its children. window is the parent window
of the controls to be resized. The sizer will resize and reposition its children based on window.
Sizers
Category:
Sizers
Shows or hides sizer item. To make a sizer item disappear or reappear,
you must call layout_sizer() after this procedure.
Use parameter recursive to search the given element recursively in subsizers.
Sizers
[proc]
show_sizer_item_win ( atom sizer, atom item, atom show, atom recursive )
Category:
Sizers
Shows or hides window item. To make a sizer item disappear or reappear,
you must call layout_sizer() after this procedure
Use parameter recursive to search the given element recursively in subsizers.
Sizers
Category:
Sizers
Have the sizer perform the actual calculation of its children's minimal sizes. The
size is returned as a sequence.
Sizers
Category:
Sizers
Returns true if the item is shown in the sizer.
Sizers
[proc]
space_sizer ( atom sizer, atom width, atom height, atom option, atom flag, atom border)
Category:
Sizers
Adds a blank region to the sizer in order to space controls within a sizer.
- option can be any integer greater than or equal to 0. For wxBoxSizer, 0 means that
the sizer cannot grow in the main direction of the sizer (either wxHORIZONTAL
or wxVERTICAL--see wxBoxSizer). Greater than 0 means that the sizer will grow
in proportion to the option values of the other controls placed in the sizer.
- flag may take on any of several values (use wx_or_all() to combine multiple):
- wxGROW: grow to fill entire space
- wxSHAPED: grow proportionately
- wxTOP: the border may be applied at the top of the sizer
- wxBOTTOM: the border may be applied at the bottom of the sizer
- wxRIGHT: the border may be applied at the right of the sizer
- wxLEFT: the border may be applied at the left of the sizer
- wxALIGN_CENTER_HORIZONTAL
- wxALIGN_LEFT
- wxALIGN_TOP
- wxALIGN_RIGHT
- wxALIGN_BOTTOM
- wxALIGN_CENTER_VERTICAL
- border is the size of the border