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, see this class 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:

Instance Method Summary collapse

Methods inherited from BoxSizer

#add_spacer, #get_orientation, #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(orient, parent, label = ('')) ⇒ Wx::StaticBoxSizer

Returns a new instance of StaticBoxSizer.

Overloads:

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

    This constructor uses an already existing static box.

    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: (''))


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

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:



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

def calc_min; end

#get_static_boxWx::StaticBox Also known as: static_box

Returns the static box associated with the sizer.

Returns:



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

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)


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

def reposition_children(minSize) end