add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / optionmenu.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_OPTIONMENU_H
4 #define _GTKMM_OPTIONMENU_H
5
6 #include <gtkmmconfig.h>
7
8 #ifndef GTKMM_DISABLE_DEPRECATED
9
10
11 #include <glibmm.h>
12
13 /* $Id$ */
14
15 /* optionmenu.h
16  * 
17  * Copyright (C) 1998-2002 The gtkmm Development Team
18  *
19  * This library is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU Library General Public
21  * License as published by the Free Software Foundation; either
22  * version 2 of the License, or (at your option) any later version.
23  *
24  * This library is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27  * Library General Public License for more details.
28  *
29  * You should have received a copy of the GNU Library General Public
30  * License along with this library; if not, write to the Free
31  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
32  */
33
34 // This is for including the config header before any code (such as
35 // the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
36
37
38 #include <gtkmm/button.h>
39
40
41 #ifndef DOXYGEN_SHOULD_SKIP_THIS
42 typedef struct _GtkOptionMenu GtkOptionMenu;
43 typedef struct _GtkOptionMenuClass GtkOptionMenuClass;
44 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
45
46
47 namespace Gtk
48 { class OptionMenu_Class; } // namespace Gtk
49 namespace Gtk
50 {
51
52 class Menu;
53
54 /** A widget used to choose from a list of valid choices.
55  *
56  * A Gtk::OptionMenu is a widget that allows the user to choose from a list
57  * of valid choices. The Gtk::OptionMenu displays the selected choice. When
58  * activated the GtkOptionMenu displays a popup Gtk::Menu which allows the
59  * user to make a new choice. 
60  *
61  * @deprecated Use the ComboBox widget instead.
62  */
63
64 class OptionMenu : public Button
65 {
66   public:
67 #ifndef DOXYGEN_SHOULD_SKIP_THIS
68   typedef OptionMenu CppObjectType;
69   typedef OptionMenu_Class CppClassType;
70   typedef GtkOptionMenu BaseObjectType;
71   typedef GtkOptionMenuClass BaseClassType;
72 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
73
74   virtual ~OptionMenu();
75
76 #ifndef DOXYGEN_SHOULD_SKIP_THIS
77
78 private:
79   friend class OptionMenu_Class;
80   static CppClassType optionmenu_class_;
81
82   // noncopyable
83   OptionMenu(const OptionMenu&);
84   OptionMenu& operator=(const OptionMenu&);
85
86 protected:
87   explicit OptionMenu(const Glib::ConstructParams& construct_params);
88   explicit OptionMenu(GtkOptionMenu* castitem);
89
90 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
91
92 public:
93 #ifndef DOXYGEN_SHOULD_SKIP_THIS
94   static GType get_type()      G_GNUC_CONST;
95   static GType get_base_type() G_GNUC_CONST;
96 #endif
97
98   ///Provides access to the underlying C GtkObject.
99   GtkOptionMenu*       gobj()       { return reinterpret_cast<GtkOptionMenu*>(gobject_); }
100
101   ///Provides access to the underlying C GtkObject.
102   const GtkOptionMenu* gobj() const { return reinterpret_cast<GtkOptionMenu*>(gobject_); }
103
104
105 public:
106   //C++ methods used to invoke GTK+ virtual functions:
107 #ifdef GLIBMM_VFUNCS_ENABLED
108 #endif //GLIBMM_VFUNCS_ENABLED
109
110 protected:
111   //GTK+ Virtual Functions (override these to change behaviour):
112 #ifdef GLIBMM_VFUNCS_ENABLED
113 #endif //GLIBMM_VFUNCS_ENABLED
114
115   //Default Signal Handlers::
116 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
117   virtual void on_changed();
118 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
119
120
121 private:
122
123   
124 public:
125
126   OptionMenu();
127   
128   
129   void set_menu(Menu& menu);
130   
131   Menu* get_menu();
132   
133   const Menu* get_menu() const;
134   
135   void remove_menu();
136   
137   /** Retrieves the index of the currently selected menu item. The menu
138    * items are numbered from top to bottom, starting with 0.
139    * @return Index of the selected menu item, or -1 if there are no menu items
140    * Deprecated: 2.4: Use Gtk::ComboBox instead.
141    */
142   int get_history() const;
143   
144   void set_history(guint index);
145
146   
147   /**
148    * @par Prototype:
149    * <tt>void on_my_%changed()</tt>
150    */
151
152   Glib::SignalProxy0< void > signal_changed();
153         
154
155 private:
156   void init_accels_handler_();
157
158
159 };
160
161 } /* namespace Gtk */
162
163
164 namespace Glib
165 {
166   /** A Glib::wrap() method for this object.
167    * 
168    * @param object The C instance.
169    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
170    * @result A C++ instance that wraps this C instance.
171    *
172    * @relates Gtk::OptionMenu
173    */
174   Gtk::OptionMenu* wrap(GtkOptionMenu* object, bool take_copy = false);
175 } //namespace Glib
176
177
178 #endif // GTKMM_DISABLE_DEPRECATED
179
180
181 #endif /* _GTKMM_OPTIONMENU_H */
182