00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FXRECENTFILES_H
00025 #define FXRECENTFILES_H
00026
00027 #ifndef FXOBJECT_H
00028 #include "FXObject.h"
00029 #endif
00030
00031 namespace FX {
00032
00033
00034 class FXApp;
00035
00036
00048 class FXAPI FXRecentFiles : public FXObject {
00049 FXDECLARE(FXRecentFiles)
00050 private:
00051 FXApp *app;
00052 FXObject *target;
00053 FXSelector message;
00054 FXString group;
00055 FXint maxfiles;
00056 private:
00057 FXRecentFiles(const FXRecentFiles&);
00058 FXRecentFiles &operator=(const FXRecentFiles&);
00059 public:
00060 long onCmdClear(FXObject*,FXSelector,void*);
00061 long onCmdFile(FXObject*,FXSelector,void*);
00062 long onUpdFile(FXObject*,FXSelector,void*);
00063 long onUpdAnyFiles(FXObject*,FXSelector,void*);
00064 public:
00065 enum{
00066 ID_CLEAR,
00067 ID_ANYFILES,
00068 ID_FILE_1,
00069 ID_FILE_2,
00070 ID_FILE_3,
00071 ID_FILE_4,
00072 ID_FILE_5,
00073 ID_FILE_6,
00074 ID_FILE_7,
00075 ID_FILE_8,
00076 ID_FILE_9,
00077 ID_FILE_10,
00078 ID_LAST
00079 };
00080 public:
00081
00083 FXRecentFiles();
00084
00086 FXRecentFiles(FXApp* a);
00087
00089 FXRecentFiles(FXApp* a,const FXString& gp,FXObject *tgt=NULL,FXSelector sel=0);
00090
00092 FXApp* getApp() const { return app; }
00093
00095 void setMaxFiles(FXint mx){ maxfiles=mx; }
00096
00098 FXint getMaxFiles() const { return maxfiles; }
00099
00101 void setGroupName(const FXString& name){ group=name; }
00102
00104 FXString getGroupName() const { return group; }
00105
00107 void setTarget(FXObject *t){ target=t; }
00108
00110 FXObject *getTarget() const { return target; }
00111
00113 void setSelector(FXSelector sel){ message=sel; }
00114
00116 FXSelector getSelector() const { return message; }
00117
00119 FXString getFile(FXint index) const;
00120
00122 void setFile(FXint index,const FXString& filename);
00123
00125 void appendFile(const FXString& filename);
00126
00128 void removeFile(const FXString& filename);
00129
00131 void clear();
00132
00134 virtual void save(FXStream& store) const;
00135
00137 virtual void load(FXStream& store);
00138
00140 virtual ~FXRecentFiles();
00141 };
00142
00143 }
00144
00145 #endif