X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fwidget_waypointmodel.cpp;h=28dacd54cc7bc48d6834ff4cae59c96a7c0e0984;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=20584f10f8bab2c493dbb2b06c7d72e08ffbfbf0;hpb=3a3c4bca3a17137bec5d7960560934b91ef4146e;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/widget_waypointmodel.cpp b/synfig-studio/trunk/src/gtkmm/widget_waypointmodel.cpp index 20584f1..28dacd5 100644 --- a/synfig-studio/trunk/src/gtkmm/widget_waypointmodel.cpp +++ b/synfig-studio/trunk/src/gtkmm/widget_waypointmodel.cpp @@ -1,20 +1,22 @@ -/* === 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 */ /* ========================================================================= */ @@ -37,9 +39,11 @@ #include #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; @@ -66,18 +70,18 @@ Widget_WaypointModel::Widget_WaypointModel(): 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(); @@ -102,7 +106,7 @@ Widget_WaypointModel::Widget_WaypointModel(): 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)); @@ -110,19 +114,19 @@ Widget_WaypointModel::Widget_WaypointModel(): 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(); @@ -136,7 +140,7 @@ Widget_WaypointModel::on_change() { if(updating) return; - + waypoint_model.set_before((Waypoint::Interpolation)before->get_history()); waypoint_model.set_after((Waypoint::Interpolation)after->get_history()); @@ -151,7 +155,7 @@ Widget_WaypointModel::on_change() 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()); @@ -161,11 +165,11 @@ Widget_WaypointModel::on_change() } 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()); @@ -173,15 +177,15 @@ Widget_WaypointModel::set_waypoint_model(sinfg::Waypoint::Model &x) 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(); }