/* Copyright (C) 1998-2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see .
*/
// This is for including the config header before any code (such as
// the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
_CONFIGINCLUDE(gtkmmconfig.h)
#include
#include
#include
#include
#include
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/container_p.h)
namespace Gtk
{
//TODO: Derive from Toolshell when we can break ABI.
/** Bars of buttons and other widgets.
* @ingroup Widgets
* @ingroup Containers
* @ingroup Toolbars
*/
class GTKMM_API Toolbar
: public Container,
public ToolShell
{
_CLASS_GTKOBJECT(Toolbar,GtkToolbar,GTK_TOOLBAR,Gtk::Container,GtkContainer,,,GTKMM_API)
_IMPLEMENTS_INTERFACE(ToolShell)
public:
_CTOR_DEFAULT()
_WRAP_METHOD(void insert(ToolItem& item, int pos), gtk_toolbar_insert)
void insert(ToolButton& item, int pos, const sigc::slot& clicked_slot);
void insert(ToggleToolButton& item, int pos, const sigc::slot& toggled_slot);
void append(ToolItem& item);
void append(ToolButton& item, const sigc::slot& clicked_slot);
void append(ToggleToolButton& item, const sigc::slot& toggled_slot);
void prepend(ToolItem& item);
void prepend(ToolButton& item, const sigc::slot& clicked_slot);
void prepend(ToggleToolButton& item, const sigc::slot& toggled_slot);
_WRAP_METHOD(int get_item_index(const ToolItem& item) const, gtk_toolbar_get_item_index)
_WRAP_METHOD(int get_n_items() const, gtk_toolbar_get_n_items)
_WRAP_METHOD(ToolItem* get_nth_item(int n), gtk_toolbar_get_nth_item)
_WRAP_METHOD(const ToolItem* get_nth_item(int n) const, gtk_toolbar_get_nth_item, constversion)
_WRAP_METHOD(bool get_show_arrow() const, gtk_toolbar_get_show_arrow)
_WRAP_METHOD(void set_show_arrow(bool show_arrow = true), gtk_toolbar_set_show_arrow)
/* Style methods */
_WRAP_METHOD(void set_toolbar_style(ToolbarStyle style), gtk_toolbar_set_style)
_WRAP_METHOD(ToolbarStyle get_toolbar_style() const, gtk_toolbar_get_style)
_WRAP_METHOD(void unset_toolbar_style(), gtk_toolbar_unset_style)
//Note that gtk_toolbar_set_icon_size() and gtk_toolbar_unset_icon_size() were
//deprecated sometime before GTK+ 2.4, but were undeprecated in GTK+ 2.12.
_WRAP_METHOD(void set_icon_size(IconSize icon_size), gtk_toolbar_set_icon_size)
_WRAP_METHOD(void unset_icon_size(), gtk_toolbar_unset_icon_size)
_WRAP_METHOD(IconSize get_icon_size() const, gtk_toolbar_get_icon_size)
_WRAP_METHOD(ReliefStyle get_relief_style() const, gtk_toolbar_get_relief_style)
_WRAP_METHOD(int get_drop_index(int x, int y) const, gtk_toolbar_get_drop_index)
_WRAP_METHOD(void set_drop_highlight_item(ToolItem& tool_item, int index), gtk_toolbar_set_drop_highlight_item)
void unset_drop_highlight_item();
_WRAP_SIGNAL(void orientation_changed(Orientation orientation), "orientation_changed")
_WRAP_SIGNAL(void toolbar_style_changed(ToolbarStyle style), "style_changed")
_WRAP_SIGNAL(bool popup_context_menu(int x, int y, int button_number), "popup_context_menu")
_IGNORE_SIGNAL("focus_home_or_end")
_WRAP_PROPERTY("toolbar_style", ToolbarStyle)
_WRAP_PROPERTY("show_arrow", bool)
_WRAP_PROPERTY("icon-size", IconSize)
_WRAP_PROPERTY("icon-size-set", bool)
_WRAP_CHILD_PROPERTY("expand", bool)
_WRAP_CHILD_PROPERTY("homogeneous", bool)
};
} // namespace Gtk