1 /* === S Y N F I G ========================================================= */
2 /*! \file dialog_keyframe.cpp
3 ** \brief Template File
5 ** $Id: dialog_keyframe.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 "dialog_keyframe.h"
32 #include <gtkmm/scrolledwindow.h>
33 #include <gtkmm/button.h>
34 #include "widget_waypointmodel.h"
35 #include <synfigapp/action.h>
36 #include <synfigapp/instance.h>
40 /* === U S I N G =========================================================== */
44 using namespace synfig;
45 using namespace studio;
47 /* === M A C R O S ========================================================= */
49 /* === G L O B A L S ======================================================= */
51 /* === P R O C E D U R E S ================================================= */
53 /* === M E T H O D S ======================================================= */
55 Dialog_Keyframe::Dialog_Keyframe(Gtk::Window& parent,handle<synfigapp::CanvasInterface> canvas_interface):
56 Gtk::Dialog(_("Keyframe Dialog"),parent,false,true),
57 canvas_interface(canvas_interface)
61 Gtk::Button *ok_button(manage(new class Gtk::Button(Gtk::StockID("gtk-ok"))));
63 add_action_widget(*ok_button,2);
64 ok_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Keyframe::on_ok_pressed));
66 /* Gtk::Button *apply_button(manage(new class Gtk::Button(Gtk::StockID("gtk-apply"))));
68 add_action_widget(*apply_button,1);
69 apply_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Keyframe::on_apply_pressed));
71 Gtk::Button *delete_button(manage(new class Gtk::Button(Gtk::StockID("gtk-delete"))));
72 delete_button->show();
73 add_action_widget(*delete_button,3);
74 delete_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Keyframe::on_delete_pressed));
76 Gtk::Button *cancel_button(manage(new class Gtk::Button(Gtk::StockID("gtk-close"))));
77 cancel_button->show();
78 add_action_widget(*cancel_button,0);
79 cancel_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Keyframe::hide));
82 Gtk::Table *table=manage(new Gtk::Table(2,2,false));
84 get_vbox()->pack_start(*table);
86 entry_description.set_text("Not yet implemented");
88 //table->attach(*manage(new Gtk::Label(_("Description"))), 0, 1, 0, 1, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
89 //table->attach(entry_description, 1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
93 widget_waypoint_model=Gtk::manage(new Widget_WaypointModel());
94 widget_waypoint_model->show();
95 table->attach(*widget_waypoint_model, 0, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
99 Dialog_Keyframe::~Dialog_Keyframe()
103 const synfig::Keyframe&
104 Dialog_Keyframe::get_keyframe()const
110 Dialog_Keyframe::set_keyframe(const synfig::Keyframe& x)
116 Dialog_Keyframe::on_ok_pressed()
118 if(widget_waypoint_model->get_waypoint_model().is_trivial())
121 synfigapp::Action::Handle action(synfigapp::Action::create("keyframe_waypoint_set"));
125 action->set_param("canvas",canvas_interface->get_canvas());
126 action->set_param("canvas_interface",canvas_interface);
127 action->set_param("keyframe",keyframe_);
128 action->set_param("model",widget_waypoint_model->get_waypoint_model());
130 if(!canvas_interface->get_instance()->perform_action(action))
137 Dialog_Keyframe::on_delete_pressed()
143 Dialog_Keyframe::on_apply_pressed()