Class: Wx::StaticBoxSizer

Inherits:
BoxSizer show all
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

See Also:

Direct Known Subclasses

HStaticBoxSizer, VStaticBoxSizer

Instance Method Summary collapse

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.

Overloads:

  • #initialize(box, orient) ⇒ Wx::StaticBoxSizer

    This constructor uses an already existing static box.

    Parameters:

  • #initialize(box, orient) {|sizer| ... } ⇒ Wx::StaticBoxSizer

    This constructor uses an already existing static box.

    Parameters:

    Yield Parameters:

  • #initialize(orient, parent, label = ('')) ⇒ Wx::StaticBoxSizer

    This constructor creates a new static box with the given label and parent window.

    Parameters:

    • orient (Integer)
    • parent (Wx::Window)
    • label (String) (defaults to: (''))
  • #initialize(orient, parent, label = ('')) {|sizer| ... } ⇒ Wx::StaticBoxSizer

    This constructor creates a new static box with the given label and parent window.

    Parameters:

    • orient (Integer)
    • parent (Wx::Window)
    • label (String) (defaults to: (''))

    Yield Parameters:



62
# File 'lib/wx/doc/gen/static_box_sizer.rb', line 62

def initialize(*args) end

Instance Method Details

#calc_minWx::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.

Returns:



73
# File 'lib/wx/doc/gen/static_box_sizer.rb', line 73

def calc_min; end

#get_static_boxWx::StaticBox Also known as: static_box

Returns the static box associated with the sizer.

Returns:



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.

Parameters:

  • minSize (Array(Integer, Integer), Wx::Size)


80
# File 'lib/wx/doc/gen/static_box_sizer.rb', line 80

def reposition_children(minSize) end