Now that it doesn't matter which half of a waypoint you click on, we don't need to...
[synfig.git] / synfig-studio / trunk / src / gtkmm / childrentree.cpp
index c4177a3..a7b91f4 100644 (file)
@@ -6,6 +6,7 @@
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+**     Copyright (c) 2008 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
@@ -103,7 +104,7 @@ ChildrenTree::ChildrenTree()
                column->set_resizable();
                column->set_clickable();
                column->set_min_width(150);
-               column->set_sort_column_id(model.label);
+               column->set_sort_column(model.label);
                tree_view.append_column(*column);
 
        }
@@ -115,7 +116,7 @@ ChildrenTree::ChildrenTree()
                        column->set_reorderable();
                        column->set_resizable();
                        column->set_clickable();
-                       column->set_sort_column_id(model.type);
+                       column->set_sort_column(model.type);
                }
        }
        {       // --- V A L U E  -----------------------------------------------------
@@ -141,7 +142,7 @@ ChildrenTree::ChildrenTree()
                // Set up the value-node cell-renderer
                cellrenderer_time_track=ChildrenTreeStore::add_cell_renderer_value_node(column);
                cellrenderer_time_track->property_mode()=Gtk::CELL_RENDERER_MODE_ACTIVATABLE;
-               cellrenderer_time_track->signal_waypoint_clicked().connect(sigc::mem_fun(*this, &studio::ChildrenTree::on_waypoint_clicked) );
+               cellrenderer_time_track->signal_waypoint_clicked_cellrenderer().connect(sigc::mem_fun(*this, &studio::ChildrenTree::on_waypoint_clicked_childrentree) );
                column->add_attribute(cellrenderer_time_track->property_value_desc(), model.value_desc);
                column->add_attribute(cellrenderer_time_track->property_canvas(), model.canvas);
 
@@ -175,21 +176,18 @@ ChildrenTree::ChildrenTree()
 
        attach(*hbox, 0, 1, 1, 2, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 0, 0);
 
-
-
        tree_view.set_enable_search(true);
        tree_view.set_search_column(model.label);
 
-
 /*
        Gtk::Image *icon;
        //Gtk::IconSize iconsize(Gtk::IconSize::from_name("synfig-small_icon"));
        Gtk::IconSize iconsize(Gtk::ICON_SIZE_SMALL_TOOLBAR);
 
-       SMALL_BUTTON(button_raise,"gtk-go-up","Raise");
-       SMALL_BUTTON(button_lower,"gtk-go-down","Lower");
-       SMALL_BUTTON(button_duplicate,"synfig-duplicate","Duplicate");
-       SMALL_BUTTON(button_delete,"gtk-delete","Delete");
+       SMALL_BUTTON(button_raise,"gtk-go-up",_("Raise"));
+       SMALL_BUTTON(button_lower,"gtk-go-down",_("Lower"));
+       SMALL_BUTTON(button_duplicate,"synfig-duplicate",_("Duplicate"));
+       SMALL_BUTTON(button_delete,"gtk-delete",_("Delete"));
 
        hbox->pack_start(*button_raise,Gtk::PACK_SHRINK);
        hbox->pack_start(*button_lower,Gtk::PACK_SHRINK);
@@ -207,11 +205,8 @@ ChildrenTree::ChildrenTree()
        button_delete->set_sensitive(false);
 */
 
-
-
        get_selection()->signal_changed().connect(sigc::mem_fun(*this, &studio::ChildrenTree::on_selection_changed));
 
-
        tree_view.set_reorderable(true);
 
        hbox->show();
@@ -222,7 +217,6 @@ ChildrenTree::ChildrenTree()
        //get_selection()->set_mode(Gtk::SELECTION_MULTIPLE);
 }
 
-
 ChildrenTree::~ChildrenTree()
 {
 }
@@ -265,7 +259,6 @@ ChildrenTree::on_selection_changed()
        }
 }
 
-
 void
 ChildrenTree::on_edited_value(const Glib::ustring&path_string,synfig::ValueBase value)
 {
@@ -278,13 +271,16 @@ ChildrenTree::on_edited_value(const Glib::ustring&path_string,synfig::ValueBase
 }
 
 void
-ChildrenTree::on_waypoint_clicked(const Glib::ustring &path_string, synfig::Waypoint waypoint,int button)
+ChildrenTree::on_waypoint_clicked_childrentree(const etl::handle<synfig::Node>& node __attribute__ ((unused)),
+                                                                                          const synfig::Time& time __attribute__ ((unused)),
+                                                                                          const synfig::Time& time_offset __attribute__ ((unused)),
+                                                                                          int button __attribute__ ((unused)),
+                                                                                          synfig::Waypoint::Side side __attribute__ ((unused)))
 {
-       Gtk::TreePath path(path_string);
-
-       const Gtk::TreeRow row = *(tree_view.get_model()->get_iter(path));
+       //! \todo writeme
 
-       signal_waypoint_clicked()(static_cast<synfigapp::ValueDesc>(row[model.value_desc]),waypoint,button);
+       // std::set<synfig::Waypoint, std::less<UniqueID> > waypoint_set;
+       // signal_waypoint_clicked_childrentree()(waypoint_set,button);
 }
 
 bool