Remove ancient trunk folder from svn repository
[synfig.git] / synfig-studio / src / gtkmm / keyframedial.cpp
1 /* === S Y N F I G ========================================================= */
2 /*!     \file keyframedial.cpp
3 **      \brief Template File
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **      Copyright (c) 2009 Gerco Ballintijn
10 **      Copyright (c) 2009 Carlos Lopez
11 **
12 **      This package is free software; you can redistribute it and/or
13 **      modify it under the terms of the GNU General Public License as
14 **      published by the Free Software Foundation; either version 2 of
15 **      the License, or (at your option) any later version.
16 **
17 **      This package is distributed in the hope that it will be useful,
18 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
19 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 **      General Public License for more details.
21 **      \endlegal
22 */
23 /* ========================================================================= */
24
25 /* === H E A D E R S ======================================================= */
26
27 #ifdef USING_PCH
28 #       include "pch.h"
29 #else
30 #ifdef HAVE_CONFIG_H
31 #       include <config.h>
32 #endif
33
34 #include "keyframedial.h"
35 #include <gtkmm/image.h>
36 #include <gtkmm/stock.h>
37
38 #endif
39
40 /* === U S I N G =========================================================== */
41
42 using namespace std;
43 using namespace studio;
44
45 /* === M A C R O S ========================================================= */
46
47 /* === G L O B A L S ======================================================= */
48
49 /* === P R O C E D U R E S ================================================= */
50
51 /* === M E T H O D S ======================================================= */
52
53 KeyFrameDial::KeyFrameDial(): Gtk::Table(1, 3, false)
54 {
55         Gtk::IconSize iconsize = Gtk::IconSize::from_name("synfig-small_icon");
56
57         seek_prev_keyframe = create_icon(iconsize, Gtk::Stock::GO_BACK, _("Previous KeyFrame"));
58         seek_next_keyframe = create_icon(iconsize, Gtk::Stock::GO_FORWARD, _("Next KeyFrame"));
59         lock_keyframe = create_icon(Gtk::ICON_SIZE_BUTTON, "synfig-keyframe_lock_all",_("All Keyframes Locked"));
60
61         attach(*seek_prev_keyframe, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
62         attach(*seek_next_keyframe, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
63         attach(*lock_keyframe, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
64 }
65
66 Gtk::Button *
67 KeyFrameDial::create_icon(Gtk::IconSize iconsize, const char * stockid,
68                 const char * tooltip)
69 {
70         Gtk::Button *button = manage(new class Gtk::Button());
71         Gtk::Image *icon = manage(new Gtk::Image(Gtk::StockID(stockid), iconsize));
72         button->add(*icon);
73         tooltips.set_tip(*button, tooltip);
74         icon->set_padding(0, 0);
75         icon->show();
76         button->set_relief(Gtk::RELIEF_NONE);
77         button->show();
78
79         return button;
80 }
81
82 Gtk::Button *
83 KeyFrameDial::create_icon(Gtk::IconSize iconsize, const Gtk::BuiltinStockID & stockid,
84                 const char * tooltip)
85 {
86         Gtk::Button *button = manage(new class Gtk::Button());
87         Gtk::Image *icon = manage(new Gtk::Image(stockid, iconsize));
88         button->add(*icon);
89         tooltips.set_tip(*button, tooltip);
90         icon->set_padding(0, 0);
91         icon->show();
92         button->set_relief(Gtk::RELIEF_NONE);
93         button->show();
94
95         return button;
96 }