# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # This control allows the user to select a colour. # The generic implementation is a button which brings up a {Wx::ColourDialog} when clicked. Native implementation may differ but this is usually a (small) widget which give access to the colour-chooser dialog. It is only available if {Wx::Setup::USE_COLOURPICKERCTRL} is set to 1 (the default). # === Styles # # This class supports the following styles: # # - {Wx::CLRP_DEFAULT_STYLE}: The default style: 0. # - {Wx::CLRP_USE_TEXTCTRL}: Creates a text control to the left of the picker button which is completely managed by the {Wx::ColourPickerCtrl} and which can be used by the user to specify a colour (see SetColour). The text control is automatically synchronized with button's value. Use functions defined in {Wx::PickerBase} to modify the text control. # - {Wx::CLRP_SHOW_LABEL}: Shows the colour in HTML form (AABBCC) as colour button label (instead of no label at all). # - {Wx::CLRP_SHOW_ALPHA}: Allows selecting opacity in the colour-chooser (effective under {Wx::GTK} and {Wx::OSX}). # # === Events emitted by this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::ColourPickerEvent} events. # Event handler methods for events emitted by this class: # - {Wx::EvtHandler#evt_colourpicker_changed}(id, meth = nil, &block): The user changed the colour selected in the control either using the button or using text control (see {Wx::CLRP_USE_TEXTCTRL}; note that in this case the event is fired only if the user's input is valid, i.e. recognizable). When using a popup dialog for changing the colour, this event is sent only when the changes in the dialog are accepted by the user, unlike EVT_COLOURPICKER_CURRENT_CHANGED. # - {Wx::EvtHandler#evt_colourpicker_current_changed}(id, meth = nil, &block): The user changed the currently selected colour in the dialog associated with the control. This event is sent immediately when the selection changes and you must also handle EVT_COLOUR_CANCELLED to revert to the previously selected colour if the selection ends up not being accepted. This event is new since wxWidgets 3.1.3 and currently is only implemented in {Wx::MSW}. # - {Wx::EvtHandler#evt_colourpicker_dialog_cancelled}(id, meth = nil, &block): The user cancelled the colour dialog associated with the control, i.e. closed it without accepting the selection. This event is new since wxWidgets 3.1.3 and currently is only implemented in {Wx::MSW}. # # === # # Category: Picker Controls
Appearance:
{Wx::MSW} Appearance # {Wx::GTK} Appearance # {Wx::OSX} Appearance #
# @see Wx::ColourDialog # @see Wx::ColourPickerEvent # # class ColourPickerCtrl < PickerBase # @overload set_colour(col) # Sets the currently selected colour. # See {Wx::Colour#set}. # @param col [Wx::Colour,String,Symbol] # @return [void] # @overload set_colour(colname) # Sets the currently selected colour. # See {Wx::Colour#set}. # @param colname [String] # @return [void] def set_colour(*args) end alias_method :colour=, :set_colour # @overload initialize() # @return [ColourPickerCtrl] # @overload initialize(parent, id, colour=Wx::BLACK, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::CLRP_DEFAULT_STYLE, validator=Wx::DEFAULT_VALIDATOR, name=Wx::COLOUR_PICKER_CTRL_NAME_STR) # Initializes the object and calls {Wx::ColourPickerCtrl#create} with all the parameters. # @param parent [Wx::Window] # @param id [Integer] # @param colour [Wx::Colour,String,Symbol] # @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 [ColourPickerCtrl] def initialize(*args) end # Creates a colour picker with the given arguments. # true if the control was successfully created or false if creation failed. # @param parent [Wx::Window] Parent window, must not be non-NULL. # @param id [Integer] The identifier for the control. # @param colour [Wx::Colour,String,Symbol] The initial colour shown in the control. # @param pos [Array(Integer, Integer), Wx::Point] Initial position. # @param size [Array(Integer, Integer), Wx::Size] Initial size. # @param style [Integer] The window style, see {Wx::CRLP_}* flags. # @param validator [Wx::Validator] Validator which can be used for additional data checks. # @param name [String] Control name. # @return [true,false] def create(parent, id, colour=Wx::BLACK, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::CLRP_DEFAULT_STYLE, validator=Wx::DEFAULT_VALIDATOR, name=Wx::COLOUR_PICKER_CTRL_NAME_STR) end # Returns the currently selected colour. # @return [Wx::Colour] def get_colour; end alias_method :colour, :get_colour end # ColourPickerCtrl end