Class: Wx::StaticBoxSizer
- Defined in:
- lib/wx/doc/gen/static_box_sizer.rb
Overview
StaticBoxSizer is a sizer derived from BoxSizer but adds a static box around the sizer.
The static box may be either created independently or the sizer may create it itself as a convenience. In any case, the sizer owns the StaticBox control and will delete it in the StaticBoxSizer destructor. Note that since wxWidgets 2.9.1 you are strongly encouraged to create the windows which are added to StaticBoxSizer as children of StaticBox itself and failure to do so will result in warning messages in debug builds, even if creating them using the static box parent as parent still works too (but note that items using different parents can’t be used inside the same sizer, i.e. all of them should be children either of the box itself or of its parent and an assert will be triggered if this is not the case). Please see StaticBox documentation for more details. Example of use of this class:
class MyFrame < Wx::Frame
def create_controls
panel = Wx::Panel.new(self)
...
sz = Wx::StaticBoxSizer.new(Wx::VERTICAL, panel, "Box")
sz.add(Wx::StaticText.new(sz.get_static_box, Wx::ID_ANY,
"This window is a child of the staticbox"))
...
end
end
Category: Window Layout
Direct Known Subclasses
Instance Method Summary collapse
-
#calc_min ⇒ Wx::Size
Implements the calculation of a box sizer’s minimal.
-
#get_static_box ⇒ Wx::StaticBox
(also: #static_box)
Returns the static box associated with the sizer.
-
#initialize(*args) ⇒ StaticBoxSizer
constructor
A new instance of StaticBoxSizer.
-
#reposition_children(minSize) ⇒ void
Method which must be overridden in the derived sizer classes.
Methods inherited from BoxSizer
#add_spacer, #get_orientation, #inform_first_direction, #set_orientation
Methods inherited from Sizer
#add, #add_spacer, #add_stretch_spacer, #clear, #compute_fitting_client_size, #compute_fitting_window_size, #detach, #each_child, #fit, #fit_inside, #get_children, #get_containing_window, #get_item, #get_item_by_id, #get_item_count, #get_min_size, #get_position, #get_size, #hide, #inform_first_direction, #insert, #insert_spacer, #insert_stretch_spacer, #is_empty, #layout, #prepend, #prepend_spacer, #prepend_stretch_spacer, #remove, #replace, #set_containing_window, #set_dimension, #set_item_min_size, #set_min_size, #set_size_hints, #show, #show_items
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize(box, orient) ⇒ Wx::StaticBoxSizer #initialize(box, orient) {|sizer| ... } ⇒ Wx::StaticBoxSizer #initialize(orient, parent, label = ('')) ⇒ Wx::StaticBoxSizer #initialize(orient, parent, label = ('')) {|sizer| ... } ⇒ Wx::StaticBoxSizer
Returns a new instance of StaticBoxSizer.
62 |
# File 'lib/wx/doc/gen/static_box_sizer.rb', line 62 def initialize(*args) end |
Instance Method Details
#calc_min ⇒ Wx::Size
Implements the calculation of a box sizer’s minimal.
It is used internally only and must not be called by the user. Documented for information.
73 |
# File 'lib/wx/doc/gen/static_box_sizer.rb', line 73 def calc_min; end |
#get_static_box ⇒ Wx::StaticBox Also known as: static_box
Returns the static box associated with the sizer.
66 |
# File 'lib/wx/doc/gen/static_box_sizer.rb', line 66 def get_static_box; end |
#reposition_children(minSize) ⇒ void
This method returns an undefined value.
Method which must be overridden in the derived sizer classes.
The implementation should reposition the children using the current total size available to the sizer (m_size) and the size computed by the last call to #calc_min.
80 |
# File 'lib/wx/doc/gen/static_box_sizer.rb', line 80 def reposition_children(minSize) end |