-/* === S I N F G =========================================================== */
-/*! \file dialog_waypointmodel.cpp
+/* === S Y N F I G ========================================================= */
+/*! \file widget_waypointmodel.cpp
** \brief Template Header
**
-** $Id: widget_waypointmodel.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+** $Id$
**
** \legal
-** Copyright (c) 2002 Robert B. Quattlebaum Jr.
+** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2008 Paul Wise
**
-** This software and associated documentation
-** are CONFIDENTIAL and PROPRIETARY property of
-** the above-mentioned copyright holder.
+** 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.
**
-** You may not copy, print, publish, or in any
-** other way distribute this software without
-** a prior written agreement with
-** the copyright holder.
+** 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
*/
/* ========================================================================= */
#include <gtkmm/optionmenu.h>
#include "widget_time.h"
#include "widget_waypointmodel.h"
+#include "general.h"
+
#endif
-using namespace sinfg;
+using namespace synfig;
using namespace std;
using namespace etl;
using namespace studio;
checkbutton_temporal_tension(_("Temporal Tension:"))
{
before_options=manage(new class Gtk::Menu());
- before_options->items().push_back(Gtk::Menu_Helpers::MenuElem("TCB Smooth"));
- before_options->items().push_back(Gtk::Menu_Helpers::MenuElem("Constant"));
- before_options->items().push_back(Gtk::Menu_Helpers::MenuElem("Linear"));
- before_options->items().push_back(Gtk::Menu_Helpers::MenuElem("Ease In"));
- before_options->items().push_back(Gtk::Menu_Helpers::MenuElem("Manual"));
+ before_options->items().push_back(Gtk::Menu_Helpers::MenuElem(_("TCB Smooth")));
+ before_options->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Constant")));
+ before_options->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Linear")));
+ before_options->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Ease In")));
+ // before_options->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Manual")));
after_options=manage(new class Gtk::Menu());
- after_options->items().push_back(Gtk::Menu_Helpers::MenuElem("TCB Smooth"));
- after_options->items().push_back(Gtk::Menu_Helpers::MenuElem("Constant"));
- after_options->items().push_back(Gtk::Menu_Helpers::MenuElem("Linear"));
- after_options->items().push_back(Gtk::Menu_Helpers::MenuElem("Ease Out"));
- after_options->items().push_back(Gtk::Menu_Helpers::MenuElem("Manual"));
+ after_options->items().push_back(Gtk::Menu_Helpers::MenuElem(_("TCB Smooth")));
+ after_options->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Constant")));
+ after_options->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Linear")));
+ after_options->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Ease Out")));
+ // after_options->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Manual")));
before=manage(new class Gtk::OptionMenu());
before->show();
checkbutton_continuity.signal_toggled().connect(sigc::mem_fun(*this,&Widget_WaypointModel::on_change));
checkbutton_bias.signal_toggled().connect(sigc::mem_fun(*this,&Widget_WaypointModel::on_change));
checkbutton_temporal_tension.signal_toggled().connect(sigc::mem_fun(*this,&Widget_WaypointModel::on_change));
-
+
adj_tension.signal_value_changed().connect(sigc::mem_fun(*this,&Widget_WaypointModel::on_change));
adj_continuity.signal_value_changed().connect(sigc::mem_fun(*this,&Widget_WaypointModel::on_change));
adj_bias.signal_value_changed().connect(sigc::mem_fun(*this,&Widget_WaypointModel::on_change));
before->signal_changed().connect(sigc::mem_fun(*this,&Widget_WaypointModel::on_change));
after->signal_changed().connect(sigc::mem_fun(*this,&Widget_WaypointModel::on_change));
-
- attach(checkbutton_before, 0, 1, 0, 1, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
+
+ attach(checkbutton_before, 0, 1, 0, 1, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
attach(*before, 1, 2, 0,1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- attach(checkbutton_after, 2, 3, 0, 1, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
+ attach(checkbutton_after, 2, 3, 0, 1, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
attach(*after, 3, 4, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- attach(checkbutton_tension, 0, 1, 1, 2, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
+ attach(checkbutton_tension, 0, 1, 1, 2, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
attach(*spin_tension, 1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- attach(checkbutton_continuity, 2, 3, 1, 2, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
+ attach(checkbutton_continuity, 2, 3, 1, 2, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
attach(*spin_continuity, 3, 4, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- attach(checkbutton_bias, 0, 1, 2, 3, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
+ attach(checkbutton_bias, 0, 1, 2, 3, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
attach(*spin_bias, 1, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
- attach(checkbutton_temporal_tension, 2, 3, 2, 3, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
+ attach(checkbutton_temporal_tension, 2, 3, 2, 3, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
attach(*spin_temporal_tension, 3, 4, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
show_all();
{
if(updating)
return;
-
+
waypoint_model.set_before((Waypoint::Interpolation)before->get_history());
waypoint_model.set_after((Waypoint::Interpolation)after->get_history());
waypoint_model.set_continuity_flag(checkbutton_continuity.get_active());
waypoint_model.set_bias_flag(checkbutton_bias.get_active());
waypoint_model.set_temporal_tension_flag(checkbutton_temporal_tension.get_active());
-
+
before->set_sensitive(checkbutton_before.get_active());
after->set_sensitive(checkbutton_after.get_active());
spin_tension->set_sensitive(checkbutton_tension.get_active());
}
void
-Widget_WaypointModel::set_waypoint_model(sinfg::Waypoint::Model &x)
+Widget_WaypointModel::set_waypoint_model(synfig::Waypoint::Model &x)
{
waypoint_model=x;
updating=true;
-
+
before->set_history((int)waypoint_model.get_before());
after->set_history((int)waypoint_model.get_after());
adj_continuity.set_value(waypoint_model.get_continuity());
adj_bias.set_value(waypoint_model.get_bias());
adj_temporal_tension.set_value(waypoint_model.get_temporal_tension());
-
+
checkbutton_before.set_active(waypoint_model.get_before_flag());
checkbutton_after.set_active(waypoint_model.get_after_flag());
checkbutton_tension.set_active(waypoint_model.get_tension_flag());
checkbutton_continuity.set_active(waypoint_model.get_continuity_flag());
checkbutton_bias.set_active(waypoint_model.get_bias_flag());
checkbutton_temporal_tension.set_active(waypoint_model.get_temporal_tension_flag());
-
+
updating=false;
-
+
on_change();
}