2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TOOLBUTTON_H
4 #define _GTKMM_TOOLBUTTON_H
12 * Copyright (C) 2003 The gtkmm Development Team
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <gtkmm/toolitem.h>
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GtkToolButton GtkToolButton;
34 typedef struct _GtkToolButtonClass GtkToolButtonClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
39 { class ToolButton_Class; } // namespace Gtk
43 /** A Gtk::ToolItem subclass that displays buttons.
45 * A ToolButton is are Gtk::ToolItem containing a button.
49 class ToolButton : public ToolItem
52 #ifndef DOXYGEN_SHOULD_SKIP_THIS
53 typedef ToolButton CppObjectType;
54 typedef ToolButton_Class CppClassType;
55 typedef GtkToolButton BaseObjectType;
56 typedef GtkToolButtonClass BaseClassType;
57 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
59 virtual ~ToolButton();
61 #ifndef DOXYGEN_SHOULD_SKIP_THIS
64 friend class ToolButton_Class;
65 static CppClassType toolbutton_class_;
68 ToolButton(const ToolButton&);
69 ToolButton& operator=(const ToolButton&);
72 explicit ToolButton(const Glib::ConstructParams& construct_params);
73 explicit ToolButton(GtkToolButton* castitem);
75 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
78 #ifndef DOXYGEN_SHOULD_SKIP_THIS
79 static GType get_type() G_GNUC_CONST;
80 static GType get_base_type() G_GNUC_CONST;
83 ///Provides access to the underlying C GtkObject.
84 GtkToolButton* gobj() { return reinterpret_cast<GtkToolButton*>(gobject_); }
86 ///Provides access to the underlying C GtkObject.
87 const GtkToolButton* gobj() const { return reinterpret_cast<GtkToolButton*>(gobject_); }
91 //C++ methods used to invoke GTK+ virtual functions:
94 //GTK+ Virtual Functions (override these to change behaviour):
96 //Default Signal Handlers::
97 virtual void on_clicked();
104 /** Creates a new ToolButton.
108 /** Creates a new ToolButton from a StockID.
110 * The ToolButton will be created according to the @a stock_id properties.
112 * @param stock_id The StockID which determines the look of the ToolButton.
114 explicit ToolButton(const Gtk::StockID& stock_id);
116 /** Creates a new ToolButton with a label.
118 * The ToolButton will have the label @a label.
120 * @param label The string used to display the label for this ToolButton.
122 explicit ToolButton(const Glib::ustring& label);
124 /** Creates a new ToolButton with an image.
126 * The ToolButton will have the label @a label and an image widget @a icon_widget.
128 * @param icon_widget The widget placed as the ToolButton's icon.
129 * @param label The string used to display the label for this ToolButton.
131 explicit ToolButton(Widget& icon_widget, const Glib::ustring& label = Glib::ustring());
134 /** Sets @a label as the label used for the tool button. The "label" property
135 * only has an effect if not overridden by a non-<tt>0</tt> "label_widget" property.
136 * If both the "label_widget" and "label" properties are <tt>0</tt>, the label
137 * is determined by the "stock_id" property. If the "stock_id" property is also
138 * <tt>0</tt>, @a button will not have a label.
141 * @param label A string that will be used as label, or <tt>0</tt>.
143 void set_label(const Glib::ustring& label);
145 /** Returns the label used by the tool button, or <tt>0</tt> if the tool button
146 * doesn't have a label. or uses a the label from a stock item. The returned
147 * string is owned by GTK+, and must not be modified or freed.
148 * @return The label, or <tt>0</tt>
152 Glib::ustring get_label() const;
154 /** If set, an underline in the label property indicates that the next character
155 * should be used for the mnemonic accelerator key in the overflow menu. For
156 * example, if the label property is "_Open" and @a use_underline is <tt>true</tt>,
157 * the label on the tool button will be "Open" and the item on the overflow
158 * menu will have an underlined 'O'.
160 * Labels shown on tool buttons never have mnemonics on them; this property
161 * only affects the menu item on the overflow menu.
164 * @param use_underline Whether the button label has the form "_Open".
166 void set_use_underline(bool use_underline = true);
168 /** Returns whether underscores in the label property are used as mnemonics
169 * on menu items on the overflow menu. See set_use_underline().
170 * @return <tt>true</tt> if underscores in the label property are used as
171 * mnemonics on menu items on the overflow menu.
175 bool get_use_underline() const;
177 /** Sets the name of the stock item. See new_from_stock().
178 * The stock_id property only has an effect if not
179 * overridden by non-<tt>0</tt> "label" and "icon_widget" properties.
182 * @param stock_id A name of a stock item, or <tt>0</tt>.
184 void set_stock_id(const Gtk::StockID& stock_id);
186 /** Returns the name of the stock item. See set_stock_id().
187 * The returned string is owned by GTK+ and must not be freed or modifed.
188 * @return The name of the stock item for @a button .
192 Glib::ustring get_stock_id() const;
194 /** Sets @a icon as the widget used as icon on @a button . If @a icon_widget is
195 * <tt>0</tt> the icon is determined by the "stock_id" property. If the
196 * "stock_id" property is also <tt>0</tt>, @a button will not have an icon.
199 * @param icon_widget The widget used as icon, or <tt>0</tt>.
201 void set_icon_widget(Widget& icon_widget);
203 /** Return the widget used as icon widget on @a button . See
205 * @return The widget used as icon on @a button , or <tt>0</tt>.
209 Widget* get_icon_widget();
211 /** Return the widget used as icon widget on @a button . See
213 * @return The widget used as icon on @a button , or <tt>0</tt>.
217 const Widget* get_icon_widget() const;
219 /** Sets @a label_widget as the widget that will be used as the label
220 * for @a button . If @a label_widget is <tt>0</tt> the "label" property is used
221 * as label. If "label" is also <tt>0</tt>, the label in the stock item
222 * determined by the "stock_id" property is used as label. If
223 * "stock_id" is also <tt>0</tt>, @a button does not have a label.
226 * @param label_widget The widget used as label, or <tt>0</tt>.
228 void set_label_widget(Widget& label_widget);
230 /** Returns the widget used as label on @a button . See
231 * set_label_widget().
232 * @return The widget used as label on @a button , or <tt>0</tt>.
236 Widget* get_label_widget();
238 /** Returns the widget used as label on @a button . See
239 * set_label_widget().
240 * @return The widget used as label on @a button , or <tt>0</tt>.
244 const Widget* get_label_widget() const;
247 Glib::SignalProxy0< void > signal_clicked();
250 /** Text to show in the item.
252 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
253 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
254 * the value of the property changes.
256 Glib::PropertyProxy<Glib::ustring> property_label() ;
258 /** Text to show in the item.
260 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
261 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
262 * the value of the property changes.
264 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_label() const;
268 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
269 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
270 * the value of the property changes.
272 Glib::PropertyProxy<bool> property_use_underline() ;
276 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
277 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
278 * the value of the property changes.
280 Glib::PropertyProxy_ReadOnly<bool> property_use_underline() const;
282 /** Widget to use as the item label.
284 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
285 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
286 * the value of the property changes.
288 Glib::PropertyProxy<Gtk::Widget*> property_label_widget() ;
290 /** Widget to use as the item label.
292 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
293 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
294 * the value of the property changes.
296 Glib::PropertyProxy_ReadOnly<Gtk::Widget*> property_label_widget() const;
298 /** The stock icon displayed on the item.
300 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
301 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
302 * the value of the property changes.
304 Glib::PropertyProxy<Glib::ustring> property_stock_id() ;
306 /** The stock icon displayed on the item.
308 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
309 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
310 * the value of the property changes.
312 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_stock_id() const;
314 /** Icon widget to display in the item.
316 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
317 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
318 * the value of the property changes.
320 Glib::PropertyProxy<Gtk::Widget> property_icon_widget() ;
322 /** Icon widget to display in the item.
324 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
325 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
326 * the value of the property changes.
328 Glib::PropertyProxy_ReadOnly<Gtk::Widget> property_icon_widget() const;
338 /** @relates Gtk::ToolButton
339 * @param object The C instance
340 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
341 * @result A C++ instance that wraps this C instance.
343 Gtk::ToolButton* wrap(GtkToolButton* object, bool take_copy = false);
345 #endif /* _GTKMM_TOOLBUTTON_H */