/usr/include/vdk2/vdk/menu.h is in libvdk2-dev 2.4.0-5.3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | /*
* ===========================
* VDK Visual Development Kit
* Version 0.4
* Revision 0.2
* October 1998
* ===========================
*
* Copyright (C) 1998, Mario Motta
* Developed by Mario Motta <mmotta@guest.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef MENU_H
#define MENU_H
#include <vdk/widcontain.h>
#include <vdk/dlist.h>
#include <vdk/vdktypes.h>
#include <vdk/rawpixmap.h>
#include <gdk/gdkkeysyms.h>
class VDKForms;
class VDKMenubar;
class VDKOptionMenu;
/*!
\class VDKMenu
\brief Provides a menu items container
\par PROGRAMMING TIPS
Making a menu bar should be easier than the "hard way" in GTK+.
Here an example:
\code
MyForm::Setup()
{
// makes a new menu bar
menubar = new VDKMenubar(this);
// makes a menu to be attached as first menu to menu bar
menu1 = new VDKMenuItem(menubar,"_File..",mini_ofolder_xpm);
// attach help menu to menu bar (rightmost)
menu2 = new VDKMenuItem(menubar,"_Help",book_xpm,r_justify);
// makes menu1 submenu
VDKMenu *menu = new VDKMenu(this);
menu11 = new VDKMenuItem(menu,"_Open");
menu12 = new VDKMenuItem(menu,"_Close");
menu->Separator();
menu13 = new VDKMenuItem(menu,"_Quit..");
// attach menu to menu1
menu1->Add(menu);
// add menubar and an empty labelto form
Add(menubar);
}
\endcode
*/
class VDKMenu: public VDKObjectContainer
{
protected:
GtkAccelGroup *accel_group;
public:
/*!
Constructor
\param owner
*/
VDKMenu(VDKForm* owner);
/*!
Destructor
*/
virtual ~VDKMenu();
/*!
Provides a menu separator
*/
void Separator();
virtual void SetFont(VDKFont* font);
/*!
Pops menu
*/
void Popup(guint button = 0, guint32 activate_time = 0);
void Add(VDKObject* wid, int justify = l_justify,
int expand = true, int fill = true , int padding = false);
/*!
Return accelerator group assigned to menu
*/
GtkAccelGroup *AccelGroup() { return accel_group; }
};
/*!
\class VDKMenuItem
\brief Provides a menu item
\par SIGNALS
\arg \b activate_signal Received whenever user selects an item
\par TIP
Menu item caption line is parsed and an acceleartor is installed if an
underscore is found. By default installs Alt + underscored key
\code
VDKMenuItem *item = new VDKMenuItem(menu,"_Accelerated");
// alt+a triggers activate_signal
\endcode
If accelerated menu item does not have submenus using accelerated key
makes activate_signal to be emitted, otherwise the submenu branch will
be displayed
\par EXAMPLES
In ./testvdk/testvdk.cc
*/
class VDKMenuItem: public VDKObject
{
protected:
VDKObjectSignal s_activated;
VDKMenu* menu;
GtkWidget *box,*lbl,*pixmapWidget, *tickWidget;
GdkPixmap* pixmap,*tickPixmap;
bool ticked;
guint accelerator_key;
guint8 modkey;
public:
/*!
Sets/gets menu item marked state
*/
__rwproperty(VDKMenuItem,bool) Checked;
/*!
Sets/gets menu item caption
*/
__rwproperty(VDKMenuItem,const char*) Caption;
/*!
Constructor, makes a menu item to be assigned to a menu
\param menu owner menu
\param prompt menu caption
\param pixmap pixmap data
\param key accelerator key
\param modkey accelerator key modifier
\param accel wheter should contain an accelerator or not
A pixmap will be packed at start if <pixmap> isn't NULL.
Leaving <key> to default value makes <label> to be parsed
for accelerators. For instance label == "_Quit" makes the
accelerator as alt+q. Setting <key> other then default overrides
label parsing, setting <modkey> to other than default overrides
<alt> modifier.
*/
VDKMenuItem(VDKMenu* menu ,
const char* prompt = NULL,
char** pixmap = NULL,
guint key = GDK_VoidSymbol,
guint8 modkey = GDK_MOD1_MASK,
bool accel = true);
/*!
Constructor, makes a menu item to be assigned to a menu bar
\param bar owner menu bar
\param prompt menu caption
\param pixmap pixmap data
\param align label alignement
\param key accelerator key
\param modkey accelerator key modifier
\param accel wheter should contain an accelerator or not
*/
VDKMenuItem(VDKMenubar* bar,
const char* prompt = NULL, char** pixmap = NULL,
int align = l_justify,
guint key = GDK_VoidSymbol,
guint8 modkey = GDK_MOD1_MASK,
bool accel = true);
/*!
\internal
*/
VDKMenuItem(VDKForm* owner,
const char* prompt = NULL, char** pixmap = NULL,
int align = l_justify,
guint key = GDK_VoidSymbol,
guint8 modkey = GDK_MOD1_MASK,
bool accel = true);
/*!
Destructor
*/
virtual ~VDKMenuItem();
void SetCaption(const char* str);
/*!
Returns accelerated key
*/
guint AccKey() { return accelerator_key; }
/*!
Returns accelerated key modifier
*/
guint8 ModKey() { return modkey; }
const char* GetCaption ();
/*!
Adds a submenus to this menu
\par TIP
Allows submenus to be attached in cascade
*/
void Add(VDKMenu* submenu);
void Tick(bool flag);
virtual void SetFont(VDKFont* font);
void SetPixmap(VDKRawPixmap* newpix);
};
/*!
\class VDKMenubar
\brief Provides a gtkmenubar wrapper
*/
class VDKMenubar: public VDKObjectContainer
{
protected:
GtkAccelGroup *accel_group;
void SetShadow(int shadow)
{
// gtk_menu_bar_set_shadow_type(GTK_MENU_BAR(widget),(GtkShadowType) shadow);
// gtk_object_set(GTK_OBJECT(widget), "shadow_type", shadow, NULL);
}
public:
/*!
Sets/gets menubar shadow type(default shadow_out)
*/
__rwproperty(VDKMenubar, int) Shadow;
/*!
Constructor
\param owner
*/
VDKMenubar(VDKForm* owner);
/*!
Destructor
*/
~VDKMenubar();
/*!
Sets menubar font
\par TIP
Applying a font to a menubar will spread the font to all
menus and submenus contained
*/
virtual void SetFont(VDKFont* font);
/*!
Add a menu item to menubar
\par TIP
<menu_item> must be a VDKMenuItem or derived class otherwise a
waring message will be generated and nothing will be added.
*/
void Add(VDKObject* menu_item, int justify = l_justify,
int expand = true, int fill = true , int padding = false);
/*!
Returns assigned accelerator group
*/
GtkAccelGroup *AccelGroup() { return accel_group; }
};
/*!
Provides a gtkoptionmenu wrapper
*/
class VDKOptionMenu: public VDKObject
{
public:
VDKOptionMenu(VDKForm* owner);
~VDKOptionMenu();
/*!
Adds a menu
*/
void Add(VDKMenu* menu);
virtual void SetFont(VDKFont* ) {}
};
#endif
|