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.
-
#initialize ⇒ Wx::StdDialogButtonSizer
constructor
Constructor for a 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, #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
Constructor for a Wx::StdDialogButtonSizer.
26 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 26 def initialize; 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:
43 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 43 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.
84 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 84 def calc_min; 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.
47 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 47 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.
78 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 78 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.
54 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 54 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.
62 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 62 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.
70 |
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 70 def () end |