# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # DD_CHANGE_DIR = 256 # DD_DIR_MUST_EXIST = 512 # DD_MULTIPLE = 1024 # DD_SHOW_HIDDEN = 1 # DD_NEW_DIR_BUTTON = 0 # DD_DEFAULT_STYLE = 536877120 # Initial folder for generic directory dialog. # DIR_DIALOG_DEFAULT_FOLDER_STR = "/" # Default message for directory selector dialog. # DIR_SELECTOR_PROMPT_STR = "Select a directory" # Default name for directory selector dialog. # DIR_DIALOG_NAME_STR = "wxDirCtrl" # Pops up a directory selector dialog. # The arguments have the same meaning as those of {Wx::DirDialog#initialize}. The message is displayed at the top, and the default_path, if specified, is set as the initial selection. # The application must check for an empty return value (if the user pressed Cancel). For example: # # const wxString& dir = wxDirSelector("Choose a folder"); # if ( !dir.empty() ) # { # ... # } # # Include file: #include # @param message [String] # @param default_path [String] # @param style [Integer] # @param pos [Array(Integer, Integer), Wx::Point] # @param parent [Wx::Window] # @return [String] def self.dir_selector(message=Wx::DIR_SELECTOR_PROMPT_STR, default_path=Wx::EMPTY_STRING, style=0, pos=Wx::DEFAULT_POSITION, parent=nil) end # This class represents the directory chooser dialog. # === Styles # # This class supports the following styles: # # - {Wx::DD_DEFAULT_STYLE}: Equivalent to a combination of {Wx::DEFAULT_DIALOG_STYLE} and {Wx::RESIZE_BORDER}. # - {Wx::DD_DIR_MUST_EXIST}: The dialog will allow the user to choose only an existing folder. When this style is not given, a "Create new directory" button is added to the dialog (on Windows) or some other way is provided to the user to type the name of a new folder. # - {Wx::DD_CHANGE_DIR}: Change the current working directory to the directory chosen by the user. This flag cannot be used with the {Wx::DD_MULTIPLE} style. # - {Wx::DD_MULTIPLE}: Allow the user to select multiple directories. This flag is only available since wxWidgets 3.1.4 # - {Wx::DD_SHOW_HIDDEN}: Show hidden and system folders. This flag is only available since wxWidgets 3.1.4 # # Notice that {Wx::RESIZE_BORDER} has special side effect under Windows where two different directory selection dialogs are available and this style also implicitly selects the new version as the old one always has fixed size. As the new version is almost always preferable, it is recommended that {Wx::RESIZE_BORDER} style be always used. This is the case if the dialog is created with the default style value but if you need to use any additional styles you should still specify {Wx::DD_DEFAULT_STYLE} unless you explicitly need to use the old dialog version under Windows. E.g. do # # wxDirDialog dlg(NULL, "Choose input directory", "", # wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST); # instead of just using {Wx::DD_DIR_MUST_EXIST} style alone. # MacOS 10.11+ does not display a title bar on the dialog. Use {Wx::DirDialog#set_message} to change the string displayed to the user at the top of the dialog after creation. The {Wx::DirDialog#set_title} method is provided for compatibility with pre-10.11 MacOS versions that do still support displaying the title bar. # # === # # Category: Common Dialogs # @see wxDirDialog Overview # @see Wx::FileDialog # # class DirDialog < Dialog # Constructor. # Use {Wx::DirDialog#show_modal} to show the dialog. # @param parent [Wx::Window] Parent window. # @param message [String] Message to show on the dialog. # @param defaultPath [String] The default path, or the empty string. # @param style [Integer] The dialog style. See {Wx::DirDialog} # @param pos [Array(Integer, Integer), Wx::Point] Dialog position. Ignored under Windows. # @param size [Array(Integer, Integer), Wx::Size] Dialog size. Ignored under Windows. # @param name [String] The dialog name, not used. # @return [DirDialog] def initialize(parent, message=Wx::DIR_SELECTOR_PROMPT_STR, defaultPath=Wx::EMPTY_STRING, style=Wx::DD_DEFAULT_STYLE, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, name=Wx::DIR_DIALOG_NAME_STR) end # Returns the message that will be displayed on the dialog. # @return [String] def get_message; end alias_method :message, :get_message # Returns the default or user-selected path. # This function can't be used with dialogs which have the {Wx::DD_MULTIPLE} style, use {Wx::DirDialog#get_paths} instead. # @return [String] def get_path; end alias_method :path, :get_path # Fills the array paths with the full paths of the chosen directories. # This function should only be used with the dialogs which have {Wx::DD_MULTIPLE} style, use {Wx::DirDialog#get_path} for the others. # @param paths [Array] # @return [void] def get_paths(paths) end alias_method :paths, :get_paths # Sets the message that will be displayed on the dialog. # @param message [String] # @return [void] def set_message(message) end alias_method :message=, :set_message # Sets the default path. # @param path [String] # @return [void] def set_path(path) end alias_method :path=, :set_path # 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 # DirDialog end