Avoid the "deprecated or antiquated header" warning from g++ 4.3 by using <tr1/unorde...
[synfig.git] / synfig-studio / trunk / src / gtkmm / state_bline.cpp
index f646022..6aa1072 100644 (file)
@@ -6,6 +6,7 @@
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+**     Copyright (c) 2007 Chris Moore
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
@@ -50,6 +51,8 @@
 #include <synfig/transform.h>
 #include <synfigapp/main.h>
 
+#include "general.h"
+
 #endif
 
 /* === U S I N G =========================================================== */
@@ -302,7 +305,10 @@ StateBLine_Context::increment_id()
        if(id[id.size()-1]<='9' && id[id.size()-1]>='0')
        {
                // figure out how many digits it is
-               for(digits=0;(int)id.size()-1>=digits && id[id.size()-1-digits]<='9' && id[id.size()-1-digits]>='0';digits++)while(false);
+               for (digits = 0;
+                        (int)id.size()-1 >= digits && id[id.size()-1-digits] <= '9' && id[id.size()-1-digits] >= '0';
+                        digits++)
+                       ;
 
                String str_number;
                str_number=String(id,id.size()-digits,id.size());
@@ -879,8 +885,9 @@ StateBLine_Context::event_mouse_click_handler(const Smach::event& x)
                        return Smach::RESULT_ACCEPT;
                }
 
-       case BUTTON_RIGHT: // Intercept the right-button click to short-circut the pop-up menu
-               return Smach::RESULT_ACCEPT;
+       case BUTTON_RIGHT: // Intercept the right-button click to short-circuit the pop-up menu
+               if (!getenv("SYNFIG_ENABLE_POPUP_MENU_IN_ALL_TOOLS"))
+                       return Smach::RESULT_ACCEPT;
 
        default:
                return Smach::RESULT_OK;
@@ -1150,16 +1157,16 @@ StateBLine_Context::popup_vertex_menu(synfig::ValueNode_Const::Handle value_node
 
        if(loop_)
        {
-               menu.items().push_back(Gtk::Menu_Helpers::MenuElem("Unloop BLine",
+               menu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Unloop BLine"),
                                sigc::mem_fun(*this,&studio::StateBLine_Context::unloop_bline)
                ));
        } else {
-               menu.items().push_back(Gtk::Menu_Helpers::MenuElem("Loop BLine",
+               menu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Loop BLine"),
                                sigc::mem_fun(*this,&studio::StateBLine_Context::loop_bline)
                ));
        }
 
-       menu.items().push_back(Gtk::Menu_Helpers::MenuElem("Delete Vertex",
+       menu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Delete Vertex"),
                sigc::bind(
                        sigc::mem_fun(*this,&studio::StateBLine_Context::bline_delete_vertex),
                        value_node
@@ -1174,7 +1181,7 @@ StateBLine_Context::popup_bezier_menu(float location, synfig::ValueNode_Const::H
 {
        menu.items().clear();
 
-       menu.items().push_back(Gtk::Menu_Helpers::MenuElem("Insert Vertex",
+       menu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Insert Vertex"),
                sigc::bind(
                        sigc::bind(
                                sigc::mem_fun(*this,&studio::StateBLine_Context::bline_insert_vertex),
@@ -1243,7 +1250,7 @@ StateBLine_Context::bline_insert_vertex(synfig::ValueNode_Const::Handle value_no
 
        if(iter==bline_point_list.end())
        {
-               get_canvas_view()->get_ui_interface()->error("Unable to find where to insert vertex, internal error, please report this bug");
+               get_canvas_view()->get_ui_interface()->error(_("Unable to find where to insert vertex, internal error, please report this bug"));
        }
 
        refresh_ducks(false);
@@ -1262,7 +1269,7 @@ StateBLine_Context::bline_delete_vertex(synfig::ValueNode_Const::Handle value_no
                }
        if(iter==bline_point_list.end())
        {
-               get_canvas_view()->get_ui_interface()->error("Unable to remove vertex, internal error, please report this bug");
+               get_canvas_view()->get_ui_interface()->error(_("Unable to remove vertex, internal error, please report this bug"));
        }
 
        refresh_ducks(false);
@@ -1276,14 +1283,14 @@ StateBLine_Context::popup_handle_menu(synfig::ValueNode_Const::Handle value_node
        BLinePoint bline_point(value_node->get_value().get(BLinePoint()));
 
        if(bline_point.get_split_tangent_flag())
-               menu.items().push_back(Gtk::Menu_Helpers::MenuElem("Merge Tangents",
+               menu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Merge Tangents"),
                        sigc::bind(
                                sigc::mem_fun(*this,&studio::StateBLine_Context::bline_attach_handle),
                                value_node
                        )
                ));
        else
-               menu.items().push_back(Gtk::Menu_Helpers::MenuElem("Split Tangents",
+               menu.items().push_back(Gtk::Menu_Helpers::MenuElem(_("Split Tangents"),
                        sigc::bind(
                                sigc::mem_fun(*this,&studio::StateBLine_Context::bline_detach_handle),
                                value_node