Remove .gitignore do nothing is ignored.
[synfig.git] / synfig-studio / trunk / src / gtkmm / framedial.cpp
1 /* === S Y N F I G ========================================================= */
2 /*!     \file framedial.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) 2008 Chris Moore
10 **  Copyright (c) 2009 Gerco Ballintijn
11 **      Copyright (c) 2009 Carlos López
12 **
13 **      This package is free software; you can redistribute it and/or
14 **      modify it under the terms of the GNU General Public License as
15 **      published by the Free Software Foundation; either version 2 of
16 **      the License, or (at your option) any later version.
17 **
18 **      This package is distributed in the hope that it will be useful,
19 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
20 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 **      General Public License for more details.
22 **      \endlegal
23 */
24 /* ========================================================================= */
25
26 /* === H E A D E R S ======================================================= */
27
28 #ifdef USING_PCH
29 #       include "pch.h"
30 #else
31 #ifdef HAVE_CONFIG_H
32 #       include <config.h>
33 #endif
34
35 #include "framedial.h"
36 #include <gtkmm/image.h>
37 #include <gtkmm/stock.h>
38
39 #endif
40
41 /* === U S I N G =========================================================== */
42
43 using namespace std;
44 using namespace studio;
45
46 /* === M A C R O S ========================================================= */
47
48 /* === G L O B A L S ======================================================= */
49
50 /* === P R O C E D U R E S ================================================= */
51
52 /* === M E T H O D S ======================================================= */
53
54 FrameDial::FrameDial(): Gtk::Table(5, 1, false)
55 {
56         Gtk::IconSize iconsize = Gtk::IconSize::from_name("synfig-small_icon");
57
58         seek_begin = create_icon(iconsize, Gtk::Stock::MEDIA_PREVIOUS,
59                                         _("Seek to Begin"));
60         seek_prev_frame = create_icon(iconsize, Gtk::Stock::MEDIA_REWIND,
61                                         _("Previous Frame"));
62         play_stop = create_icon(iconsize, Gtk::Stock::MEDIA_PLAY,
63                                         _("Play"));
64         seek_next_frame = create_icon(iconsize, Gtk::Stock::MEDIA_FORWARD,
65                                         _("Next Frame"));
66         seek_end = create_icon(iconsize, Gtk::Stock::MEDIA_NEXT,
67                                         _("Seek to End"));
68
69         attach(*seek_begin, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
70         attach(*seek_prev_frame, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
71         attach(*play_stop, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
72         attach(*seek_next_frame, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
73         attach(*seek_end, 4, 5, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
74 }
75
76 Gtk::Button *
77 FrameDial::create_icon(Gtk::IconSize size, const Gtk::BuiltinStockID & stockid,
78                 const char * tooltip)
79 {
80         Gtk::Button *button = manage(new class Gtk::Button());
81         Gtk::Image *icon = manage(new Gtk::Image(stockid, size));
82         button->add(*icon);
83         tooltips.set_tip(*button, tooltip);
84         icon->set_padding(0, 0);
85         icon->show();
86         button->set_relief(Gtk::RELIEF_NONE);
87         button->show();
88
89         return button;
90 }
91