1 /* === S Y N F I G ========================================================= */
3 ** \brief Template Header
5 ** $Id: zoomdial.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === S T A R T =========================================================== */
24 #ifndef __SYNFIG_STUDIO_ZOOMDIAL_H
25 #define __SYNFIG_STUDIO_ZOOMDIAL_H
27 /* === H E A D E R S ======================================================= */
29 #include <gtkmm/tooltips.h>
30 #include <gtkmm/button.h>
32 /* === M A C R O S ========================================================= */
34 #define SMALL_BUTTON(button,stockid,tooltip) \
35 button = manage(new class Gtk::Button()); \
36 icon=manage(new Gtk::Image(Gtk::StockID(stockid),iconsize)); \
38 tooltips.set_tip(*button,tooltip); \
39 icon->set_padding(0,0);\
41 button->set_relief(Gtk::RELIEF_NONE); \
44 /* === T Y P E D E F S ===================================================== */
46 /* === C L A S S E S & S T R U C T S ======================================= */
51 class ZoomDial : public Gtk::Table
54 Gtk::Tooltips tooltips;
55 Gtk::IconSize iconsize;
60 Gtk::Button *zoom_out;
61 Gtk::Button *zoom_fit;
62 Gtk::Button *zoom_norm;
64 ZoomDial(Gtk::IconSize &size):Table(3, 1, false),iconsize(size)
68 SMALL_BUTTON(zoom_in,"gtk-add","Zoom In");
69 SMALL_BUTTON(zoom_out,"gtk-remove","Zoom Out");
70 SMALL_BUTTON(zoom_fit,"gtk-zoom-fit","Zoom Fit");
71 SMALL_BUTTON(zoom_norm,"gtk-zoom-100","Zoom to 100%");
73 attach(*zoom_out, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
74 attach(*zoom_norm, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
75 attach(*zoom_in, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
78 Glib::SignalProxy0<void> signal_zoom_in()
79 { return zoom_in->signal_clicked(); }
80 Glib::SignalProxy0<void> signal_zoom_out()
81 { return zoom_out->signal_clicked(); }
82 Glib::SignalProxy0<void> signal_zoom_fit()
83 { return zoom_fit->signal_clicked(); }
84 Glib::SignalProxy0<void> signal_zoom_norm()
85 { return zoom_norm->signal_clicked(); }
87 }; // END of class ZoomDial
89 }; // END of namespace studio
91 /* === E N D =============================================================== */