X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Fsrc%2Fgui%2Fdialogs%2Fdialog_waypoint.cpp;fp=synfig-studio%2Fsrc%2Fgui%2Fdialogs%2Fdialog_waypoint.cpp;h=642b4d6e8f7f1f2b1c528bf586773ab0c2e0042c;hb=76ba27a6690b007a956b56ba4c537c952c8c4889;hp=0000000000000000000000000000000000000000;hpb=eca839040348e9de1b8150eb9d835658f8b3fea6;p=synfig.git diff --git a/synfig-studio/src/gui/dialogs/dialog_waypoint.cpp b/synfig-studio/src/gui/dialogs/dialog_waypoint.cpp new file mode 100644 index 0000000..642b4d6 --- /dev/null +++ b/synfig-studio/src/gui/dialogs/dialog_waypoint.cpp @@ -0,0 +1,141 @@ +/* === S Y N F I G ========================================================= */ +/*! \file dialog_waypoint.cpp +** \brief Template Header +** +** $Id$ +** +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. +** +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. +** \endlegal +*/ +/* ========================================================================= */ + +/* === H E A D E R S ======================================================= */ + +#ifdef USING_PCH +# include "pch.h" +#else +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include "dialogs/dialog_waypoint.h" +#include +#include +#include +#include +#include "widget_value.h" +#include "app.h" +#include +#include +#include "widget_time.h" +#include "widget_waypoint.h" + +#include "general.h" + +#endif + +using namespace synfig; +using namespace std; +using namespace etl; +using namespace studio; + +/* === M A C R O S ========================================================= */ + +/* === G L O B A L S ======================================================= */ + +/* === P R O C E D U R E S ================================================= */ + +/* === M E T H O D S ======================================================= */ + +Dialog_Waypoint::Dialog_Waypoint(Gtk::Window& parent,etl::handle canvas): + Dialog(_("Waypoint Editor"),parent,false,true), + canvas(canvas) +{ + assert(canvas); + waypointwidget=manage(new class Widget_Waypoint(canvas)); + get_vbox()->pack_start(*waypointwidget); + + Gtk::Button *ok_button(manage(new class Gtk::Button(Gtk::StockID("gtk-ok")))); + ok_button->show(); + add_action_widget(*ok_button,2); + ok_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_ok_pressed)); + + Gtk::Button *apply_button(manage(new class Gtk::Button(Gtk::StockID("gtk-apply")))); + apply_button->show(); + add_action_widget(*apply_button,1); + apply_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_apply_pressed)); + + Gtk::Button *delete_button(manage(new class Gtk::Button(Gtk::StockID("gtk-delete")))); + delete_button->show(); + add_action_widget(*delete_button,3); + delete_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::on_delete_pressed)); + + Gtk::Button *cancel_button(manage(new class Gtk::Button(Gtk::StockID("gtk-close")))); + cancel_button->show(); + add_action_widget(*cancel_button,0); + cancel_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Waypoint::hide)); + + + waypointwidget->show_all(); +} + +Dialog_Waypoint::~Dialog_Waypoint() +{ +} + +void +Dialog_Waypoint::on_ok_pressed() +{ + hide(); + signal_changed_(); +} + +void +Dialog_Waypoint::on_apply_pressed() +{ + signal_changed_(); +} + +void +Dialog_Waypoint::on_delete_pressed() +{ + hide(); + signal_delete_(); +} + +void +Dialog_Waypoint::set_waypoint(synfig::ValueNode_Animated::Waypoint x) +{ + waypointwidget->set_waypoint(x); +} + +const synfig::ValueNode_Animated::Waypoint & +Dialog_Waypoint::get_waypoint()const +{ + return waypointwidget->get_waypoint(); +} + +void +Dialog_Waypoint::set_value_desc(synfigapp::ValueDesc value_desc) +{ + value_desc_=value_desc; + if(value_desc.get_value_node() && value_desc.get_value_node()->get_parent_canvas()) + waypointwidget->set_canvas(value_desc.get_value_node()->get_parent_canvas()); +} + +void +Dialog_Waypoint::reset() +{ +}