# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # # EVT_COLOUR_CHANGED = 10183 # Shows the colour selection dialog and returns the colour selected by user or invalid colour (use {Wx::Colour#is_ok} to test whether a colour is valid) if the dialog was cancelled. # @param parent [Wx::Window] The parent window for the colour selection dialog. # @param colInit [Wx::Colour,String,Symbol] If given, this will be the colour initially selected in the dialog. # @param caption [String] If given, this will be used for the dialog caption. # @param data [Wx::ColourData] Optional object storing additional colour dialog settings, such as custom colours. If none is provided the same settings as the last time are used. # @return [Wx::Colour] def self.get_colour_from_user(parent, colInit, caption=(''), data=nil) end # This class represents the colour chooser dialog. # Starting from wxWidgets 3.1.3 and currently in the MSW port only, this dialog generates {Wx::EVT_COLOUR_CHANGED} events while it is being shown, i.e. from inside its {Wx::ColourDialog#show_modal} method, that notify the program about the change of the currently selected colour and allow it to e.g. preview the effect of selecting this colour. Note that if you react to this event, you should also correctly revert to the previously selected colour if the dialog is cancelled by the user. # Example of using this class with dynamic feedback for the selected colour: # ```ruby # # Some function for redrawing using the given colour. Ideally, it # # shouldn't do anything if the colour is the same as the one used # # before. # # def redraw(colour) ... end # # data = Wx::ColourData.new # data.set_colour(initialColourToUse) # Wx::ColourDialog(self, data) do |dlg| # dlg.evt_colour_changed { |event| redraw(event.get_colour) } # if dlg.show_modal == Wx::ID_OK # # Colour did change. # else # # Colour didn't change. # end # end # # # This call is unnecessary under platforms generating # # Wx::EVT_COLOUR_CHANGED if the dialog was accepted and unnecessary # # under the platforms not generating this event if it was cancelled, # # so we could check for the different cases explicitly to avoid it, # # but it's simpler to just always call it. # redraw(data.get_colour) # ``` # # === # # Category: Common Dialogs # @see wxColourDialog Overview # @see Wx::Colour # @see Wx::ColourData # @see Wx::ColourDialogEvent # @see get_colour_from_user # # class ColourDialog < Dialog # Constructor. # Pass a parent window, and optionally a pointer to a block of colour data, which will be copied to the colour dialog's colour data. # Custom colours from colour data object will be used in the dialog's colour palette. Invalid entries in custom colours list will be ignored on some platforms(GTK) or replaced with white colour on platforms where custom colours palette has fixed size (MSW). # @see Wx::ColourData # @param parent [Wx::Window] # @param data [Wx::ColourData] # @return [Wx::ColourDialog] def initialize(parent, data=nil) end # Same as {colour_dialog}. # @param parent [Wx::Window] # @param data [Wx::ColourData] # @return [Boolean] def create(parent, data=nil) end # Shows the dialog, returning {Wx::StandardID::ID_OK} if the user pressed OK, and {Wx::StandardID::ID_CANCEL} otherwise. # @return [Integer] def show_modal; end end # ColourDialog # This class holds a variety of information related to colour dialogs. # === # # Category: Common Dialogs, Data Structures # @see Wx::Colour # @see Wx::ColourDialog # @see wxColourDialog Overview # # # # @note This class is untracked and should not be derived from nor instances extended! class ColourData < Object # # NUM_CUSTOM = 16 # Constructor. # Initializes the custom colours to {Wx::NULL_COLOUR}, the data colour setting to black, and the choose full setting to true. # @return [Wx::ColourData] def initialize; end # Under Windows, determines whether the Windows colour dialog will display the full dialog with custom colour selection controls. # Has no meaning under other platforms. # The default value is true. # @return [Boolean] def get_choose_full; end alias_method :choose_full, :get_choose_full # Indicates whether the colour dialog will display alpha values and an opacity selector. # It is meaningful under wxGTK, wxOSX and with regards to generic colour dialog. # The default value is false, except wxOSX where it is true (for the sake of backward compatibility). # @return [Boolean] def get_choose_alpha; end alias_method :choose_alpha, :get_choose_alpha # Gets the current colour associated with the colour dialog. # The default colour is black. # @return [Wx::Colour] def get_colour; end alias_method :colour, :get_colour # Returns custom colours associated with the colour dialog. # @param i [Integer] An integer between 0 and 15, being any of the 15 custom colours that the user has saved. The default custom colours are invalid colours. # @return [Wx::Colour] def get_custom_colour(i) end alias_method :custom_colour, :get_custom_colour # Under Windows, tells the Windows colour dialog to display the full dialog with custom colour selection controls. # Under other platforms, has no effect. # The default value is true. # @param flag [Boolean] # @return [void] def set_choose_full(flag) end alias_method :choose_full=, :set_choose_full # Tells the colour dialog to show alpha values and an opacity selector (slider). # Currently it has effect under wxGTK, wxOSX and for generic colour dialog. # The default value is false, except wxOSX where it is true for backward compatibility. # @param flag [Boolean] # @return [void] def set_choose_alpha(flag) end alias_method :choose_alpha=, :set_choose_alpha # Sets the default colour for the colour dialog. # The default colour is black. # @param colour [Wx::Colour,String,Symbol] # @return [void] def set_colour(colour) end alias_method :colour=, :set_colour # Sets custom colours for the colour dialog. # @param i [Integer] An integer between 0 and 15 for whatever custom colour you want to set. The default custom colours are invalid colours. # @param colour [Wx::Colour,String,Symbol] The colour to set # @return [void] def set_custom_colour(i, colour) end # Converts the colours saved in this class in a string form, separating the various colours with a comma. # @return [String] def to_string; end # Decodes the given string, which should be in the same format returned by {Wx::ColourData#to_string}, and sets the internal colours. # @param str [String] # @return [Boolean] def from_string(str) end end # ColourData end