# :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 font. # The generic implementation is a button which brings up a {Wx::FontDialog} when clicked. Native implementation may differ but this is usually a (small) widget which give access to the font-chooser dialog. It is only available if {Wx::Setup::USE_FONTPICKERCTRL} is set to 1 (the default). # === Styles # # This class supports the following styles: # # - {Wx::FNTP_DEFAULT_STYLE}: The default style: {Wx::FNTP_FONTDESC_AS_LABEL} | {Wx::FNTP_USEFONT_FOR_LABEL}. # # - {Wx::FNTP_USE_TEXTCTRL}: Creates a text control to the left of the picker button which is completely managed by the {Wx::FontPickerCtrl} and which can be used by the user to specify a font (see SetSelectedFont). The text control is automatically synchronized with button's value. Use functions defined in {Wx::PickerBase} to modify the text control. # # - {Wx::FNTP_FONTDESC_AS_LABEL}: Keeps the label of the button updated with the fontface name and the font size. E.g. choosing "Times New Roman bold, italic with # size 10" from the fontdialog, will update the label (overwriting any previous label) with the "Times New Roman, 10" text. # # - {Wx::FNTP_USEFONT_FOR_LABEL}: Uses the currently selected font to draw the label of the button. # # === Events emitted by this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::FontPickerEvent} events. # Event handler methods for events emitted by this class: # # - {Wx::EvtHandler#evt_fontpicker_changed}(id, meth = nil, &block): The user changed the font selected in the control either using the button or using text control (see {Wx::FNTP_USE_TEXTCTRL}; note that in this case the event is fired only if the user's input is valid, i.e. recognizable). # # === # # Category: Picker Controls
Appearance:
wxMSW Appearance # wxGTK Appearance # wxOSX Appearance #
# @see Wx::FontDialog # @see Wx::FontPickerEvent # # class FontPickerCtrl < PickerBase # @overload initialize() # @return [Wx::FontPickerCtrl] # @overload initialize(parent, id, font=Wx::NULL_FONT, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::FNTP_DEFAULT_STYLE, validator=Wx::DEFAULT_VALIDATOR, name=Wx::FONT_PICKER_CTRL_NAME_STR) # Initializes the object and calls {Wx::FontPickerCtrl#create} with all the parameters. # @param parent [Wx::Window] # @param id [Integer] # @param font [Wx::Font,Wx::FontInfo] # @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 [Wx::FontPickerCtrl] def initialize(*args) end # Creates this widget with given parameters. # 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 font [Wx::Font,Wx::FontInfo] The initial font shown in the control. If {Wx::NULL_FONT} is given, the default font is used. # @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::FNTP_}* flags. # @param validator [Wx::Validator] Validator which can be used for additional data checks. # @param name [String] Control name. # @return [Boolean] def create(parent, id, font=Wx::NULL_FONT, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::FNTP_DEFAULT_STYLE, validator=Wx::DEFAULT_VALIDATOR, name=Wx::FONT_PICKER_CTRL_NAME_STR) end # Returns the maximum point size value allowed for the user-chosen font. # @return [Integer] def get_max_point_size; end alias_method :max_point_size, :get_max_point_size # Returns the minimum point size value allowed for the user-chosen font. # @return [Integer] def get_min_point_size; end alias_method :min_point_size, :get_min_point_size # Returns the currently selected colour. # Note that the colour of the font can only be set by the user under Windows currently, elsewhere this method simply returns the colour previously set by {Wx::FontPickerCtrl#set_selected_colour} or black if it hadn't been called. # @return [Wx::Colour] def get_selected_colour; end alias_method :selected_colour, :get_selected_colour # Returns the currently selected font. # Note that this function is completely different from {Wx::Window#get_font}. # @return [Wx::Font] def get_selected_font; end alias_method :selected_font, :get_selected_font # Sets the maximum point size value allowed for the user-chosen font. # The default value is 100. Note that big fonts can require a lot of memory and CPU time both for creation and for rendering; thus, specially because the user has the option to specify the fontsize through a text control (see {Wx::FNTP_USE_TEXTCTRL}), it's a good idea to put a limit to the maximum font size when huge fonts do not make much sense. # @param max [Integer] # @return [void] def set_max_point_size(max) end alias_method :max_point_size=, :set_max_point_size # Sets the minimum point size value allowed for the user-chosen font. # The default value is 0. # @param min [Integer] # @return [void] def set_min_point_size(min) end alias_method :min_point_size=, :set_min_point_size # Sets the font colour. # The font colour is actually only used under Windows currently, but this function is available under all platforms for consistency. # @param colour [Wx::Colour,String,Symbol] # @return [void] def set_selected_colour(colour) end alias_method :selected_colour=, :set_selected_colour # Sets the currently selected font. # Note that this function is completely different from {Wx::Window#set_font}. # @param font [Wx::Font,Wx::FontInfo] # @return [void] def set_selected_font(font) end alias_method :selected_font=, :set_selected_font end # FontPickerCtrl end