The wx.FileHistory encapsulates a user interface convenience, the list of most recently visited files as shown on a menu (usually the File menu).
wx.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.
See also
Document/View Framework, DocManager
Constructor. |
|
Adds a file to the file history list, if the object has a pointer to an appropriate file menu. |
|
Appends the files in the history list, to all menus managed by the file history object. |
|
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). |
|
Returns the maximum number of files that can be stored. |
|
Get the current style of the menu item labels. |
|
Returns the list of menus that are managed by this file history object. |
|
Loads the file history from the given config object. |
|
Removes the specified file from the history. |
|
Removes this menu from the list of those managed by this object. |
|
Saves the file history into the given config object. |
|
Sets the base identifier for the range used for appending items. |
|
Set the style of the menu item labels. |
|
Adds this menu to the list of those menus that are managed by this file history object. |
See |
|
See |
|
See |
|
See |
wx.
FileHistory
(Object)¶Possible constructors:
FileHistory(maxFiles: int=9, idBase: int=ID_FILE1) -> None
The FileHistory encapsulates a user interface convenience, the list of most recently visited files as shown on a menu (usually the File menu).
__init__
(self, maxFiles: int=9, idBase: int=ID_FILE1)¶Constructor.
Pass the maximum number of files that should be stored and displayed.
idBase defaults to wx.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.
maxFiles (int) –
idBase (wx.WindowID) –
None
AddFileToHistory
(self, filename : str)¶Adds a file to the file history list, if the object has a pointer to an appropriate file menu.
filename (string) –
None
AddFilesToMenu
(self, *args, **kw)¶AddFilesToMenu (self)
Appends the files in the history list, to all menus managed by the file history object.
None
AddFilesToMenu (self, menu : Menu)
Appends the files in the history list, to the given menu only.
menu (wx.Menu) –
None
GetBaseId
(self)¶Returns the base identifier for the range used for appending items.
int
GetCount
(self)¶Returns the number of files currently stored in the file history.
int
GetHistoryFile
(self, index : int)¶Returns the file at this index (zero-based).
index (int) –
str
GetMaxFiles
(self)¶Returns the maximum number of files that can be stored.
int
GetMenuPathStyle
(self)¶Get the current style of the menu item labels.
Initially returns FH_PATH_SHOW_IF_DIFFERENT
.
New in version 4.1/wxWidgets-3.1.5.
See also
GetMenus
(self)¶Returns the list of menus that are managed by this file history object.
FileHistoryMenuList
See also
Load
(self, config : ConfigBase)¶Loads the file history from the given config object.
This function should be called explicitly by the application.
config (wx.ConfigBase) –
None
See also
RemoveFileFromHistory
(self, i : int)¶Removes the specified file from the history.
i (int) –
None
RemoveMenu
(self, menu : Menu)¶Removes this menu from the list of those managed by this object.
menu (wx.Menu) –
None
Save
(self, config : ConfigBase)¶Saves the file history into the given config object.
This must be called explicitly by the application.
config (wx.ConfigBase) –
None
See also
SetBaseId
(self, baseId : int)¶Sets the base identifier for the range used for appending items.
baseId (wx.WindowID) –
None
SetMenuPathStyle
(self, style : FileHistoryMenuPathStyle)¶Set the style of the menu item labels.
By default, the menu item label style is FH_PATH_SHOW_IF_DIFFERENT
.
style (FileHistoryMenuPathStyle) –
None
New in version 4.1/wxWidgets-3.1.5.
UseMenu
(self, menu : Menu)¶Adds this menu to the list of those menus that are managed by this file history object.
Also see AddFilesToMenu
for initializing the menu with filenames that are already in the history when this function is called, as this is not done automatically.
menu (wx.Menu) –
None
MaxFiles
¶See GetMaxFiles
MenuPathStyle
¶See GetMenuPathStyle
and SetMenuPathStyle