Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
The Recent Files group manages a most recently used (MRU) file list by means of the standard system registry. More...
#include <FXRecentFiles.h>
Public Member Functions | |
long | onCmdClear (FXObject *, FXSelector, void *) |
long | onCmdFile (FXObject *, FXSelector, void *) |
long | onUpdFile (FXObject *, FXSelector, void *) |
long | onUpdAnyFiles (FXObject *, FXSelector, void *) |
FXRecentFiles () | |
Make new recent files group. More... | |
FXRecentFiles (FXApp *a, const FXString &gp="Recent Files", FXObject *tgt=nullptr, FXSelector sel=0) | |
Make new recent files group, using settings database from application. More... | |
FXRecentFiles (FXSettings *st, const FXString &gp="Recent Files", FXObject *tgt=nullptr, FXSelector sel=0) | |
Make new recent files group, using given settings database. More... | |
void | setSettings (FXSettings *s) |
Change settings database. | |
FXSettings * | getSettings () const |
Return settings database. | |
void | setMaxFiles (FXuint mx) |
Change number of files we're tracking. | |
FXuint | getMaxFiles () const |
Return the maximum number of files being tracked. | |
void | setGroupName (const FXString &name) |
Set group name. | |
FXString | getGroupName () const |
Return group name. | |
void | setTarget (FXObject *t) |
Change the target. | |
FXObject * | getTarget () const |
Get the target. | |
void | setSelector (FXSelector sel) |
Change the message. | |
FXSelector | getSelector () const |
Return the message id. | |
FXString | getFile (FXuint index) const |
Obtain the filename at index. | |
void | setFile (FXuint index, const FXString &filename) |
Change the filename at index. | |
void | appendFile (const FXString &filename) |
Append a file. | |
void | removeFile (const FXString &filename) |
Remove a file. | |
void | clear () |
Clear the list of files. | |
virtual void | save (FXStream &store) const |
Save to a stream. | |
virtual void | load (FXStream &store) |
Load from a stream. | |
virtual | ~FXRecentFiles () |
Destructor. | |
Public Member Functions inherited from FX::FXObject | |
const FXchar * | getClassName () const |
Get class name of some object. | |
FXbool | isMemberOf (const FXMetaClass *metaclass) const |
Check if object is member of metaclass. | |
virtual long | tryHandle (FXObject *sender, FXSelector sel, void *ptr) |
Try handle message safely, catching certain exceptions. | |
virtual long | onDefault (FXObject *, FXSelector, void *) |
Called for unhandled messages. | |
virtual | ~FXObject () |
Virtual destructor. | |
The Recent Files group manages a most recently used (MRU) file list by means of the standard system registry.
When connected to a widget, like a menu command, the recent files object updates the menu commands label to the associated recent file name; when the menu command is invoked, the recent file object sends its target a SEL_COMMAND message with the message data set to the associated file name, of the type const char*. When adding or removing file names, the recent files object automatically updates the system registry to record these changes. The ID_ANYFILES may be connected to a menu separator to cause automatic hiding of the menu separator when there are no recent files. The number of file names is typically no more than 10. File names should not be empty.
FX::FXRecentFiles::FXRecentFiles | ( | ) |
Make new recent files group.
A Settings object and group name must be assigned prior to usage.
FX::FXRecentFiles::FXRecentFiles | ( | FXApp * | a, |
const FXString & | gp = "Recent Files" , |
||
FXObject * | tgt = nullptr , |
||
FXSelector | sel = 0 |
||
) |
Make new recent files group, using settings database from application.
An optional target and message may be passed to invoke when one of the list of files is invoked.
FX::FXRecentFiles::FXRecentFiles | ( | FXSettings * | st, |
const FXString & | gp = "Recent Files" , |
||
FXObject * | tgt = nullptr , |
||
FXSelector | sel = 0 |
||
) |
Make new recent files group, using given settings database.
An optional target and message may be passed to invoke when one of the list of files is invoked.
Copyright © 1997-2022 Jeroen van der Zijp |