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.
__init__ | Default class constructor. |
AddFileToHistory | Adds a file to the file history list, if the object has a pointer to an appropriate file menu. |
AddFilesToMenu | Appends the files in the history list, to all menus managed by the file history object |
AddFilesToMenu2 | Appends the files in the history list, to the given menu only. |
GetBaseId | Returns the base identifier for the range used for appending items. |
GetCount | Returns the number of files currently stored in the file history. |
GetHistoryFile | Returns the file at this index (zero-based). |
GetMaxFiles | Returns the maximum number of files that can be stored. |
GetMenus | Returns the list of menus that are managed by this file history object. |
GetNoHistoryFiles | Returns the number of files currently stored in the file history. |
Load | Loads the file history from the given config object. |
RemoveFileFromHistory | Removes the specified file from the history. |
RemoveMenu | Removes this menu from the list of those managed by this object. |
Save | Saves the file history to the given config object. |
SetBaseId | Sets the base identifier for the range used for appending items. |
UseMenu | Adds this menu to the list of those menus that are managed by this file history object. |
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.
Default class constructor.
Parameters: |
|
---|
Note
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 FileHistory in your application.
Adds a file to the file history list, if the object has a pointer to an appropriate file menu.
Parameters: | fnNew (string) – the file name to add to the history list. |
---|
Appends the files in the history list, to all menus managed by the file history object if menu is None. Otherwise it calls the auxiliary method AddFilesToMenu2.
Parameters: | menu – if not None, an instance of FlatMenu. |
---|
Appends the files in the history list, to the given menu only.
Parameters: | menu – an instance of FlatMenu. |
---|
Returns the base identifier for the range used for appending items.
Returns the number of files currently stored in the file history.
Returns the file at this index (zero-based).
Parameters: | index (integer) – the index at which the file is stored in the file list (zero-based). |
---|
Returns the maximum number of files that can be stored.
Returns the list of menus that are managed by this file history object.
See also
Returns the number of files currently stored in the file history.
Loads the file history from the given config object.
Parameters: | config – an instance of wx.Config. |
---|
Note
This function should be called explicitly by the application.
See also
Save.
Removes the specified file from the history.
Parameters: | index (integer) – the zero-based index indicating the file name position in the file list. |
---|
Removes this menu from the list of those managed by this object.
Parameters: | menu – an instance of FlatMenu. |
---|
Saves the file history to the given config object.
Parameters: | config – an instance of wx.Config. |
---|
Note
This function should be called explicitly by the application.
See also
Load.
Sets the base identifier for the range used for appending items.
Parameters: | baseId (integer) – the base identifier for the range used for appending items. |
---|
Adds this menu to the list of those menus that are managed by this file history object.
Parameters: | menu – an instance of FlatMenu. |
---|
See also
AddFilesToMenu for initializing the menu with filenames that are already in the history when this function is called, as this is not done automatically.