Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXMenuCaption.h
1 /********************************************************************************
2 * *
3 * M e n u C a p t i o n W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,2018 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXMENUCAPTION_H
22 #define FXMENUCAPTION_H
23 
24 #ifndef FXWINDOW_H
25 #include "FXWindow.h"
26 #endif
27 
28 namespace FX {
29 
30 
32 enum {
33  MENU_AUTOGRAY = 0x00008000,
34  MENU_AUTOHIDE = 0x00010000
35  };
36 
37 
38 class FXIcon;
39 class FXFont;
40 
41 
52 class FXAPI FXMenuCaption : public FXWindow {
53  FXDECLARE(FXMenuCaption)
54 protected:
55  FXString label; // Text on the label
56  FXIcon *icon; // Icon on the label
57  FXFont *font; // Label font
58  FXString help; // Help message
59  FXString tip; // Tooltip
60  FXColor textColor; // Text color
61  FXColor selbackColor; // Selection background color
62  FXColor seltextColor; // Selected text color
63  FXColor hiliteColor; // Highlight color
64  FXColor shadowColor; // Shadow color
65  FXHotKey hotkey; // Hotkey
66  FXint hotoff; // Offset in string
67 protected:
68  FXMenuCaption();
69 private:
71  FXMenuCaption &operator=(const FXMenuCaption&);
72 public:
73  long onPaint(FXObject*,FXSelector,void*);
74  long onUpdate(FXObject*,FXSelector,void*);
75  long onCmdSetValue(FXObject*,FXSelector,void*);
76  long onCmdGetStringValue(FXObject*,FXSelector,void*);
77  long onCmdSetStringValue(FXObject*,FXSelector,void*);
78  long onCmdSetIconValue(FXObject*,FXSelector,void*);
79  long onCmdGetIconValue(FXObject*,FXSelector,void*);
80  long onCmdSetHelp(FXObject*,FXSelector,void*);
81  long onCmdGetHelp(FXObject*,FXSelector,void*);
82  long onCmdSetTip(FXObject*,FXSelector,void*);
83  long onCmdGetTip(FXObject*,FXSelector,void*);
84  long onQueryHelp(FXObject*,FXSelector,void*);
85  long onQueryTip(FXObject*,FXSelector,void*);
86 public:
87 
89  FXMenuCaption(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXuint opts=0);
90 
92  virtual void create();
93 
95  virtual void detach();
96 
98  virtual void enable();
99 
101  virtual void disable();
102 
104  virtual FXint getDefaultWidth();
105 
107  virtual FXint getDefaultHeight();
108 
110  void setText(const FXString& text);
111 
113  FXString getText() const { return label; }
114 
116  void setIcon(FXIcon* ic);
117 
119  FXIcon* getIcon() const { return icon; }
120 
122  void setFont(FXFont* fnt);
123 
125  FXFont* getFont() const { return font; }
126 
128  void setMenuStyle(FXuint style);
129 
131  FXuint getMenuStyle() const;
132 
134  void setTextColor(FXColor clr);
135 
137  FXColor getTextColor() const { return textColor; }
138 
140  void setSelBackColor(FXColor clr);
141 
143  FXColor getSelBackColor() const { return selbackColor; }
144 
146  void setSelTextColor(FXColor clr);
147 
149  FXColor getSelTextColor() const { return seltextColor; }
150 
152  void setHiliteColor(FXColor clr);
153 
155  FXColor getHiliteColor() const { return hiliteColor; }
156 
158  void setShadowColor(FXColor clr);
159 
161  FXColor getShadowColor() const { return shadowColor; }
162 
164  void setHelpText(const FXString& text);
165 
167  const FXString& getHelpText() const { return help; }
168 
170  void setTipText(const FXString& text){ tip=text; }
171 
173  const FXString& getTipText() const { return tip; }
174 
176  virtual void save(FXStream& store) const;
177 
179  virtual void load(FXStream& store);
180 
182  virtual ~FXMenuCaption();
183  };
184 
185 }
186 
187 #endif
FXString getText() const
Get the text for this menu.
Definition: FXMenuCaption.h:113
Window is the base class for all widgets in FOX.
Definition: FXWindow.h:130
FXColor getShadowColor() const
Get shadow color.
Definition: FXMenuCaption.h:161
Base composite.
Definition: FXComposite.h:32
FXColor getHiliteColor() const
Get highlight color.
Definition: FXMenuCaption.h:155
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:78
const FXString & getTipText() const
Get the tool tip message for this menu.
Definition: FXMenuCaption.h:173
The menu caption is a widget which can be used as a caption above a number of menu commands in a menu...
Definition: FXMenuCaption.h:52
Definition: FX4Splitter.h:28
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:42
FXColor getSelTextColor() const
Return the selection text color.
Definition: FXMenuCaption.h:149
FXIcon * getIcon() const
Get the icon for this menu.
Definition: FXMenuCaption.h:119
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:104
FXColor getSelBackColor() const
Return the selection background color.
Definition: FXMenuCaption.h:143
FXColor getTextColor() const
Get the current text color.
Definition: FXMenuCaption.h:137
const FXString & getHelpText() const
Get the status line help text for this menu.
Definition: FXMenuCaption.h:167
FXFont * getFont() const
Return the text font.
Definition: FXMenuCaption.h:125
void setTipText(const FXString &text)
Set the tool tip message for this menu.
Definition: FXMenuCaption.h:170
Font class.
Definition: FXFont.h:137
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42

Copyright © 1997-2018 Jeroen van der Zijp