# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # Default text dialog caption. # GET_TEXT_FROM_USER_PROMPT_STR = "Input Text" # Default password dialog caption. # GET_PASSWORD_FROM_USER_PROMPT_STR = "Enter Password" # Pop up a dialog box with title set to caption, message, and a default_value. # The user may type in text and press OK to return this text, or press Cancel to return the empty string. # If centre is true, the message text (which may include new line characters) is centred; if false, the message is left-justified. # This function is a wrapper around {Wx::TextEntryDialog} and while it is usually more convenient to use, using the dialog directly is more flexible, e.g. it allows you to specify the {Wx::TE_MULTILINE} to allow the user enter multiple lines of text while this function is limited to single line entry only. # @param message [String] # @param caption [String] # @param default_value [String] # @param parent [Wx::Window] # @param x [Integer] # @param y [Integer] # @param centre [true,false] # @return [String] def self.get_text_from_user(message, caption=Wx::GET_TEXT_FROM_USER_PROMPT_STR, default_value=(''), parent=nil, x=Wx::DEFAULT_COORD, y=Wx::DEFAULT_COORD, centre=true) end # Similar to {get_text_from_user} but the text entered in the dialog is not shown on screen but replaced with stars. # This is intended to be used for entering passwords as the function name implies. # @param message [String] # @param caption [String] # @param default_value [String] # @param parent [Wx::Window] # @param x [Integer] # @param y [Integer] # @param centre [true,false] # @return [String] def self.get_password_from_user(message, caption=Wx::GET_PASSWORD_FROM_USER_PROMPT_STR, default_value=(''), parent=nil, x=Wx::DEFAULT_COORD, y=Wx::DEFAULT_COORD, centre=true) end # This class represents a dialog that requests a one-line text string from the user. # It is implemented as a generic wxWidgets dialog. # === # # Category: Common Dialogs # @see wxTextEntryDialog Overview # # class TextEntryDialog < Dialog # @overload set_text_validator(validator) # Associate a validator with the text control used by the dialog. # These methods can be used to limit the user entry to only some characters, e.g. # # wxTextEntryDialog dlg(this, ...); # dlg.SetTextValidator(wxFILTER_ALPHA); # if ( dlg.ShowModal() == wxID_OK ) # { # // We can be certain that this string contains letters only. # wxString value = dlg.GetValue(); # } # # The first overload uses the provided validator which can be of a custom class derived from {Wx::TextValidator} while the second one creates a {Wx::TextValidator} with the specified style. # @param validator [Wx::TextValidator] # @return [void] # @overload set_text_validator(style=Wx::TextValidatorStyle::FILTER_NONE) # Associate a validator with the text control used by the dialog. # These methods can be used to limit the user entry to only some characters, e.g. # # wxTextEntryDialog dlg(this, ...); # dlg.SetTextValidator(wxFILTER_ALPHA); # if ( dlg.ShowModal() == wxID_OK ) # { # // We can be certain that this string contains letters only. # wxString value = dlg.GetValue(); # } # # The first overload uses the provided validator which can be of a custom class derived from {Wx::TextValidator} while the second one creates a {Wx::TextValidator} with the specified style. # @param style [TextValidatorStyle] # @return [void] def set_text_validator(*args) end alias_method :text_validator=, :set_text_validator # @overload initialize() # Default constructor. # Call {Wx::TextEntryDialog#create} to really create the dialog later. # @return [TextEntryDialog] # @overload initialize(parent, message, caption=Wx::GET_TEXT_FROM_USER_PROMPT_STR, value=(''), style=Wx::TextEntryDialogStyle, pos=Wx::DEFAULT_POSITION) # Constructor. # Use {Wx::TextEntryDialog#show_modal} to show the dialog. # See {Wx::TextEntryDialog#create} method for parameter description. # @param parent [Wx::Window] # @param message [String] # @param caption [String] # @param value [String] # @param style [Integer] # @param pos [Array(Integer, Integer), Wx::Point] # @return [TextEntryDialog] def initialize(*args) end # @param parent [Wx::Window] Parent window. # @param message [String] Message to show on the dialog. # @param caption [String] The caption of the dialog. # @param value [String] The default value, which may be the empty string. # @param style [Integer] A dialog style, specifying the buttons ({Wx::OK}, {Wx::CANCEL}) and an optional {Wx::GeometryCentre::CENTRE} style. Additionally, most {Wx::TextCtrl} styles (such as {Wx::TE_PASSWORD} or {Wx::TE_MULTILINE}) may be specified here, but {Wx::TE_READONLY} may not be used, as it doesn't make sense for this dialog, used for text input. # @param pos [Array(Integer, Integer), Wx::Point] Dialog position. # @return [true,false] def create(parent, message, caption=Wx::GET_TEXT_FROM_USER_PROMPT_STR, value=(''), style=Wx::TextEntryDialogStyle, pos=Wx::DEFAULT_POSITION) end # Returns the text that the user has entered if the user has pressed OK, or the original value if the user has pressed Cancel. # @return [String] def get_value; end alias_method :value, :get_value # This function sets the maximum number of characters the user can enter into this dialog. # # @see Wx::TextEntry#set_max_length # @param len [Integer] # @return [void] def set_max_length(len) end alias_method :max_length=, :set_max_length # Sets the default text value. # @param value [String] # @return [void] def set_value(value) end alias_method :value=, :set_value # Convert all text entered into the text control used by the dialog to upper case. # Call this method to ensure that all text entered into the text control used by the dialog is converted on the fly to upper case. If the text control is not empty, its existing contents is also converted to upper case. # @see Wx::TextEntry#force_upper # @return [void] def force_upper; end # Shows the dialog, returning {Wx::StandardID::ID_OK} if the user pressed OK, and {Wx::StandardID::ID_CANCEL} otherwise. # Call {Wx::TextEntryDialog#get_value} to retrieve the values of the string entered by the user after showing the dialog. # @return [Integer] def show_modal; end end # TextEntryDialog # This class represents a dialog that requests a one-line password string from the user. # It is implemented as a generic wxWidgets dialog. # === # # Category: Common Dialogs # @see wxPasswordEntryDialog Overview # # class PasswordEntryDialog < TextEntryDialog # Constructor. # Use {Wx::TextEntryDialog#show_modal} to show the dialog. # @param parent [Wx::Window] Parent window. # @param message [String] Message to show on the dialog. # @param caption [String] The caption of the dialog. # @param defaultValue [String] The default value, which may be the empty string. # @param style [Integer] A dialog style, specifying the buttons ({Wx::OK}, {Wx::CANCEL}) and an optional {Wx::GeometryCentre::CENTRE} style. You do not need to specify the {Wx::TE_PASSWORD} style, it is always applied. # @param pos [Array(Integer, Integer), Wx::Point] Dialog position. # @return [PasswordEntryDialog] def initialize(parent, message, caption=Wx::GET_PASSWORD_FROM_USER_PROMPT_STR, defaultValue=(''), style=Wx::TextEntryDialogStyle, pos=Wx::DEFAULT_POSITION) end end # PasswordEntryDialog end