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"
34 #include <gtkmm/spinbutton.h>
35 #include <gtkmm/combo.h>
36 #include <ETL/stringf>
37 #include "widget_value.h"
39 #include <gtkmm/menu.h>
40 #include <gtkmm/optionmenu.h>
41 #include "widget_time.h"
42 #include "widget_waypoint.h"
48 using namespace synfig;
51 using namespace studio;
53 /* === M A C R O S ========================================================= */
55 /* === G L O B A L S ======================================================= */
57 /* === P R O C E D U R E S ================================================= */
59 /* === M E T H O D S ======================================================= */
61 Dialog_Waypoint::Dialog_Waypoint(Gtk::Window& parent,etl::handle<synfig::Canvas> canvas):
62 Dialog(_("Waypoint Editor"),parent,false,true),
66 waypointwidget=manage(new class Widget_Waypoint(canvas));
67 get_vbox()->pack_start(*waypointwidget);
69 Gtk::Button *ok_button(manage(new class Gtk::Button(Gtk::StockID("gtk-ok"))));
71 add_action_widget(*ok_button,2);
72 ok_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_ok_pressed));
74 Gtk::Button *apply_button(manage(new class Gtk::Button(Gtk::StockID("gtk-apply"))));
76 add_action_widget(*apply_button,1);
77 apply_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_apply_pressed));
79 Gtk::Button *delete_button(manage(new class Gtk::Button(Gtk::StockID("gtk-delete"))));
80 delete_button->show();
81 add_action_widget(*delete_button,3);
82 delete_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_delete_pressed));
84 Gtk::Button *cancel_button(manage(new class Gtk::Button(Gtk::StockID("gtk-close"))));
85 cancel_button->show();
86 add_action_widget(*cancel_button,0);
87 cancel_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::hide));
90 waypointwidget->show_all();
93 Dialog_Waypoint::~Dialog_Waypoint()
98 Dialog_Waypoint::on_ok_pressed()
105 Dialog_Waypoint::on_apply_pressed()
111 Dialog_Waypoint::on_delete_pressed()
118 Dialog_Waypoint::set_waypoint(synfig::ValueNode_Animated::Waypoint x)
120 waypointwidget->set_waypoint(x);
123 const synfig::ValueNode_Animated::Waypoint &
124 Dialog_Waypoint::get_waypoint()const
126 return waypointwidget->get_waypoint();
130 Dialog_Waypoint::set_value_desc(synfigapp::ValueDesc value_desc)
132 value_desc_=value_desc;
133 if(value_desc.get_value_node() && value_desc.get_value_node()->get_parent_canvas())
134 waypointwidget->set_canvas(value_desc.get_value_node()->get_parent_canvas());
138 Dialog_Waypoint::reset()