00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FXACCELTABLE_H
00022 #define FXACCELTABLE_H
00023
00024 #ifndef FXOBJECT_H
00025 #include "FXObject.h"
00026 #endif
00027
00028 namespace FX {
00029
00030
00036 class FXAPI FXAccelTable : public FXObject {
00037 FXDECLARE(FXAccelTable)
00038 protected:
00039 struct FXAccelKey {
00040 FXObject *target;
00041 FXSelector messagedn;
00042 FXSelector messageup;
00043 FXHotKey code;
00044 };
00045 private:
00046 FXAccelKey *key;
00047 FXuint max;
00048 FXuint num;
00049 private:
00050 void resize(FXuint m);
00051 private:
00052 FXAccelTable(const FXAccelTable&);
00053 FXAccelTable &operator=(const FXAccelTable&);
00054 public:
00055 long onKeyPress(FXObject*,FXSelector,void*);
00056 long onKeyRelease(FXObject*,FXSelector,void*);
00057 public:
00058
00060 FXAccelTable();
00061
00063 void addAccel(FXHotKey hotkey,FXObject* target=NULL,FXSelector seldn=0,FXSelector selup=0);
00064
00066 void removeAccel(FXHotKey hotkey);
00067
00069 FXbool hasAccel(FXHotKey hotkey) const;
00070
00072 FXObject* targetOfAccel(FXHotKey hotkey) const;
00073
00075 virtual void save(FXStream& store) const;
00076
00078 virtual void load(FXStream& store);
00079
00081 virtual ~FXAccelTable();
00082 };
00083
00084
00090 extern FXAPI FXHotKey parseAccel(const FXString& string);
00091
00096 extern FXAPI FXString unparseAccel(FXHotKey key);
00097
00103 extern FXAPI FXHotKey parseHotKey(const FXString& string);
00104
00111 extern FXAPI FXint findHotKey(const FXString& string);
00112
00118 extern FXAPI FXString stripHotKey(const FXString& string);
00119
00120 }
00121
00122 #endif