Class: Wx::StdDialogButtonSizer

Inherits:
BoxSizer show all
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

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

#initializeWx::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

Parameters:



43
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 43

def add_button(button) end

#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:



84
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 84

def calc_min; end

#realizevoid

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.

Parameters:

  • minSize (Array(Integer, Integer), Wx::Size)


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: affirmative_button=

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.

Parameters:



54
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 54

def set_affirmative_button(button) end

#set_cancel_button(button) ⇒ void Also known as: cancel_button=

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.

Parameters:



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

def set_cancel_button(button) end

#set_negative_button(button) ⇒ void Also known as: negative_button=

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.

Parameters:



70
# File 'lib/wx/doc/gen/std_dialog_button_sizer.rb', line 70

def set_negative_button(button) end