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 FX_DISABLEMENUS
00025
00026 #ifndef FXMENUCAPTION_H
00027 #define FXMENUCAPTION_H
00028
00029 #ifndef FXWINDOW_H
00030 #include "FXWindow.h"
00031 #endif
00032
00033 namespace FX {
00034
00035
00037 enum {
00038 MENU_AUTOGRAY = 0x00008000,
00039 MENU_AUTOHIDE = 0x00010000
00040 };
00041
00042
00043 class FXIcon;
00044 class FXFont;
00045
00046
00051 class FXAPI FXMenuCaption : public FXWindow {
00052 FXDECLARE(FXMenuCaption)
00053 protected:
00054 FXString label;
00055 FXString help;
00056 FXString tip;
00057 FXIcon *icon;
00058 FXFont *font;
00059 FXint hotoff;
00060 FXHotKey hotkey;
00061 FXColor textColor;
00062 FXColor selbackColor;
00063 FXColor seltextColor;
00064 FXColor hiliteColor;
00065 FXColor shadowColor;
00066 protected:
00067 FXMenuCaption();
00068 private:
00069 FXMenuCaption(const FXMenuCaption&);
00070 FXMenuCaption &operator=(const FXMenuCaption&);
00071 public:
00072 long onPaint(FXObject*,FXSelector,void*);
00073 long onUpdate(FXObject*,FXSelector,void*);
00074 long onCmdGetStringValue(FXObject*,FXSelector,void*);
00075 long onCmdSetStringValue(FXObject*,FXSelector,void*);
00076 long onCmdSetIconValue(FXObject*,FXSelector,void*);
00077 long onCmdGetIconValue(FXObject*,FXSelector,void*);
00078 long onCmdSetHelp(FXObject*,FXSelector,void*);
00079 long onCmdGetHelp(FXObject*,FXSelector,void*);
00080 long onCmdSetTip(FXObject*,FXSelector,void*);
00081 long onCmdGetTip(FXObject*,FXSelector,void*);
00082 long onQueryHelp(FXObject*,FXSelector,void*);
00083 long onQueryTip(FXObject*,FXSelector,void*);
00084 public:
00085
00087 FXMenuCaption(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXuint opts=0);
00088
00090 virtual void create();
00091
00093 virtual void detach();
00094
00096 virtual void enable();
00097
00099 virtual void disable();
00100
00102 virtual FXint getDefaultWidth();
00103
00105 virtual FXint getDefaultHeight();
00106
00108 void setText(const FXString& text);
00109
00111 FXString getText() const { return label; }
00112
00114 void setIcon(FXIcon* ic);
00115
00117 FXIcon* getIcon() const { return icon; }
00118
00120 void setFont(FXFont* fnt);
00121
00123 FXFont* getFont() const { return font; }
00124
00126 void setMenuStyle(FXuint style);
00127
00129 FXuint getMenuStyle() const;
00130
00132 void setTextColor(FXColor clr);
00133
00135 FXColor getTextColor() const { return textColor; }
00136
00138 void setSelBackColor(FXColor clr);
00139
00141 FXColor getSelBackColor() const { return selbackColor; }
00142
00144 void setSelTextColor(FXColor clr);
00145
00147 FXColor getSelTextColor() const { return seltextColor; }
00148
00150 void setHiliteColor(FXColor clr);
00151
00153 FXColor getHiliteColor() const { return hiliteColor; }
00154
00156 void setShadowColor(FXColor clr);
00157
00159 FXColor getShadowColor() const { return shadowColor; }
00160
00162 void setHelpText(const FXString& text);
00163
00165 const FXString& getHelpText() const { return help; }
00166
00168 void setTipText(const FXString& text){ tip=text; }
00169
00171 const FXString& getTipText() const { return tip; }
00172
00174 virtual void save(FXStream& store) const;
00175
00177 virtual void load(FXStream& store);
00178
00180 virtual ~FXMenuCaption();
00181 };
00182
00183 }
00184
00185 #endif
00186 #endif