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>
35class VDKForms;
36class VDKMenubar;
37class 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
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;
126public:
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);
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 }
222public:
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{
262public:
263 VDKOptionMenu(VDKForm* owner);
268 void Add(VDKMenu* menu);
269 virtual void SetFont(VDKFont* ) {}
270};
271
272
273#endif
274
Provides a raw font.
Definition: vdkfont.h:38
VDKForm widgets, generally the outermost widget container.
Definition: forms.h:69
Provides a menu item.
Definition: menu.h:117
virtual void SetFont(VDKFont *font)
Definition: menu.cc:511
__rwproperty(VDKMenuItem, bool) Checked
__rwproperty(VDKMenuItem, const char *) Caption
guint AccKey()
Definition: menu.h:191
virtual ~VDKMenuItem()
Definition: menu.cc:520
guint8 ModKey()
Definition: menu.h:195
void Add(VDKMenu *submenu)
Definition: menu.cc:530
VDKMenuItem(VDKMenu *menu, const char *prompt=NULL, char **pixmap=NULL, guint key=GDK_VoidSymbol, guint8 modkey=GDK_MOD1_MASK, bool accel=true)
Definition: menu.cc:181
Provides a menu items container.
Definition: menu.h:68
void Separator()
Definition: menu.cc:150
void Popup(guint button=0, guint32 activate_time=0)
Definition: menu.cc:167
VDKMenu(VDKForm *owner)
Definition: menu.cc:88
void Add(VDKObject *wid, int justify=l_justify, int expand=true, int fill=true, int padding=false)
Definition: menu.cc:110
GtkAccelGroup * AccelGroup()
Definition: menu.h:95
virtual void SetFont(VDKFont *font)
Definition: menu.cc:158
virtual ~VDKMenu()
Definition: menu.cc:103
Provides a gtkmenubar wrapper.
Definition: menu.h:214
VDKMenubar(VDKForm *owner)
Definition: menu.cc:538
void Add(VDKObject *menu_item, int justify=l_justify, int expand=true, int fill=true, int padding=false)
Definition: menu.cc:557
GtkAccelGroup * AccelGroup()
Definition: menu.h:254
__rwproperty(VDKMenubar, int) Shadow
~VDKMenubar()
Definition: menu.cc:550
virtual void SetFont(VDKFont *font)
Definition: menu.cc:593
Containers base class.
Definition: widcontain.h:40
Definition: vdkobj.h:141
Definition: menu.h:261
virtual void SetFont(VDKFont *)
Definition: menu.h:269
void Add(VDKMenu *menu)
Definition: menu.cc:615
Provides a raw pixmap.
Definition: rawpixmap.h:38
Definition: vdkobj.h:62