# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # # EVT_TOGGLEBUTTON = 10188 # {Wx::ToggleButton} is a button that stays pressed when clicked by the user. # # In other words, it is similar to {Wx::CheckBox} in functionality but looks like a {Wx::Button}. # Since wxWidgets version 2.9.0 this control emits an update UI event. # You can see {Wx::ToggleButton} in action in Widgets Sample. # ### 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_togglebutton}(id, meth = nil, &block): Handles a {Wx::EVT_TOGGLEBUTTON} event. # # Category: {Wx::Controls} <div class='appearance'><span class='appearance'>Appearance:</span><table><tr><td> WXMSW Appearance # </td><td> WXGTK Appearance # </td><td> WXOSX Appearance # </td></tr></table></div> # @see Wx::CheckBox # @see Wx::Button # @see Wx::BitmapToggleButton # # # @wxrb_require USE_TOGGLEBTN class ToggleButton < AnyButton # @overload initialize() # Default constructor. # @return [Wx::ToggleButton] # @overload initialize(parent, id, label, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0, val=Wx::DEFAULT_VALIDATOR, name=Wx::CHECK_BOX_NAME_STR) # Constructor, creating and showing a toggle button. # # # @see Wx::ToggleButton#create # @see Wx::Validator # @param parent [Wx::Window] Parent window. Must not be NULL. # @param id [Integer] Toggle button identifier. The value {Wx::StandardID::ID_ANY} indicates a default value. # @param label [String] Text to be displayed next to the toggle button. # @param pos [Array(Integer, Integer), Wx::Point] Toggle button position. If {Wx::DEFAULT_POSITION} is specified then a default position is chosen. # @param size [Array(Integer, Integer), Wx::Size] Toggle button size. If {Wx::DEFAULT_SIZE} is specified then a default size is chosen. # @param style [Integer] Window style. See {Wx::ToggleButton}. # @param val [Wx::Validator] Window validator. # @param name [String] Window name. # @return [Wx::ToggleButton] def initialize(*args) end # Creates the toggle button for two-step construction. # # See {Wx::ToggleButton#initialize} for 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 val [Wx::Validator] # @param name [String] # @return [Boolean] def create(parent, id, label, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0, val=Wx::DEFAULT_VALIDATOR, name=Wx::CHECK_BOX_NAME_STR) end # Gets the state of the toggle button. # # Returns true if it is pressed, false otherwise. # @return [Boolean] def get_value; end alias_method :value, :get_value # Sets the toggle button to the given state. # # This does not cause a EVT_TOGGLEBUTTON event to be emitted. # @param state [Boolean] If true, the button is pressed. # @return [void] def set_value(state) end alias_method :value=, :set_value end # ToggleButton # {Wx::BitmapToggleButton} is a {Wx::ToggleButton} that contains a bitmap instead of text. # # This class is not available in all ports currently (although it is available in the major ones), test for {Wx::HAS_BITMAPTOGGLEBUTTON} to determine whether it can be used (in addition for possibly testing for {Wx::Setup::USE_TOGGLEBTN} which can be set to 0 to explicitly disable support for this class and {Wx::ToggleButton}). # This control emits an update UI event. # ### 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_togglebutton}(id, meth = nil, &block): Handles a {Wx::EVT_TOGGLEBUTTON} event. # # Category: {Wx::Controls} # # @wxrb_require USE_TOGGLEBTN class BitmapToggleButton < ToggleButton # @overload initialize() # Default constructor. # @return [Wx::BitmapToggleButton] # @overload initialize(parent, id, label, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0, val=Wx::DEFAULT_VALIDATOR, name=Wx::CHECK_BOX_NAME_STR) # Constructor, creating and showing a toggle button with the bitmap label. # # Internally calls {Wx::BitmapToggleButton#create}. # @param parent [Wx::Window] # @param id [Integer] # @param label [Wx::BitmapBundle,Wx::Bitmap,Wx::Icon,Wx::Image] # @param pos [Array(Integer, Integer), Wx::Point] # @param size [Array(Integer, Integer), Wx::Size] # @param style [Integer] # @param val [Wx::Validator] # @param name [String] # @return [Wx::BitmapToggleButton] def initialize(*args) end # Create method for two-step construction. # @param parent [Wx::Window] # @param id [Integer] # @param label [Wx::BitmapBundle,Wx::Bitmap,Wx::Icon,Wx::Image] # @param pos [Array(Integer, Integer), Wx::Point] # @param size [Array(Integer, Integer), Wx::Size] # @param style [Integer] # @param val [Wx::Validator] # @param name [String] # @return [Boolean] def create(parent, id, label, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0, val=Wx::DEFAULT_VALIDATOR, name=Wx::CHECK_BOX_NAME_STR) end # Gets the state of the toggle button. # # Returns true if it is pressed, false otherwise. # @return [Boolean] def get_value; end alias_method :value, :get_value # Sets the toggle button to the given state. # # This does not cause a EVT_TOGGLEBUTTON event to be emitted. # @param state [Boolean] If true, the button is pressed. # @return [void] def set_value(state) end alias_method :value=, :set_value end # BitmapToggleButton end