Class: Wx::SizerItem

Inherits:
Object show all
Defined in:
lib/wx/doc/gen/sizer_item.rb

Overview

Note:

This class is untracked and should not be derived from nor instances extended!

The SizerItem class is used to track the position, size and other attributes of each item managed by a Sizer.

It is not usually necessary to use this class because the sizer elements can also be identified by their positions or window or sizer pointers but sometimes it may be more convenient to use it directly.

Category: Window Layout

Direct Known Subclasses

GBSizerItem

Instance Method Summary collapse

Methods inherited from Object

#clone, #dup, #initialize, #is_same_as, #un_share

Constructor Details

This class inherits a constructor from Wx::Object

Instance Method Details

#assign_sizer(sizer) ⇒ void

This method returns an undefined value.

Set the sizer tracked by this item.

Old sizer, if any, is deleted.

Parameters:



69
# File 'lib/wx/doc/gen/sizer_item.rb', line 69

def assign_sizer(sizer) end

#assign_spacer(size) ⇒ void #assign_spacer(w, h) ⇒ void

Overloads:

  • #assign_spacer(size) ⇒ void

    This method returns an undefined value.

    Set the size of the spacer tracked by this item.

    Old spacer, if any, is deleted.

    Parameters:

    • size (Array(Integer, Integer), Wx::Size)
  • #assign_spacer(w, h) ⇒ void

    This method returns an undefined value.

    Set the size of the spacer tracked by this item.

    Old spacer, if any, is deleted.

    Parameters:

    • w (Integer)
    • h (Integer)


32
# File 'lib/wx/doc/gen/sizer_item.rb', line 32

def assign_spacer(*args) end

#assign_window(window) ⇒ void

This method returns an undefined value.

Set the window to be tracked by this item.

Note:

This is a low-level method which is dangerous if used incorrectly, avoid using it if possible, i.e. if higher level methods such as Wx::Sizer#replace can be used instead.

If the sizer item previously contained a window, it is dissociated from the sizer containing this sizer item (if any), but this object doesn’t have the pointer to the containing sizer and so it’s the caller’s responsibility to call Window#set_containing_sizer on window. Failure to do this can result in memory corruption when the window is destroyed later, so it is crucial to not forget to do it. Also note that the previously contained window is not deleted, so it’s also the callers responsibility to do it, if necessary.

Parameters:



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

def assign_window(window) end

#calc_minWx::Size

Calculates the minimum desired size for the item, including any space needed by borders.

Returns:



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

def calc_min; end

#delete_windowsvoid

This method returns an undefined value.

Destroy the window or the windows in a subsizer, depending on the type of item.



77
# File 'lib/wx/doc/gen/sizer_item.rb', line 77

def delete_windows; end

#detach_sizervoid

This method returns an undefined value.

Enable deleting the SizerItem without destroying the contained sizer.



81
# File 'lib/wx/doc/gen/sizer_item.rb', line 81

def detach_sizer; end

#get_borderInteger Also known as: border

Return the border attribute.

Returns:

  • (Integer)


85
# File 'lib/wx/doc/gen/sizer_item.rb', line 85

def get_border; end

#get_flagInteger Also known as: flag

Return the flags attribute.

See wxSizer flags list for details.

Returns:

  • (Integer)


92
# File 'lib/wx/doc/gen/sizer_item.rb', line 92

def get_flag; end

#get_idInteger Also known as: id

Return the numeric id of Wx::SizerItem, or Wx::StandardID::ID_NONE if the id has not been set.

Returns:

  • (Integer)


97
# File 'lib/wx/doc/gen/sizer_item.rb', line 97

def get_id; end

#get_min_sizeWx::Size Also known as: min_size

Get the minimum size needed for the item.

Returns:



102
# File 'lib/wx/doc/gen/sizer_item.rb', line 102

def get_min_size; end

#get_positionWx::Point Also known as: position

What is the current position of the item, as set in the last Layout.

Returns:



121
# File 'lib/wx/doc/gen/sizer_item.rb', line 121

def get_position; end

#get_proportionInteger Also known as: proportion

Get the proportion item attribute.

Returns:

  • (Integer)


126
# File 'lib/wx/doc/gen/sizer_item.rb', line 126

def get_proportion; end

#get_ratioFloat Also known as: ratio

Get the ratio item attribute.

Returns:

  • (Float)


131
# File 'lib/wx/doc/gen/sizer_item.rb', line 131

def get_ratio; end

#get_rectWx::Rect Also known as: rect

Get the rectangle of the item on the parent window, excluding borders.

Returns:



136
# File 'lib/wx/doc/gen/sizer_item.rb', line 136

def get_rect; end

#get_sizeWx::Size Also known as: size

Get the current size of the item, as set in the last Layout.

Returns:



141
# File 'lib/wx/doc/gen/sizer_item.rb', line 141

def get_size; end

#get_sizerWx::Sizer Also known as: sizer

If this item is tracking a sizer, return it.

NULL otherwise.

Returns:



148
# File 'lib/wx/doc/gen/sizer_item.rb', line 148

def get_sizer; end

#get_spacerWx::Size Also known as: spacer

If this item is tracking a spacer, return its size.

Returns:



153
# File 'lib/wx/doc/gen/sizer_item.rb', line 153

