source: synfigstudio/trunk/fuentes/src/gui/dials/keyframedial.cpp @ 481

Last change on this file since 481 was 481, checked in by jrpelegrina, 4 years ago

First release to xenial

File size: 2.5 KB
Line 
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#endif
38
39/* === U S I N G =========================================================== */
40
41using namespace std;
42using namespace studio;
43
44/* === M A C R O S ========================================================= */
45
46/* === G L O B A L S ======================================================= */
47
48/* === P R O C E D U R E S ================================================= */
49
50/* === M E T H O D S ======================================================= */
51
52KeyFrameDial::KeyFrameDial(): Gtk::Table(2, 1, false)
53{
54        toggle_keyframe_past = create_icon(Gtk::ICON_SIZE_BUTTON, "synfig-keyframe_lock_past_on",_("Unlock past keyframe"));
55        toggle_keyframe_future = create_icon(Gtk::ICON_SIZE_BUTTON, "synfig-keyframe_lock_future_on",_("Unlock future keyframe"));
56        attach(*toggle_keyframe_past, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
57        attach(*toggle_keyframe_future, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
58}
59
60Gtk::ToggleButton *
61KeyFrameDial::create_icon(Gtk::IconSize iconsize, const char * stockid,
62                const char * tooltip)
63{
64        iconsize = Gtk::IconSize::from_name("synfig-small_icon_16x16");
65        Gtk::Image *icon = manage(new Gtk::Image(Gtk::StockID(stockid), iconsize));
66        Gtk::ToggleButton *button = manage(new class Gtk::ToggleButton());
67        button->add(*icon);
68        button->set_tooltip_text(tooltip);
69        icon->set_padding(0, 0);
70        icon->show();
71        button->set_relief(Gtk::RELIEF_NONE);
72        button->set_active();
73        button->show();
74
75        return button;
76}
Note: See TracBrowser for help on using the repository browser.