1 /**
2 * \brief Generic Panel widget - A generic dockable container.
3 *
4 * Authors:
5 * Bryce Harrington <bryce@bryceharrington.org>
6 * Jon A. Cruz <jon@joncruz.org>
7 *
8 * Copyright (C) 2004 Bryce Harrington
9 * Copyright (C) 2005 Jon A. Cruz
10 *
11 * Released under GNU GPL. Read the file 'COPYING' for more information.
12 */
14 #ifndef SEEN_INKSCAPE_UI_WIDGET_PANEL_H
15 #define SEEN_INKSCAPE_UI_WIDGET_PANEL_H
17 #include <gtkmm/arrow.h>
18 #include <gtkmm/box.h>
19 #include <gtkmm/eventbox.h>
20 #include <gtkmm/frame.h>
21 #include <gtkmm/table.h>
22 #include <gtkmm/button.h>
23 #include <gtkmm/label.h>
24 #include <gtkmm/menu.h>
25 #include <gtkmm/optionmenu.h>
26 #include "../previewfillable.h"
28 namespace Inkscape {
29 namespace UI {
30 namespace Widget {
32 class Panel : public Gtk::VBox
33 {
34 public:
35 Panel();
36 virtual ~Panel();
37 Panel(Glib::ustring const &label, bool menuDesired = false );
38 Panel(const gchar *prefs_path, bool menuDesired = false );
40 void setLabel(Glib::ustring const &label);
41 Glib::ustring const &getLabel() const;
43 virtual void setOrientation( Gtk::AnchorType how );
45 const gchar *_prefs_path;
46 void restorePanelPrefs();
48 protected:
49 Gtk::Box* _getContents() { return &contents; }
50 void _setTargetFillable( PreviewFillable *target );
51 void _regItem( Gtk::MenuItem* item, int group, int id );
53 virtual void _handleAction( int setId, int itemId );
54 bool _menuDesired;
56 Gtk::AnchorType _anchor;
58 private:
59 void init();
60 void bounceCall(int i, int j);
62 void _popper(GdkEventButton* btn);
64 Glib::ustring label;
66 Gtk::HBox topBar;
67 Gtk::VBox rightBar;
68 Gtk::VBox contents;
69 Gtk::Label tabTitle;
70 Gtk::Arrow _tempArrow;
71 Gtk::EventBox menuPopper;
72 Gtk::Button closeButton;
73 Gtk::Menu* menu;
74 PreviewFillable *_fillable;
75 };
77 } // namespace Widget
78 } // namespace UI
79 } // namespace Inkscape
81 #endif // SEEN_INKSCAPE_UI_WIDGET_PANEL_H
83 /*
84 Local Variables:
85 mode:c++
86 c-file-style:"stroustrup"
87 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
88 indent-tabs-mode:nil
89 fill-column:99
90 End:
91 */
92 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :