Ardour  9.0-pre0-582-g084a23a80d
menuitem.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GTKMM_MENUITEM_H
4 #define _GTKMM_MENUITEM_H
5 
6 #include <gtkmmconfig.h>
7 
8 
9 #include <glibmm/ustring.h>
10 #include <sigc++/sigc++.h>
11 
12 /*
13  * Copyright (C) 1998-2002 The gtkmm Development Team
14  *
15  * This library is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU Lesser General Public
17  * License as published by the Free Software Foundation; either
18  * version 2.1 of the License, or (at your option) any later version.
19  *
20  * This library is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23  * Lesser General Public License for more details.
24  *
25  * You should have received a copy of the GNU Lesser General Public
26  * License along with this library; if not, write to the Free
27  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28  */
29 
30 
31 #include <gtkmm/item.h>
32 #include <gtkmm/accelkey.h>
33 #include <gtkmm/accellabel.h>
34 
35 
36 #ifndef DOXYGEN_SHOULD_SKIP_THIS
37 typedef struct _GtkMenuItem GtkMenuItem;
38 typedef struct _GtkMenuItemClass GtkMenuItemClass;
39 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40 
41 
42 namespace Gtk
43 { class MenuItem_Class; } // namespace Gtk
44 namespace Gtk
45 {
46 
47 class Menu;
48 namespace Menu_Helpers { class Element; }
49 
50 // TODO: Inherit/Implement Activatable when we can break ABI.
51 
59 class MenuItem : public Item
60 {
61  public:
62 #ifndef DOXYGEN_SHOULD_SKIP_THIS
63  typedef MenuItem CppObjectType;
64  typedef MenuItem_Class CppClassType;
65  typedef GtkMenuItem BaseObjectType;
66  typedef GtkMenuItemClass BaseClassType;
67 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
68 
69  virtual ~MenuItem();
70 
71 #ifndef DOXYGEN_SHOULD_SKIP_THIS
72 
73 private:
74  friend class MenuItem_Class;
75  static CppClassType menuitem_class_;
76 
77  // noncopyable
78  MenuItem(const MenuItem&);
79  MenuItem& operator=(const MenuItem&);
80 
81 protected:
82  explicit MenuItem(const Glib::ConstructParams& construct_params);
83  explicit MenuItem(GtkMenuItem* castitem);
84 
85 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
86 
87 public:
88 #ifndef DOXYGEN_SHOULD_SKIP_THIS
89  static GType get_type() G_GNUC_CONST;
90 
91 
92  static GType get_base_type() G_GNUC_CONST;
93 #endif
94 
96  GtkMenuItem* gobj() { return reinterpret_cast<GtkMenuItem*>(gobject_); }
97 
99  const GtkMenuItem* gobj() const { return reinterpret_cast<GtkMenuItem*>(gobject_); }
100 
101 
102 public:
103  //C++ methods used to invoke GTK+ virtual functions:
104 
105 protected:
106  //GTK+ Virtual Functions (override these to change behaviour):
107 
108  //Default Signal Handlers::
110  virtual void on_activate();
112  virtual void on_activate_item();
114  virtual void on_toggle_size_request(int* requisition);
116  virtual void on_toggle_size_allocate(int allocation);
117 
118 
119 private:
120 
121 public:
124 
126  explicit MenuItem(Widget& widget);
127 
129  explicit MenuItem(const Glib::ustring& label, bool mnemonic = false);
130 
131 
137  void set_submenu(Menu& submenu);
138 
142 
143 
150 
156  const Menu* get_submenu() const;
157  bool has_submenu() const;
158 
159 
160 #ifndef GTKMM_DISABLE_DEPRECATED
161 
169 #endif // GTKMM_DISABLE_DEPRECATED
170 
171 
172  void select();
173 
174  void deselect();
175 
176  void activate();
177 
178  void toggle_size_request(int& requisition);
179 
180  void toggle_size_allocate(int allocation);
181 
191  void set_right_justified(bool right_justified = true);
192 
199  bool get_right_justified() const;
200 
219  void set_accel_path(const Glib::ustring& accel_path);
221 
229  Glib::ustring get_accel_path() const;
230 
235  void set_label(const Glib::ustring& label);
236 
242  Glib::ustring get_label() const;
243 
249  void set_use_underline(bool setting = true);
250 
257  bool get_use_underline() const;
258 
259 
266  Glib::SignalProxy0< void > signal_activate();
267 
268 
275  Glib::SignalProxy0< void > signal_activate_item();
276 
277 
284  Glib::SignalProxy1< void,int* > signal_toggle_size_request();
285 
286 
293  Glib::SignalProxy1< void,int > signal_toggle_size_allocate();
294 
295 
296  void accelerate(Window& window);
297 
303  Glib::PropertyProxy< bool > property_right_justified() ;
304 
310  Glib::PropertyProxy_ReadOnly< bool > property_right_justified() const;
311 
317  Glib::PropertyProxy< Gtk::Menu* > property_submenu() ;
318 
324  Glib::PropertyProxy_ReadOnly< Gtk::Menu* > property_submenu() const;
325 
331  Glib::PropertyProxy< Glib::ustring > property_accel_path() ;
332 
338  Glib::PropertyProxy_ReadOnly< Glib::ustring > property_accel_path() const;
339 
345  Glib::PropertyProxy< Glib::ustring > property_label() ;
346 
352  Glib::PropertyProxy_ReadOnly< Glib::ustring > property_label() const;
353 
359  Glib::PropertyProxy< bool > property_use_underline() ;
360 
366  Glib::PropertyProxy_ReadOnly< bool > property_use_underline() const;
367 
368 
369 protected:
370  void add_accel_label(const Glib::ustring& label, bool mnemonic = true);
371  void set_accel_key(const AccelKey& accel_key);
372 
373 private:
374  friend class Menu_Helpers::Element;
375 
376  //This data is set by MenuElem, and will be used in on_realize(), in the call to add_accelerator().
378 
379 
380 };
381 
382 } // namespace Gtk
383 
384 
385 namespace Glib
386 {
395  Gtk::MenuItem* wrap(GtkMenuItem* object, bool take_copy = false);
396 } //namespace Glib
397 
398 
399 #endif /* _GTKMM_MENUITEM_H */
400 
AccelKey accel_key_
Definition: menuitem.h:377
Gtk::MenuItem * wrap(GtkMenuItem *object, bool take_copy=false)
virtual ~MenuItem()
virtual void on_activate_item()
This is a default handler for the signal signal_activate_item().
void set_label(const Glib::ustring &label)
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_accel_path() const
void set_accel_key(const AccelKey &accel_key)
void remove_submenu()
Glib::PropertyProxy< Glib::ustring > property_label()
Glib::PropertyProxy_ReadOnly< bool > property_right_justified() const
Glib::ustring get_label() const
void unset_submenu()
Menu * get_submenu()
void add_accel_label(const Glib::ustring &label, bool mnemonic=true)
void set_right_justified(bool right_justified=true)
bool get_use_underline() const
void accelerate(Window &window)
Glib::SignalProxy1< void, int * > signal_toggle_size_request()
Glib::PropertyProxy_ReadOnly< Gtk::Menu * > property_submenu() const
Glib::PropertyProxy< Glib::ustring > property_accel_path()
bool get_right_justified() const
Glib::ustring get_accel_path() const
Glib::PropertyProxy< bool > property_use_underline()
void toggle_size_request(int &requisition)
virtual void on_toggle_size_request(int *requisition)
This is a default handler for the signal signal_toggle_size_request().
GtkMenuItem * gobj()
Provides access to the underlying C GtkObject.
Definition: menuitem.h:96
void set_accel_path(const Glib::ustring &accel_path)
const Menu * get_submenu() const
void set_use_underline(bool setting=true)
MenuItem()
Create an empty menu item.
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_label() const
void unset_accel_path()
Glib::SignalProxy0< void > signal_activate_item()
bool has_submenu() const
Glib::PropertyProxy< Gtk::Menu * > property_submenu()
void toggle_size_allocate(int allocation)
Glib::SignalProxy0< void > signal_activate()
const GtkMenuItem * gobj() const
Provides access to the underlying C GtkObject.
Definition: menuitem.h:99
virtual void on_activate()
This is a default handler for the signal signal_activate().
MenuItem(const Glib::ustring &label, bool mnemonic=false)
Create a menu item with label.
Glib::PropertyProxy< bool > property_right_justified()
MenuItem(Widget &widget)
Create a menu item with widget.
void set_submenu(Menu &submenu)
Glib::PropertyProxy_ReadOnly< bool > property_use_underline() const
Glib::SignalProxy1< void, int > signal_toggle_size_allocate()
virtual void on_toggle_size_allocate(int allocation)
This is a default handler for the signal signal_toggle_size_allocate().
Definition: ardour_ui.h:188