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 "dialogs/dialog_waypoint.h"
35 #include <gtkmm/spinbutton.h>
36 #include <gtkmm/combo.h>
37 #include <ETL/stringf>
38 #include "widgets/widget_value.h"
40 #include <gtkmm/menu.h>
41 #include <gtkmm/optionmenu.h>
42 #include "widgets/widget_time.h"
43 #include "widgets/widget_waypoint.h"
49 using namespace synfig;
52 using namespace studio;
54 /* === M A C R O S ========================================================= */
56 /* === G L O B A L S ======================================================= */
58 /* === P R O C E D U R E S ================================================= */
60 /* === M E T H O D S ======================================================= */
62 Dialog_Waypoint::Dialog_Waypoint(Gtk::Window& parent,etl::handle<synfig::Canvas> canvas):
63 Dialog(_("Waypoint Editor"),parent,false,true),
67 waypointwidget=manage(new class Widget_Waypoint(canvas));
68 get_vbox()->pack_start(*waypointwidget);
70 Gtk::Button *ok_button(manage(new class Gtk::Button(Gtk::StockID("gtk-ok"))));
72 add_action_widget(*ok_button,2);
73 ok_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_ok_pressed));
75 Gtk::Button *apply_button(manage(new class Gtk::Button(Gtk::StockID("gtk-apply"))));
77 add_action_widget(*apply_button,1);
78 apply_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_apply_pressed));
80 Gtk::Button *delete_button(manage(new class Gtk::Button(Gtk::StockID("gtk-delete"))));
81 delete_button->show();
82 add_action_widget(*delete_button,3);
83 delete_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_delete_pressed));
85 Gtk::Button *cancel_button(manage(new class Gtk::Button(Gtk::StockID("gtk-close"))));
86 cancel_button->show();
87 add_action_widget(*cancel_button,0);
88 cancel_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::hide));
91 waypointwidget->show_all();
94 Dialog_Waypoint::~Dialog_Waypoint()
99 Dialog_Waypoint::on_ok_pressed()
106 Dialog_Waypoint::on_apply_pressed()
112 Dialog_Waypoint::on_delete_pressed()
119 Dialog_Waypoint::set_waypoint(synfig::ValueNode_Animated::Waypoint x)
121 waypointwidget->set_waypoint(x);
124 const synfig::ValueNode_Animated::Waypoint &
125 Dialog_Waypoint::get_waypoint()const
127 return waypointwidget->get_waypoint();
131 Dialog_Waypoint::set_value_desc(synfigapp::ValueDesc value_desc)
133 value_desc_=value_desc;
134 if(value_desc.get_value_node() && value_desc.get_value_node()->get_parent_canvas())
135 waypointwidget->set_canvas(value_desc.get_value_node()->get_parent_canvas());
139 Dialog_Waypoint::reset()