Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXRecentFiles Class Reference

The Recent Files group manages a most recently used (MRU) file list by means of the standard system registry. More...

#include <FXRecentFiles.h>

Inheritance diagram for FX::FXRecentFiles:
FX::FXObject

Public Types

enum  {
  ID_CLEAR, ID_ANYFILES, ID_FILE_1, ID_FILE_2,
  ID_FILE_3, ID_FILE_4, ID_FILE_5, ID_FILE_6,
  ID_FILE_7, ID_FILE_8, ID_FILE_9, ID_FILE_10,
  ID_FILE_11, ID_FILE_12, ID_FILE_13, ID_FILE_14,
  ID_FILE_15, ID_FILE_16, ID_FILE_17, ID_FILE_18,
  ID_FILE_19, ID_FILE_20, ID_FILE_21, ID_FILE_22,
  ID_FILE_23, ID_FILE_24, ID_FILE_25, ID_FILE_26,
  ID_FILE_27, ID_FILE_28, ID_FILE_29, ID_FILE_30,
  ID_FILE_31, ID_FILE_32, ID_LAST
}
 

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.
 
FXSettingsgetSettings () 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.
 
FXObjectgetTarget () 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FXRecentFiles() [1/3]

FX::FXRecentFiles::FXRecentFiles ( )

Make new recent files group.

A Settings object and group name must be assigned prior to usage.

◆ FXRecentFiles() [2/3]

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.

◆ FXRecentFiles() [3/3]

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.


The documentation for this class was generated from the following file:

Copyright © 1997-2022 Jeroen van der Zijp