Class: Wx::SizerItem
Overview
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
Instance Method Summary collapse
-
#assign_sizer(sizer) ⇒ void
Set the sizer tracked by this item.
- #assign_spacer(*args) ⇒ Object
-
#assign_window(window) ⇒ void
Set the window to be tracked by this item.
-
#calc_min ⇒ Wx::Size
Calculates the minimum desired size for the item, including any space needed by borders.
-
#delete_windows ⇒ void
Destroy the window or the windows in a subsizer, depending on the type of item.
-
#detach_sizer ⇒ void
Enable deleting the SizerItem without destroying the contained sizer.
-
#get_border ⇒ Integer
(also: #border)
Return the border attribute.
-
#get_flag ⇒ Integer
(also: #flag)
Return the flags attribute.
-
#get_id ⇒ Integer
(also: #id)
Return the numeric id of SizerItem, or Wx::StandardID::ID_NONE if the id has not been set.
-
#get_min_size ⇒ Wx::Size
(also: #min_size)
Get the minimum size needed for the item.
-
#get_position ⇒ Wx::Point
(also: #position)
What is the current position of the item, as set in the last Layout.
-
#get_proportion ⇒ Integer
(also: #proportion)
Get the proportion item attribute.
-
#get_ratio ⇒ Float
(also: #ratio)
Get the ratio item attribute.
-
#get_rect ⇒ Wx::Rect
(also: #rect)
Get the rectangle of the item on the parent window, excluding borders.
-
#get_size ⇒ Wx::Size
(also: #size)
Get the current size of the item, as set in the last Layout.
-
#get_sizer ⇒ Wx::Sizer
(also: #sizer)
If this item is tracking a sizer, return it.
-
#get_spacer ⇒ Wx::Size
(also: #spacer)
If this item is tracking a spacer, return its size.
-
#get_user_data ⇒ Object
(also: #user_data)
Get the userData item attribute.
-
#get_window ⇒ Wx::Window
(also: #window)
If this item is tracking a window then return it.
-
#is_shown ⇒ Boolean
(also: #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.
-
#is_sizer ⇒ Boolean
(also: #sizer?)
Is this item a sizer?.
-
#is_spacer ⇒ Boolean
(also: #spacer?)
Is this item a spacer?.
-
#is_window ⇒ Boolean
(also: #window?)
Is this item a window?.
-
#set_border(border) ⇒ void
(also: #border=)
Set the border item attribute.
-
#set_dimension(pos, size) ⇒ void
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.
-
#set_flag(flag) ⇒ void
(also: #flag=)
Set the flag item attribute.
-
#set_id(id) ⇒ void
(also: #id=)
Sets the numeric id of the SizerItem to id.
-
#set_init_size(x, y) ⇒ void
Sets the minimum size to be allocated for this item.
- #set_min_size(*args) ⇒ Object (also: #min_size=)
-
#set_proportion(proportion) ⇒ void
(also: #proportion=)
Set the proportion item attribute.
- #set_ratio(*args) ⇒ Object (also: #ratio=)
- #set_user_data(userData) ⇒ void (also: #user_data=)
-
#show(show) ⇒ void
Set the show item attribute, which sizers use to determine if the item is to be made part of the layout or not.
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.
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
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.
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.
62 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 62 def assign_window(window) end |
#calc_min ⇒ Wx::Size
Calculates the minimum desired size for the item, including any space needed by borders.
73 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 73 def calc_min; end |
#delete_windows ⇒ void
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_sizer ⇒ void
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_border ⇒ Integer Also known as: border
Return the border attribute.
85 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 85 def get_border; end |
#get_flag ⇒ Integer Also known as: flag
Return the flags attribute.
See wxSizer flags list for details.
92 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 92 def get_flag; end |
#get_id ⇒ Integer Also known as: id
Return the numeric id of Wx::SizerItem, or Wx::StandardID::ID_NONE if the id has not been set.
97 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 97 def get_id; end |
#get_min_size ⇒ Wx::Size Also known as: min_size
Get the minimum size needed for the item.
102 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 102 def get_min_size; end |
#get_position ⇒ Wx::Point Also known as: position
What is the current position of the item, as set in the last Layout.
121 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 121 def get_position; end |
#get_proportion ⇒ Integer Also known as: proportion
Get the proportion item attribute.
126 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 126 def get_proportion; end |
#get_ratio ⇒ Float Also known as: ratio
Get the ratio item attribute.
131 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 131 def get_ratio; end |
#get_rect ⇒ Wx::Rect Also known as: rect
Get the rectangle of the item on the parent window, excluding borders.
136 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 136 def get_rect; end |
#get_size ⇒ Wx::Size Also known as: size
Get the current size of the item, as set in the last Layout.
141 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 141 def get_size; end |
#get_sizer ⇒ Wx::Sizer Also known as: sizer
If this item is tracking a sizer, return it.
NULL otherwise.
148 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 148 def get_sizer; end |
#get_spacer ⇒ Wx::Size Also known as: spacer
If this item is tracking a spacer, return its size.
153 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 153 def get_spacer; end |
#get_user_data ⇒ Object Also known as: user_data
Get the userData item attribute.
158 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 158 def get_user_data; end |
#get_window ⇒ Wx::Window Also known as: window
If this item is tracking a window then return it.
NULL otherwise.
165 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 165 def get_window; end |
#is_shown ⇒ Boolean 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).
173 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 173 def is_shown; end |
#is_sizer ⇒ Boolean Also known as: sizer?
Is this item a sizer?
178 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 178 def is_sizer; end |
#is_spacer ⇒ Boolean Also known as: spacer?
Is this item a spacer?
183 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 183 def is_spacer; end |
#is_window ⇒ Boolean Also known as: window?
Is this item a window?
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.
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.
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.
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.
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.
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=
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.
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=
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.
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.
239 |
# File 'lib/wx/doc/gen/sizer_item.rb', line 239 def show(show) end |