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 FXIcon *icon;
00055 FXFont *font;
00056 FXint hotoff;
00057 FXHotKey hotkey;
00058 FXColor textColor;
00059 FXColor selbackColor;
00060 FXColor seltextColor;
00061 FXColor hiliteColor;
00062 FXColor shadowColor;
00063 protected:
00064 FXMenuCaption();
00065 private:
00066 FXMenuCaption(const FXMenuCaption&);
00067 FXMenuCaption &operator=(const FXMenuCaption&);
00068 public:
00069 long onPaint(FXObject*,FXSelector,void*);
00070 long onUpdate(FXObject*,FXSelector,void*);
00071 long onCmdGetStringValue(FXObject*,FXSelector,void*);
00072 long onCmdSetStringValue(FXObject*,FXSelector,void*);
00073 long onCmdSetIconValue(FXObject*,FXSelector,void*);
00074 long onCmdGetIconValue(FXObject*,FXSelector,void*);
00075 long onCmdSetHelp(FXObject*,FXSelector,void*);
00076 long onCmdGetHelp(FXObject*,FXSelector,void*);
00077 long onQueryHelp(FXObject*,FXSelector,void*);
00078 public:
00079
00080
00081 FXMenuCaption(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXuint opts=0);
00082
00083
00084 virtual void create();
00085
00086
00087 virtual void detach();
00088
00089
00090 virtual void enable();
00091
00092
00093 virtual void disable();
00094
00095
00096 virtual FXint getDefaultWidth();
00097
00098
00099 virtual FXint getDefaultHeight();
00100
00101
00102 void setText(const FXString& text);
00103
00104
00105 FXString getText() const { return label; }
00106
00107
00108 void setIcon(FXIcon* ic);
00109
00110
00111 FXIcon* getIcon() const { return icon; }
00112
00113
00114 void setFont(FXFont* fnt);
00115
00116
00117 FXFont* getFont() const { return font; }
00118
00119
00120 void setMenuStyle(FXuint style);
00121
00122
00123 FXuint getMenuStyle() const;
00124
00125
00126 FXColor getTextColor() const { return textColor; }
00127
00128
00129 void setTextColor(FXColor clr);
00130
00131
00132 FXColor getSelBackColor() const { return selbackColor; }
00133
00134
00135 void setSelBackColor(FXColor clr);
00136
00137
00138 FXColor getSelTextColor() const { return seltextColor; }
00139
00140
00141 void setSelTextColor(FXColor clr);
00142
00143
00144 void setHiliteColor(FXColor clr);
00145
00146
00147 FXColor getHiliteColor() const { return hiliteColor; }
00148
00149
00150 void setShadowColor(FXColor clr);
00151
00152
00153 FXColor getShadowColor() const { return shadowColor; }
00154
00155
00156 void setHelpText(const FXString& text);
00157
00158
00159 FXString getHelpText() const { return help; }
00160
00161
00162 virtual void save(FXStream& store) const;
00163
00164
00165 virtual void load(FXStream& store);
00166
00167
00168 virtual ~FXMenuCaption();
00169 };
00170
00171 }
00172
00173 #endif