Class: Wx::FileHistory
Overview
This class is untracked and should not be derived from nor instances extended!
The FileHistory encapsulates a user interface convenience, the list of most recently visited files as shown on a menu (usually the File menu).
FileHistory can manage one or more file menus. More than one menu may be required in an MDI application, where the file history should appear on each MDI child menu as well as the MDI parent frame.
Category: Document/View Framework
Instance Method Summary collapse
-
#add_file_to_history(filename) ⇒ void
Adds a file to the file history list, if the object has a pointer to an appropriate file menu.
- #add_files_to_menu(*args) ⇒ Object
-
#get_base_id ⇒ Integer
(also: #base_id)
Returns the base identifier for the range used for appending items.
-
#get_count ⇒ Integer
(also: #count)
Returns the number of files currently stored in the file history.
-
#get_history_file(index) ⇒ String
(also: #history_file)
Returns the file at this index (zero-based).
-
#get_max_files ⇒ Integer
(also: #max_files)
Returns the maximum number of files that can be stored.
-
#get_menu_path_style ⇒ Wx::FileHistoryMenuPathStyle
(also: #menu_path_style)
Get the current style of the menu item labels.
-
#get_menus ⇒ Array<Wx::Menu>
(also: #menus)
Returns the list of menus that are managed by this file history object.
-
#initialize(maxFiles = 9, idBase = wxID_FILE1) ⇒ Wx::FileHistory
constructor
Constructor.
-
#load(config) ⇒ void
Loads the file history from the given config object.
-
#remove_file_from_history(i) ⇒ void
Removes the specified file from the history.
-
#remove_menu(menu) ⇒ void
Removes this menu from the list of those managed by this object.
-
#save(config) ⇒ void
Saves the file history into the given config object.
-
#set_base_id(baseId) ⇒ void
(also: #base_id=)
Sets the base identifier for the range used for appending items.
-
#set_menu_path_style(style) ⇒ void
(also: #menu_path_style=)
Set the style of the menu item labels.
-
#use_menu(menu) ⇒ void
Adds this menu to the list of those menus that are managed by this file history object.
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize(maxFiles = 9, idBase = wxID_FILE1) ⇒ Wx::FileHistory
Constructor.
Pass the maximum number of files that should be stored and displayed. idBase defaults to StandardID::ID_FILE1 and represents the id given to the first history menu item. Since menu items can't share the same ID you should change idBase (to one of your own defined IDs) when using more than one Wx::FileHistory in your application.
52 |
# File 'lib/wx/doc/gen/file_history.rb', line 52 def initialize(maxFiles=9, idBase=wxID_FILE1) end |
Instance Method Details
#add_file_to_history(filename) ⇒ void
This method returns an undefined value.
Adds a file to the file history list, if the object has a pointer to an appropriate file menu.
57 |
# File 'lib/wx/doc/gen/file_history.rb', line 57 def add_file_to_history(filename) end |
#add_files_to_menu ⇒ void #add_files_to_menu(menu) ⇒ void
66 |
# File 'lib/wx/doc/gen/file_history.rb', line 66 def (*args) end |
#get_base_id ⇒ Integer Also known as: base_id
Returns the base identifier for the range used for appending items.
70 |
# File 'lib/wx/doc/gen/file_history.rb', line 70 def get_base_id; end |
#get_count ⇒ Integer Also known as: count
Returns the number of files currently stored in the file history.
75 |
# File 'lib/wx/doc/gen/file_history.rb', line 75 def get_count; end |
#get_history_file(index) ⇒ String Also known as: history_file
Returns the file at this index (zero-based).
81 |
# File 'lib/wx/doc/gen/file_history.rb', line 81 def get_history_file(index) end |
#get_max_files ⇒ Integer Also known as: max_files
Returns the maximum number of files that can be stored.
86 |
# File 'lib/wx/doc/gen/file_history.rb', line 86 def get_max_files; end |
#get_menu_path_style ⇒ Wx::FileHistoryMenuPathStyle Also known as:
Get the current style of the menu item labels.
Initially returns Wx::FileHistoryMenuPathStyle::FH_PATH_SHOW_IF_DIFFERENT.
149 |
# File 'lib/wx/doc/gen/file_history.rb', line 149 def ; end |
#get_menus ⇒ Array<Wx::Menu> Also known as:
Returns the list of menus that are managed by this file history object.
94 |
# File 'lib/wx/doc/gen/file_history.rb', line 94 def ; end |
#load(config) ⇒ void
This method returns an undefined value.
Loads the file history from the given config object.
This function should be called explicitly by the application.
103 |
# File 'lib/wx/doc/gen/file_history.rb', line 103 def load(config) end |
#remove_file_from_history(i) ⇒ void
This method returns an undefined value.
Removes the specified file from the history.
108 |
# File 'lib/wx/doc/gen/file_history.rb', line 108 def remove_file_from_history(i) end |
#remove_menu(menu) ⇒ void
This method returns an undefined value.
Removes this menu from the list of those managed by this object.
113 |
# File 'lib/wx/doc/gen/file_history.rb', line 113 def () end |
#save(config) ⇒ void
This method returns an undefined value.
Saves the file history into the given config object.
This must be called explicitly by the application.
121 |
# File 'lib/wx/doc/gen/file_history.rb', line 121 def save(config) end |
#set_base_id(baseId) ⇒ void Also known as: base_id=
This method returns an undefined value.
Sets the base identifier for the range used for appending items.
126 |
# File 'lib/wx/doc/gen/file_history.rb', line 126 def set_base_id(baseId) end |
#set_menu_path_style(style) ⇒ void Also known as:
This method returns an undefined value.
Set the style of the menu item labels.
By default, the menu item label style is Wx::FileHistoryMenuPathStyle::FH_PATH_SHOW_IF_DIFFERENT.
141 |
# File 'lib/wx/doc/gen/file_history.rb', line 141 def (style) end |
#use_menu(menu) ⇒ void
This method returns an undefined value.
Adds this menu to the list of those menus that are managed by this file history object.
Also see #add_files_to_menu for initializing the menu with filenames that are already in the history when this function is called, as this is not done automatically.
134 |
# File 'lib/wx/doc/gen/file_history.rb', line 134 def () end |