Class: Wx::StdDialogButtonSizer
- Defined in:
- lib/wx/doc/gen/std_dialog_button_sizer.rb
Overview
This class creates button layouts which conform to the standard button spacing and ordering defined by the platform or toolkit’s user interface guidelines (if such things exist).
By using this class, you can ensure that all your standard dialogs look correct on all major platforms. Currently it conforms to the Windows, GTK+ and macOS human interface guidelines. When there aren’t interface guidelines defined for a particular platform or toolkit, StdDialogButtonSizer reverts to the Windows implementation. To use this class, first add buttons to the sizer by calling #add_button (or #set_affirmative_button, #set_negative_button or #set_cancel_button) and then call Realize in order to create the actual button layout used. Other than these special operations, this sizer works like any other sizer. If you add a button with Wx::StandardID::ID_SAVE, on macOS the button will be renamed to “Save” and the Wx::StandardID::ID_NO button will be renamed to “Don’t Save” in accordance with the macOS Human Interface Guidelines.
Category: Window Layout
Instance Method Summary collapse
-
#add_button(button) ⇒ void
Adds a button to the StdDialogButtonSizer.
-
#calc_min ⇒ Wx::Size
Implements the calculation of a box sizer’s minimal.
-
#get_affirmative_button ⇒ Wx::Button
(also: #affirmative_button)
Returns the affirmative button for the sizer.
-
#get_apply_button ⇒ Wx::Button
(also: #apply_button)
Returns the apply button for the sizer.
-
#get_cancel_button ⇒ Wx::Button
(also: #cancel_button)
Returns the cancel button for the sizer.
-
#get_help_button ⇒ Wx::Button
(also: #help_button)
Returns the help button for the sizer.
-
#get_negative_button ⇒ Wx::Button
(also: #negative_button)
Returns the negative button for the sizer.
-
#initialize(*args) ⇒ StdDialogButtonSizer
constructor
A new instance of StdDialogButtonSizer.
-
#realize ⇒ void
Rearranges the buttons and applies proper spacing between buttons to make them match the platform or toolkit’s interface guidelines.
-
#reposition_children(minSize) ⇒ void
Method which must be overridden in the derived sizer classes.
-
#set_affirmative_button(button) ⇒ void
(also: #affirmative_button=)
Sets the affirmative button for the sizer.
-
#set_cancel_button(button) ⇒ void
(also: #cancel_button=)
Sets the cancel button for the sizer.
-
#set_negative_button(button) ⇒ void
(also: #negative_button=)
Sets the negative button for the sizer.
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 ⇒ Wx::StdDialogButtonSizer #initialize {|sizer| ... } ⇒ Wx::StdDialogButtonSizer
Returns a new instance of StdDialogButtonSizer.
31 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 31 def initialize(*args) end |
Instance Method Details
#add_button(button) ⇒ void
This method returns an undefined value.
Adds a button to the Wx::StdDialogButtonSizer.
The button must have one of the following identifiers:
48 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 48 def () end |
#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.
124 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 124 def calc_min; end |
#get_affirmative_button ⇒ Wx::Button Also known as:
Returns the affirmative button for the sizer.
Affirmative buttons are those added with ID Wx::StandardID::ID_OK, Wx::StandardID::ID_YES or Wx::StandardID::ID_SAVE. They can have other ID if they were added calling #set_affirmative_button.
58 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 58 def ; end |
#get_apply_button ⇒ Wx::Button Also known as:
Returns the apply button for the sizer.
Apply buttons are those added with ID Wx::StandardID::ID_APPLY.
65 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 65 def ; end |
#get_cancel_button ⇒ Wx::Button Also known as:
Returns the cancel button for the sizer.
Cancel buttons are those added with ID Wx::StandardID::ID_CANCEL or Wx::StandardID::ID_CLOSE. They can have other ID if they were added calling #set_cancel_button.
79 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 79 def ; end |
#get_help_button ⇒ Wx::Button Also known as:
Returns the help button for the sizer.
Help buttons are those added with ID Wx::StandardID::ID_HELP or Wx::StandardID::ID_CONTEXT_HELP.
86 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 86 def ; end |
#get_negative_button ⇒ Wx::Button Also known as:
Returns the negative button for the sizer.
Negative buttons are those added with ID Wx::StandardID::ID_NO. They can have other ID if they were added calling #set_negative_button.
72 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 72 def ; end |
#realize ⇒ void
This method returns an undefined value.
Rearranges the buttons and applies proper spacing between buttons to make them match the platform or toolkit’s interface guidelines.
52 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 52 def realize; 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.
118 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 118 def reposition_children(minSize) end |
#set_affirmative_button(button) ⇒ void Also known as:
This method returns an undefined value.
Sets the affirmative button for the sizer.
This allows you to use identifiers other than the standard identifiers outlined above.
94 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 94 def () end |
#set_cancel_button(button) ⇒ void Also known as:
This method returns an undefined value.
Sets the cancel button for the sizer.
This allows you to use identifiers other than the standard identifiers outlined above.
102 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 102 def () end |
#set_negative_button(button) ⇒ void Also known as:
This method returns an undefined value.
Sets the negative button for the sizer.
This allows you to use identifiers other than the standard identifiers outlined above.
110 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 110 def () end |