vdk 2.4.0
menu.h
1 /*
2  * ===========================
3  * VDK Visual Development Kit
4  * Version 0.4
5  * Revision 0.2
6  * October 1998
7  * ===========================
8  *
9  * Copyright (C) 1998, Mario Motta
10  * Developed by Mario Motta <mmotta@guest.net>
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Library General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Library General Public License for more details.
21  *
22  * You should have received a copy of the GNU Library General Public
23  * License along with this library; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25  * 02111-1307, USA.
26  */
27 
28 #ifndef MENU_H
29 #define MENU_H
30 #include <vdk/widcontain.h>
31 #include <vdk/dlist.h>
32 #include <vdk/vdktypes.h>
33 #include <vdk/rawpixmap.h>
34 #include <gdk/gdkkeysyms.h>
35 class VDKForms;
36 class VDKMenubar;
37 class VDKOptionMenu;
38 
68 {
69  protected:
70  GtkAccelGroup *accel_group;
71  public:
76  VDKMenu(VDKForm* owner);
80  virtual ~VDKMenu();
84  void Separator();
85  virtual void SetFont(VDKFont* font);
89  void Popup(guint button = 0, guint32 activate_time = 0);
90  void Add(VDKObject* wid, int justify = l_justify,
91  int expand = true, int fill = true , int padding = false);
95  GtkAccelGroup *AccelGroup() { return accel_group; }
96 };
97 
116 class VDKMenuItem: public VDKObject
117 {
118  protected:
119  VDKObjectSignal s_activated;
120  VDKMenu* menu;
121  GtkWidget *box,*lbl,*pixmapWidget, *tickWidget;
122  GdkPixmap* pixmap,*tickPixmap;
123  bool ticked;
124  guint accelerator_key;
125  guint8 modkey;
126 public:
130  __rwproperty(VDKMenuItem,bool) Checked;
134  __rwproperty(VDKMenuItem,const char*) Caption;
151  VDKMenuItem(VDKMenu* menu ,
152  const char* prompt = NULL,
153  char** pixmap = NULL,
154  guint key = GDK_VoidSymbol,
155  guint8 modkey = GDK_MOD1_MASK,
156  bool accel = true);
167  VDKMenuItem(VDKMenubar* bar,
168  const char* prompt = NULL, char** pixmap = NULL,
169  int align = l_justify,
170  guint key = GDK_VoidSymbol,
171  guint8 modkey = GDK_MOD1_MASK,
172  bool accel = true);
176  VDKMenuItem(VDKForm* owner,
177  const char* prompt = NULL, char** pixmap = NULL,
178  int align = l_justify,
179  guint key = GDK_VoidSymbol,
180  guint8 modkey = GDK_MOD1_MASK,
181  bool accel = true);
185  virtual ~VDKMenuItem();
186 
187  void SetCaption(const char* str);
191  guint AccKey() { return accelerator_key; }
195  guint8 ModKey() { return modkey; }
196 
197  const char* GetCaption ();
203  void Add(VDKMenu* submenu);
204  void Tick(bool flag);
205  virtual void SetFont(VDKFont* font);
206  void SetPixmap(VDKRawPixmap* newpix);
207 };
208 
214 {
215  protected:
216  GtkAccelGroup *accel_group;
217  void SetShadow(int shadow)
218  {
219  // gtk_menu_bar_set_shadow_type(GTK_MENU_BAR(widget),(GtkShadowType) shadow);
220  // gtk_object_set(GTK_OBJECT(widget), "shadow_type", shadow, NULL);
221  }
222 public:
226  __rwproperty(VDKMenubar, int) Shadow;
231  VDKMenubar(VDKForm* owner);
235  ~VDKMenubar();
242  virtual void SetFont(VDKFont* font);
249  void Add(VDKObject* menu_item, int justify = l_justify,
250  int expand = true, int fill = true , int padding = false);
254  GtkAccelGroup *AccelGroup() { return accel_group; }
255 };
256 
261 {
262 public:
263  VDKOptionMenu(VDKForm* owner);
264  ~VDKOptionMenu();
268  void Add(VDKMenu* menu);
269  virtual void SetFont(VDKFont* ) {}
270 };
271 
272 
273 #endif
274 
void Separator()
Definition: menu.cc:150
Definition: vdkobj.h:137
Containers base class.
Definition: widcontain.h:39
guint8 ModKey()
Definition: menu.h:195
virtual void SetFont(VDKFont *font)
Definition: menu.cc:158
VDKMenu(VDKForm *owner)
Definition: menu.cc:88
guint AccKey()
Definition: menu.h:191
VDKForm widgets, generally the outermost widget container.
Definition: forms.h:68
Provides a gtkmenubar wrapper.
Definition: menu.h:213
virtual void SetFont(VDKFont *)
Definition: menu.h:269
void Popup(guint button=0, guint32 activate_time=0)
Definition: menu.cc:167
GtkAccelGroup * AccelGroup()
Definition: menu.h:254
Provides a menu item.
Definition: menu.h:116
Definition: vdkobj.h:62
Definition: menu.h:260
Provides a raw font.
Definition: vdkfont.h:37
Provides a raw pixmap.
Definition: rawpixmap.h:37
void Add(VDKObject *wid, int justify=l_justify, int expand=true, int fill=true, int padding=false)
Definition: menu.cc:110
virtual ~VDKMenu()
Definition: menu.cc:103
Provides a menu items container.
Definition: menu.h:67
GtkAccelGroup * AccelGroup()
Definition: menu.h:95