# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # A radio button item is a button which usually denotes one of several mutually exclusive options. # It has a text label next to a (usually) round button. # Radio buttons are typically used in groups of mutually-exclusive buttons, i.e. exactly one of the buttons in the group is checked, and the other ones are unchecked automatically. Such groups are created implicitly, but can also be started explicitly by using {Wx::RB_GROUP} style: a button with this style starts a new group and will become the initial selection in this group. Alternatively, a radio button may be excluded from the group that it would otherwise belong to by using {Wx::RB_SINGLE} style. # To find the other elements of the same radio button group, you can use {Wx::RadioButton#get_first_in_group}, {Wx::RadioButton#get_previous_in_group}, {Wx::RadioButton#get_next_in_group} and {Wx::RadioButton#get_last_in_group} functions. # === Styles # # This class supports the following styles: # # - {Wx::RB_GROUP}: Marks the beginning of a new group of radio buttons. # - {Wx::RB_SINGLE}: Creates a radio button which is not part of any radio button group. When this style is used, no other radio buttons will be turned off automatically when this button is turned on and such behaviour will need to be implemented manually, in the event handler for this button. # # === Events emitted by this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::CommandEvent} events. # Event handler methods for events emitted by this class: # - {Wx::EvtHandler#evt_radiobutton}(id, meth = nil, &block): Process a {Wx::EVT_RADIOBUTTON} event, when the radiobutton is clicked. # # === # # Category: {Wx::Controls}
Appearance:
{Wx::MSW} Appearance # {Wx::GTK} Appearance # {Wx::OSX} Appearance #
# @see Events and Event Handling # @see Wx::RadioBox # @see Wx::CheckBox # # class RadioButton < Control # @overload initialize() # Default constructor. # # @see Wx::RadioButton#create # @see Wx::Validator # @return [RadioButton] # @overload initialize(parent, id, label, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0, validator=Wx::DEFAULT_VALIDATOR, name=Wx::RadioButtonNameStr) # Constructor, creating and showing a radio button. # # @see Wx::RadioButton#create # @see Wx::Validator # @param parent [Wx::Window] Parent window. Must not be NULL. # @param id [Integer] Window identifier. The value {Wx::StandardID::ID_ANY} indicates a default value. # @param label [String] Label for the radio button. # @param pos [Array(Integer, Integer), Wx::Point] Window position. If {Wx::DEFAULT_POSITION} is specified then a default position is chosen. # @param size [Array(Integer, Integer), Wx::Size] Window size. If {Wx::DEFAULT_SIZE} is specified then a default size is chosen. # @param style [Integer] Window style. See {Wx::RadioButton}. # @param validator [Wx::Validator] Window validator. # @param name [String] Window name. # @return [RadioButton] def initialize(*args) end # Creates the choice for two-step construction. # See {Wx::RadioButton#radio_button} for further details. # @param parent [Wx::Window] # @param id [Integer] # @param label [String] # @param pos [Array(Integer, Integer), Wx::Point] # @param size [Array(Integer, Integer), Wx::Size] # @param style [Integer] # @param validator [Wx::Validator] # @param name [String] # @return [true,false] def create(parent, id, label, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0, validator=Wx::DEFAULT_VALIDATOR, name=Wx::RadioButtonNameStr) end # Returns true if the radio button is checked, false otherwise. # @return [true,false] def get_value; end alias_method :value, :get_value # Sets the radio button to checked or unchecked status. # This does not cause a {Wx::EVT_RADIOBUTTON} event to get emitted. # If the radio button belongs to a radio group exactly one button in the group may be checked and so this method can be only called with value set to true. To uncheck a radio button in a group you must check another button in the same group. # Under MSW, the focused radio button is always selected, i.e. its value is true. And, conversely, calling SetValue(true) will also set focus to the radio button if the focus had previously been on another radio button in the same group as otherwise setting it on wouldn't work. # @param value [true,false] true to check, false to uncheck. # @return [void] def set_value(value) end alias_method :value=, :set_value # Returns the first button of the radio button group this button belongs to. # For a radio button with {Wx::RB_SINGLE} style, this function returns this button itself, as it is the only member of its group. Otherwise, the function returns the closest previous radio button with {Wx::RB_GROUP} style (which could still be this button itself) or the first radio button in the same window. # The returned value is never NULL. # @see Wx::RadioButton#get_previous_in_group # @see Wx::RadioButton#get_next_in_group # @see Wx::RadioButton#get_last_in_group # @return [Wx::RadioButton] def get_first_in_group; end alias_method :first_in_group, :get_first_in_group # Returns the last button of the radio button group this button belongs to. # Similarly to {Wx::RadioButton#get_first_in_group}, this function returns this button itself if it has {Wx::RB_SINGLE} style. Otherwise, the function returns the last button before the next button with {Wx::RB_GROUP} style or the last radio button in the same window. # The returned value is never NULL. # @see Wx::RadioButton#get_previous_in_group # @see Wx::RadioButton#get_next_in_group # @return [Wx::RadioButton] def get_last_in_group; end alias_method :last_in_group, :get_last_in_group # Returns the previous radio button in the same group. # The return value is NULL if there is no predecessor or if this button has {Wx::RB_SINGLE} style. # @see Wx::RadioButton#get_first_in_group # @see Wx::RadioButton#get_next_in_group # @see Wx::RadioButton#get_last_in_group # @return [Wx::RadioButton] def get_previous_in_group; end alias_method :previous_in_group, :get_previous_in_group # Returns the next radio button in the same group. # The return value is NULL if there is no successor or if this button has {Wx::RB_SINGLE} style. # @see Wx::RadioButton#get_first_in_group # @see Wx::RadioButton#get_previous_in_group # @see Wx::RadioButton#get_last_in_group # @return [Wx::RadioButton] def get_next_in_group; end alias_method :next_in_group, :get_next_in_group end # RadioButton end