9c4e1890956436d822d2b3c83ecd4417f9548fb5
1 /**
2 * \brief Toolbox Widget - A detachable toolbar for buttons and other widgets.
3 *
4 * Author:
5 * Derek P. Moore <derekm@hackunix.org>
6 *
7 * Copyright (C) 2004 Derek P. Moore
8 *
9 * Released under GNU GPL. Read the file 'COPYING' for more information.
10 */
12 #ifndef INKSCAPE_UI_WIDGET_TOOLBOX_H
13 #define INKSCAPE_UI_WIDGET_TOOLBOX_H
15 #include <gtkmm/toolbar.h>
16 #include <gtkmm/menu.h>
17 #include <gtkmm/action.h>
18 #include <gtkmm/uimanager.h>
19 #include "handlebox.h"
21 namespace Inkscape {
22 namespace UI {
23 namespace Widget {
25 class Toolbox : public HandleBox
26 {
27 public:
28 Toolbox(Gtk::Toolbar *toolbar,
29 Gtk::Orientation orientation = Gtk::ORIENTATION_HORIZONTAL);
30 Toolbox(Gtk::Toolbar *toolbar,
31 Gtk::ToolbarStyle style,
32 Gtk::Orientation orientation = Gtk::ORIENTATION_HORIZONTAL);
34 Gtk::Toolbar& get_toolbar();
36 protected:
37 Gtk::Menu *_context_menu;
39 Glib::RefPtr<Gtk::ActionGroup> _action_grp;
40 Glib::RefPtr<Gtk::ActionGroup> _detach_grp;
41 Glib::RefPtr<Gtk::UIManager> _ui_mgr;
43 void init_actions();
44 void init_orientation(Gtk::Orientation const &orientation);
45 void init_style(Gtk::ToolbarStyle const &style);
46 bool on_popup_context_menu(int x, int y, int button);
47 void on_child_attached(Gtk::Widget *widget);
48 void on_child_detached(Gtk::Widget *widget);
49 void on_change_style_icons();
50 void on_change_style_text();
51 void on_change_style_both();
52 void on_change_style_both_horiz();
53 void on_change_orient_horiz();
54 void on_change_orient_vert();
55 void on_show_arrow();
56 };
58 } // namespace Widget
59 } // namespace UI
60 } // namespace Inkscape
62 #endif // INKSCAPE_UI_WIDGET_TOOLBOX_H
64 /*
65 Local Variables:
66 mode:c++
67 c-file-style:"stroustrup"
68 c-file-offsets:((innamespace . 0)(inline-open . 0))
69 indent-tabs-mode:nil
70 fill-column:99
71 End:
72 */
73 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :