00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef FX_TRAY_ICON_H
00032 #define FX_TRAY_ICON_H
00033
00034 #include "fx.h"
00035
00036 namespace FX {
00037
00044 enum {
00045 TRAY_MENU_ON_LEFT = 0x0001,
00046 TRAY_MENU_ON_RIGHT = 0x0002,
00047 TRAY_CMD_ON_LEFT = 0x0004,
00048 TRAY_CMD_ON_RIGHT = 0x0008
00049 };
00056 class FXTrayIcon : public FXTopWindow
00057 {
00058 FXDECLARE(FXTrayIcon)
00059 public:
00061 enum {
00062 ID_BUTTON = FXTopWindow::ID_LAST,
00063 ID_LAST
00064 };
00076 FXTrayIcon(FXApp* app, const FXString& text, FXIcon* icon,
00077 FXPopup* pup = NULL, FXObject* target = 0, FXSelector sel = 0,
00078 FXuint opts = TRAY_MENU_ON_LEFT);
00079
00080 ~FXTrayIcon();
00081
00083 void create();
00084
00086 void mapToManager();
00087
00088 long onLeft(FXObject*, FXSelector, void*);
00089 long onRight(FXObject* obj, FXSelector, void* ptr);
00090 long onClose(FXObject*, FXSelector, void*);
00094 void setMenu(FXPopup* pup) { mPup = pup; }
00096 FXPopup* getMenu() const { return mPup; }
00097
00099 void setIcon(FXIcon* icon);
00101 FXIcon* getIcon() const;
00102
00104 void setText(const FXString& text);
00106 const FXString& getText() const;
00107
00108 private:
00109 FXPopup* mPup;
00110 FXuint mOpts;
00111 FXButton* btn;
00112
00113 void popup(FXint x, FXint y);
00114 FXTrayIcon() {}
00115 };
00116
00121 }
00122
00123 #endif
00124