1 /* === S Y N F I G ========================================================= */
3 ** \brief Template Header
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_STUDIO_ZOOMDIAL_H
26 #define __SYNFIG_STUDIO_ZOOMDIAL_H
28 /* === H E A D E R S ======================================================= */
30 #include <gtkmm/tooltips.h>
31 #include <gtkmm/button.h>
33 /* === M A C R O S ========================================================= */
35 #define SMALL_BUTTON(button,stockid,tooltip) \
36 button = manage(new class Gtk::Button()); \
37 icon=manage(new Gtk::Image(Gtk::StockID(stockid),iconsize)); \
39 tooltips.set_tip(*button,tooltip); \
40 icon->set_padding(0,0);\
42 button->set_relief(Gtk::RELIEF_NONE); \
45 /* === T Y P E D E F S ===================================================== */
47 /* === C L A S S E S & S T R U C T S ======================================= */
52 class ZoomDial : public Gtk::Table
55 Gtk::Tooltips tooltips;
56 Gtk::IconSize iconsize;
61 Gtk::Button *zoom_out;
62 Gtk::Button *zoom_fit;
63 Gtk::Button *zoom_norm;
65 ZoomDial(Gtk::IconSize &size):Table(3, 1, false),iconsize(size)
69 SMALL_BUTTON(zoom_in,"gtk-add","Zoom In");
70 SMALL_BUTTON(zoom_out,"gtk-remove","Zoom Out");
71 SMALL_BUTTON(zoom_fit,"gtk-zoom-fit","Zoom Fit");
72 SMALL_BUTTON(zoom_norm,"gtk-zoom-100","Zoom to 100%");
74 attach(*zoom_out, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
75 attach(*zoom_norm, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
76 attach(*zoom_in, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
79 Glib::SignalProxy0<void> signal_zoom_in()
80 { return zoom_in->signal_clicked(); }
81 Glib::SignalProxy0<void> signal_zoom_out()
82 { return zoom_out->signal_clicked(); }
83 Glib::SignalProxy0<void> signal_zoom_fit()
84 { return zoom_fit->signal_clicked(); }
85 Glib::SignalProxy0<void> signal_zoom_norm()
86 { return zoom_norm->signal_clicked(); }
88 }; // END of class ZoomDial
90 }; // END of namespace studio
92 /* === E N D =============================================================== */