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