00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FXTOOLTIP_H
00022 #define FXTOOLTIP_H
00023
00024 #ifndef FXSHELL_H
00025 #include "FXShell.h"
00026 #endif
00027
00028 namespace FX {
00029
00030
00031 class FXFont;
00032
00033
00035 enum {
00036 TOOLTIP_PERMANENT = 0x00020000,
00037 TOOLTIP_VARIABLE = 0x00040000,
00038 TOOLTIP_NORMAL = 0
00039 };
00040
00041
00043 class FXAPI FXToolTip : public FXShell {
00044 FXDECLARE(FXToolTip)
00045 protected:
00046 FXString label;
00047 FXFont *font;
00048 FXColor textColor;
00049 FXbool popped;
00050 protected:
00051 FXToolTip();
00052 virtual FXbool doesOverrideRedirect() const;
00053 void place(FXint x,FXint y);
00054 void autoplace();
00055 private:
00056 FXToolTip(const FXToolTip&);
00057 FXToolTip& operator=(const FXToolTip&);
00058 #ifdef WIN32
00059 virtual const void* GetClass() const;
00060 #endif
00061 public:
00062 long onPaint(FXObject*,FXSelector,void*);
00063 long onUpdate(FXObject*,FXSelector,void*);
00064 long onTipShow(FXObject*,FXSelector,void*);
00065 long onTipHide(FXObject*,FXSelector,void*);
00066 long onCmdGetStringValue(FXObject*,FXSelector,void*);
00067 long onCmdSetStringValue(FXObject*,FXSelector,void*);
00068 public:
00069 enum {
00070 ID_TIP_SHOW=FXShell::ID_LAST,
00071 ID_TIP_HIDE,
00072 ID_LAST
00073 };
00074 public:
00076 FXToolTip(FXApp* a,FXuint opts=TOOLTIP_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00077
00079 virtual void create();
00080
00082 virtual void detach();
00083
00085 virtual void show();
00086
00088 virtual FXint getDefaultWidth();
00089
00091 virtual FXint getDefaultHeight();
00092
00094 void setText(const FXString& text);
00095
00097 FXString getText() const { return label; }
00098
00100 void setFont(FXFont *fnt);
00101
00103 FXFont* getFont() const { return font; }
00104
00106 FXColor getTextColor() const { return textColor; }
00107
00109 void setTextColor(FXColor clr);
00110
00111 virtual FXbool doesSaveUnder() const;
00112
00114 virtual void save(FXStream& store) const;
00115
00117 virtual void load(FXStream& store);
00118
00120 virtual ~FXToolTip();
00121 };
00122
00123 }
00124
00125 #endif