1 /* === S Y N F I G ========================================================= */
2 /*! \file dialog_waypoint.cpp
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 /* === H E A D E R S ======================================================= */
32 #include <gtkmm/label.h>
33 #include "dialog_waypoint.h"
35 #include <gtkmm/spinbutton.h>
36 #include <gtkmm/combo.h>
37 #include <ETL/stringf>
38 #include "widget_value.h"
40 #include <gtkmm/menu.h>
41 #include <gtkmm/optionmenu.h>
42 #include "widget_time.h"
43 #include "widget_waypoint.h"
47 using namespace synfig;
50 using namespace studio;
52 /* === M A C R O S ========================================================= */
54 /* === G L O B A L S ======================================================= */
56 /* === P R O C E D U R E S ================================================= */
58 /* === M E T H O D S ======================================================= */
60 Dialog_Waypoint::Dialog_Waypoint(Gtk::Window& parent,etl::handle<synfig::Canvas> canvas):
61 Dialog(_("Waypoint Editor"),parent,false,true),
65 waypointwidget=manage(new class Widget_Waypoint(canvas));
66 get_vbox()->pack_start(*waypointwidget);
68 Gtk::Button *ok_button(manage(new class Gtk::Button(Gtk::StockID("gtk-ok"))));
70 add_action_widget(*ok_button,2);
71 ok_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_ok_pressed));
73 Gtk::Button *apply_button(manage(new class Gtk::Button(Gtk::StockID("gtk-apply"))));
75 add_action_widget(*apply_button,1);
76 apply_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_apply_pressed));
78 Gtk::Button *delete_button(manage(new class Gtk::Button(Gtk::StockID("gtk-delete"))));
79 delete_button->show();
80 add_action_widget(*delete_button,3);
81 delete_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_delete_pressed));
83 Gtk::Button *cancel_button(manage(new class Gtk::Button(Gtk::StockID("gtk-close"))));
84 cancel_button->show();
85 add_action_widget(*cancel_button,0);
86 cancel_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::hide));
89 waypointwidget->show_all();
92 Dialog_Waypoint::~Dialog_Waypoint()
97 Dialog_Waypoint::on_ok_pressed()
104 Dialog_Waypoint::on_apply_pressed()
110 Dialog_Waypoint::on_delete_pressed()
117 Dialog_Waypoint::set_waypoint(synfig::ValueNode_Animated::Waypoint x)
119 waypointwidget->set_waypoint(x);
122 const synfig::ValueNode_Animated::Waypoint &
123 Dialog_Waypoint::get_waypoint()const
125 return waypointwidget->get_waypoint();
129 Dialog_Waypoint::set_value_desc(synfigapp::ValueDesc value_desc)
131 value_desc_=value_desc;
132 if(value_desc.get_value_node() && value_desc.get_value_node()->get_parent_canvas())
133 waypointwidget->set_canvas(value_desc.get_value_node()->get_parent_canvas());
137 Dialog_Waypoint::reset()