# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # This control can be used to place a directory listing (with optional files) on an arbitrary window. # The control contains a {Wx::TreeCtrl} window representing the directory hierarchy, and optionally, a {Wx::Choice} window containing a list of filters. # === Styles # # This class supports the following styles: # # - {Wx::DIRCTRL_DIR_ONLY}: Only show directories, and not files. # # - {Wx::DIRCTRL_3D_INTERNAL}: Use 3D borders for internal controls. This is the default. # # - {Wx::DIRCTRL_SELECT_FIRST}: When setting the default path, select the first file in the directory. # # - {Wx::DIRCTRL_SHOW_FILTERS}: Show the drop-down filter list. # # - {Wx::DIRCTRL_EDIT_LABELS}: Allow the folder and file labels to be editable. # # - {Wx::DIRCTRL_MULTIPLE}: Allows multiple files and folders to be selected. # # === # # Category: {Wx::Controls}
Appearance:
wxMSW Appearance # wxGTK Appearance # wxOSX Appearance #
# === Events emitted by this class # # Event handler methods for events emitted by this class: # # - {Wx::EvtHandler#evt_dirctrl_selectionchanged}(id, meth = nil, &block): Selected directory has changed. Processes a {Wx::EVT_DIRCTRL_SELECTIONCHANGED} event type. Notice that this event is generated even for the changes done by the program itself and not only those done by the user. Available since wxWidgets 2.9.5. # # - {Wx::EvtHandler#evt_dirctrl_fileactivated}(id, meth = nil, &block): The user activated a file by double-clicking or pressing Enter. Available since wxWidgets 2.9.5. # class GenericDirCtrl < Control # @overload initialize() # Default constructor. # @return [Wx::GenericDirCtrl] # @overload initialize(parent, id=Wx::StandardID::ID_ANY, dir=Wx::DIR_DIALOG_DEFAULT_FOLDER_STR, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::DIRCTRL_DEFAULT_STYLE, filter=(''), defaultFilter=0, name=Wx::TREE_CTRL_NAME_STR) # Main constructor. # @param parent [Wx::Window] Parent window. # @param id [Integer] Window identifier. # @param dir [String] Initial folder. # @param pos [Array(Integer, Integer), Wx::Point] Position. # @param size [Array(Integer, Integer), Wx::Size] Size. # @param style [Integer] Window style. Please see {Wx::GenericDirCtrl} for a list of possible styles. # @param filter [String] A filter string, using the same syntax as that for {Wx::FileDialog}. This may be empty if filters are not being used. Example: "All files (*.*)|*.*|JPEG files (*.jpg)|*.jpg" # @param defaultFilter [Integer] The zero-indexed default filter setting. # @param name [String] The window name. # @return [Wx::GenericDirCtrl] def initialize(*args) end # Collapse the given path. # @param path [String] # @return [Boolean] def collapse_path(path) end # Collapses the entire tree. # @return [void] def collapse_tree; end # Create function for two-step construction. # See {Wx::GenericDirCtrl#initialize} for details. # @param parent [Wx::Window] # @param id [Integer] # @param dir [String] # @param pos [Array(Integer, Integer), Wx::Point] # @param size [Array(Integer, Integer), Wx::Size] # @param style [Integer] # @param filter [String] # @param defaultFilter [Integer] # @param name [String] # @return [Boolean] def create(parent, id=Wx::StandardID::ID_ANY, dir=Wx::DIR_DIALOG_DEFAULT_FOLDER_STR, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::DIRCTRL_DEFAULT_STYLE, filter=(''), defaultFilter=0, name=Wx::TREE_CTRL_NAME_STR) end # Tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control. # @param path [String] # @return [Boolean] def expand_path(path) end # Gets the default path. # @return [String] def get_default_path; end alias_method :default_path, :get_default_path # Gets selected filename path only (else empty string). # This function doesn't count a directory as a selection. # @return [String] def get_file_path; end alias_method :file_path, :get_file_path # Fills the array paths with the currently selected filepaths. # This function doesn't count a directory as a selection. # @param paths [Array] # @return [void] def get_file_paths(paths) end alias_method :file_paths, :get_file_paths # Returns the filter string. # @return [String] def get_filter; end alias_method :filter, :get_filter # Returns the current filter index (zero-based). # @return [Integer] def get_filter_index; end alias_method :filter_index, :get_filter_index # Returns a pointer to the filter list control (if present). # @return [Wx::DirFilterListCtrl] def get_filter_list_ctrl; end alias_method :filter_list_ctrl, :get_filter_list_ctrl # @overload get_path() # Gets the currently-selected directory or filename. # @return [String] # @overload get_path(itemId) # Gets the path corresponding to the given tree control item. # @param itemId [Wx::TreeItemId] # @return [String] def get_path(*args) end alias_method :path, :get_path # Fills the array paths with the selected directories and filenames. # @param paths [Array] # @return [void] def get_paths(paths) end alias_method :paths, :get_paths # Returns the root id for the tree control. # @return [Wx::TreeItemId] def get_root_id; end alias_method :root_id, :get_root_id # Returns a pointer to the tree control. # @return [Wx::TreeCtrl] def get_tree_ctrl; end alias_method :tree_ctrl, :get_tree_ctrl # Initializes variables. # @return [void] def init; end # Collapse and expand the tree, thus re-creating it from scratch. # May be used to update the displayed directory content. # @return [void] def re_create_tree; end # Sets the default path. # @param path [String] # @return [void] def set_default_path(path) end alias_method :default_path=, :set_default_path # Sets the filter string. # @param filter [String] # @return [void] def set_filter(filter) end alias_method :filter=, :set_filter # Sets the current filter index (zero-based). # @param n [Integer] # @return [void] def set_filter_index(n) end alias_method :filter_index=, :set_filter_index # Sets the current path. # @param path [String] # @return [void] def set_path(path) end alias_method :path=, :set_path # @param show [Boolean] If true, hidden folders and files will be displayed by the control. If false, they will not be displayed. # @return [void] def show_hidden(show) end # Selects the given item. # In multiple selection controls, can be also used to deselect a currently selected item if the value of select is false. Existing selections are not changed. Only visible items can be (de)selected, otherwise use {Wx::GenericDirCtrl#expand_path}. # @param path [String] # @param select [Boolean] # @return [void] def select_path(path, select=true) end # Selects only the specified paths, clearing any previous selection. # Only supported when {Wx::DIRCTRL_MULTIPLE} is set. # @param paths [Array] # @return [void] def select_paths(paths) end # Removes the selection from all currently selected items. # @return [void] def unselect_all; end end # GenericDirCtrl end