1 /* === S Y N F I G ========================================================= */
2 /*! \file dialog_waypoint.cpp
3 ** \brief Template Header
5 ** $Id: dialog_waypoint.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === H E A D E R S ======================================================= */
31 #include <gtkmm/label.h>
32 #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"
46 using namespace synfig;
49 using namespace studio;
51 /* === M A C R O S ========================================================= */
53 /* === G L O B A L S ======================================================= */
55 /* === P R O C E D U R E S ================================================= */
57 /* === M E T H O D S ======================================================= */
59 Dialog_Waypoint::Dialog_Waypoint(Gtk::Window& parent,etl::handle<synfig::Canvas> canvas):
60 Dialog(_("Waypoint Editor"),parent,false,true),
64 waypointwidget=manage(new class Widget_Waypoint(canvas));
65 get_vbox()->pack_start(*waypointwidget);
67 Gtk::Button *ok_button(manage(new class Gtk::Button(Gtk::StockID("gtk-ok"))));
69 add_action_widget(*ok_button,2);
70 ok_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_ok_pressed));
72 Gtk::Button *apply_button(manage(new class Gtk::Button(Gtk::StockID("gtk-apply"))));
74 add_action_widget(*apply_button,1);
75 apply_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_apply_pressed));
77 Gtk::Button *delete_button(manage(new class Gtk::Button(Gtk::StockID("gtk-delete"))));
78 delete_button->show();
79 add_action_widget(*delete_button,3);
80 delete_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_delete_pressed));
82 Gtk::Button *cancel_button(manage(new class Gtk::Button(Gtk::StockID("gtk-close"))));
83 cancel_button->show();
84 add_action_widget(*cancel_button,0);
85 cancel_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::hide));
88 waypointwidget->show_all();
91 Dialog_Waypoint::~Dialog_Waypoint()
96 Dialog_Waypoint::on_ok_pressed()
103 Dialog_Waypoint::on_apply_pressed()
109 Dialog_Waypoint::on_delete_pressed()
116 Dialog_Waypoint::set_waypoint(synfig::ValueNode_Animated::Waypoint x)
118 waypointwidget->set_waypoint(x);
121 const synfig::ValueNode_Animated::Waypoint &
122 Dialog_Waypoint::get_waypoint()const
124 return waypointwidget->get_waypoint();
128 Dialog_Waypoint::set_value_desc(synfigapp::ValueDesc value_desc)
130 value_desc_=value_desc;
131 if(value_desc.get_value_node() && value_desc.get_value_node()->get_parent_canvas())
132 waypointwidget->set_canvas(value_desc.get_value_node()->get_parent_canvas());
136 Dialog_Waypoint::reset()