def get_spacer; end

#get_user_dataObject Also known as: user_data

Get the userData item attribute.

Returns:



158
# File 'lib/wx/doc/gen/sizer_item.rb', line 158

def get_user_data; end

#get_windowWx::Window Also known as: window

If this item is tracking a window then return it.

NULL otherwise.

Returns:



165
# File 'lib/wx/doc/gen/sizer_item.rb', line 165

def get_window; end

#is_shownBoolean Also known as: shown?

Returns true if this item is a window or a spacer and it is shown or if this item is a sizer and not all of its elements are hidden.

In other words, for sizer items, all of the child elements must be hidden for the sizer itself to be considered hidden. As an exception, if the Wx::SizerFlagBits::RESERVE_SPACE_EVEN_IF_HIDDEN flag was used for this sizer item, then #is_shown always returns true for it (see Wx::SizerFlags#reserve_space_even_if_hidden).

Returns:

  • (Boolean)


173
# File 'lib/wx/doc/gen/sizer_item.rb', line 173

def is_shown; end

#is_sizerBoolean Also known as: sizer?

Is this item a sizer?

Returns:

  • (Boolean)


178
# File 'lib/wx/doc/gen/sizer_item.rb', line 178

def is_sizer; end

#is_spacerBoolean Also known as: spacer?

Is this item a spacer?

Returns:

  • (Boolean)


183
# File 'lib/wx/doc/gen/sizer_item.rb', line 183

def is_spacer; end

#is_windowBoolean Also known as: window?

Is this item a window?

Returns:

  • (Boolean)


188
# File 'lib/wx/doc/gen/sizer_item.rb', line 188

def is_window; end

#set_border(border) ⇒ void Also known as: border=

This method returns an undefined value.

Set the border item attribute.

Parameters:

  • border (Integer)


194
# File 'lib/wx/doc/gen/sizer_item.rb', line 194

def set_border(border) end

#set_dimension(pos, size) ⇒ void

This method returns an undefined value.

Set the position and size of the space allocated to the sizer, and adjust the position and size of the item to be within that space taking alignment and borders into account.

Parameters:



201
# File 'lib/wx/doc/gen/sizer_item.rb', line 201

def set_dimension(pos, size) end

#set_flag(flag) ⇒ void Also known as: flag=

This method returns an undefined value.

Set the flag item attribute.

Parameters:

  • flag (Integer)


206
# File 'lib/wx/doc/gen/sizer_item.rb', line 206

def set_flag(flag) end

#set_id(id) ⇒ void Also known as: id=

This method returns an undefined value.

Sets the numeric id of the Wx::SizerItem to id.

Parameters:

  • id (Integer)


212
# File 'lib/wx/doc/gen/sizer_item.rb', line 212

def set_id(id) end

#set_init_size(x, y) ⇒ void

This method returns an undefined value.

Sets the minimum size to be allocated for this item.

This is identical to #set_min_size, prefer to use the other function, as its name is more clear.

Parameters:

  • x (Integer)
  • y (Integer)


221
# File 'lib/wx/doc/gen/sizer_item.rb', line 221

def set_init_size(x, y) end

#set_min_size(size) ⇒ void #set_min_size(x, y) ⇒ void Also known as: min_size=

Overloads:

  • #set_min_size(size) ⇒ void

    This method returns an undefined value.

    Sets the minimum size to be allocated for this item.

    If this item is a window, the size is also passed to Window#set_min_size.

    Parameters:

    • size (Array(Integer, Integer), Wx::Size)
  • #set_min_size(x, y) ⇒ void

    This method returns an undefined value.

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • x (Integer)
    • y (Integer)


116
# File 'lib/wx/doc/gen/sizer_item.rb', line 116

def set_min_size(*args) end

#set_proportion(proportion) ⇒ void Also known as: proportion=

This method returns an undefined value.

Set the proportion item attribute.

Parameters:

  • proportion (Integer)


226
# File 'lib/wx/doc/gen/sizer_item.rb', line 226

def set_proportion(proportion) end

#set_ratio(width, height) ⇒ void #set_ratio(size) ⇒ void #set_ratio(ratio) ⇒ void Also known as: ratio=

Overloads:

  • #set_ratio(width, height) ⇒ void

    This method returns an undefined value.

    Set the ratio item attribute.

    Parameters:

    • width (Integer)
    • height (Integer)
  • #set_ratio(size) ⇒ void

    This method returns an undefined value.

    Set the ratio item attribute.

    Parameters:

  • #set_ratio(ratio) ⇒ void

    This method returns an undefined value.

    Set the ratio item attribute.

    Parameters:

    • ratio (Float)


47
# File 'lib/wx/doc/gen/sizer_item.rb', line 47

def set_ratio(*args) end

#set_user_data(userData) ⇒ void Also known as: user_data=

This method returns an undefined value.

Parameters:



231
# File 'lib/wx/doc/gen/sizer_item.rb', line 231

def set_user_data(userData) end

#show(show) ⇒ void

This method returns an undefined value.

Set the show item attribute, which sizers use to determine if the item is to be made part of the layout or not.

If the item is tracking a window then it is shown or hidden as needed.

Parameters:

  • show (Boolean)


239
# File 'lib/wx/doc/gen/sizer_item.rb', line 239

def show(show) end