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 FXTOOLTIP_H
00025 #define FXTOOLTIP_H
00026
00027 #ifndef FXSHELL_H
00028 #include "FXShell.h"
00029 #endif
00030
00031 namespace FX {
00032
00033
00034 class FXFont;
00035
00036
00038 enum {
00039 TOOLTIP_PERMANENT = 0x00020000,
00040 TOOLTIP_VARIABLE = 0x00040000,
00041 TOOLTIP_NORMAL = 0
00042 };
00043
00044
00046 class FXAPI FXToolTip : public FXShell {
00047 FXDECLARE(FXToolTip)
00048 protected:
00049 FXString label;
00050 FXFont *font;
00051 FXColor textColor;
00052 FXbool popped;
00053 protected:
00054 FXToolTip();
00055 virtual bool doesOverrideRedirect() const;
00056 void place(FXint x,FXint y);
00057 void autoplace();
00058 private:
00059 FXToolTip(const FXToolTip&);
00060 FXToolTip& operator=(const FXToolTip&);
00061 #ifdef WIN32
00062 virtual const char* GetClass() const;
00063 #endif
00064 public:
00065 long onPaint(FXObject*,FXSelector,void*);
00066 long onUpdate(FXObject*,FXSelector,void*);
00067 long onTipShow(FXObject*,FXSelector,void*);
00068 long onTipHide(FXObject*,FXSelector,void*);
00069 long onCmdGetStringValue(FXObject*,FXSelector,void*);
00070 long onCmdSetStringValue(FXObject*,FXSelector,void*);
00071 public:
00072 enum {
00073 ID_TIP_SHOW=FXShell::ID_LAST,
00074 ID_TIP_HIDE,
00075 ID_LAST
00076 };
00077 public:
00079 FXToolTip(FXApp* a,FXuint opts=TOOLTIP_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00080
00082 virtual void create();
00083
00085 virtual void detach();
00086
00088 virtual void show();
00089
00091 virtual FXint getDefaultWidth();
00092
00094 virtual FXint getDefaultHeight();
00095
00097 void setText(const FXString& text);
00098
00100 FXString getText() const { return label; }
00101
00103 void setFont(FXFont *fnt);
00104
00106 FXFont* getFont() const { return font; }
00107
00109 FXColor getTextColor() const { return textColor; }
00110
00112 void setTextColor(FXColor clr);
00113
00114 virtual bool doesSaveUnder() const;
00115
00117 virtual void save(FXStream& store) const;
00118
00120 virtual void load(FXStream& store);
00121
00123 virtual ~FXToolTip();
00124 };
00125
00126 }
00127
00128 #endif