X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Flayergrouptree.cpp;h=3dd323e579e2b66ee5d619d66c2b5a1ceeaf5d53;hb=756c0d29ac1742f231e6615f9a577e574e35a4af;hp=8ae13b62c8e8e007687b9d28c9a2648e4b5ecbf3;hpb=02252941b29de64037116f4d37991a38d9ff0d94;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/layergrouptree.cpp b/synfig-studio/trunk/src/gtkmm/layergrouptree.cpp index 8ae13b6..3dd323e 100644 --- a/synfig-studio/trunk/src/gtkmm/layergrouptree.cpp +++ b/synfig-studio/trunk/src/gtkmm/layergrouptree.cpp @@ -2,19 +2,21 @@ /*! \file layergrouptree.cpp ** \brief Template File ** -** $Id: layergrouptree.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $ +** $Id$ ** ** \legal -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2008 Chris Moore ** -** 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 */ /* ========================================================================= */ @@ -33,6 +35,8 @@ #include #include +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -54,7 +58,7 @@ LayerGroupTree::LayerGroupTree() { const LayerGroupTreeStore::Model model; - + { // --- O N / O F F ---------------------------------------------------- int index; index=append_column_editable(_(" "),model.active); @@ -71,13 +75,13 @@ LayerGroupTree::LayerGroupTree() index=append_column_editable(_("Name"),model.label); label_column = get_column(index-1); - //column->set_sort_column_id(layer_model.index); + //column->set_sort_column(layer_model.index); //set_expander_column(*column); //column->set_reorderable(); //column->set_resizable(); //column->set_clickable(false); - + //Gtk::CellRendererPixbuf* icon_cellrenderer = Gtk::manage( new Gtk::CellRendererPixbuf() ); //column->pack_start(*icon_cellrenderer,false); //column->add_attribute(icon_cellrenderer->property_pixbuf(), layer_model.icon); @@ -89,7 +93,7 @@ LayerGroupTree::LayerGroupTree() // This makes things easier to read. set_rules_hint(); - + // Make us more sensitive to several events add_events(Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::BUTTON1_MOTION_MASK | Gdk::BUTTON2_MOTION_MASK|Gdk::POINTER_MOTION_MASK); @@ -107,7 +111,8 @@ LayerGroupTree::LayerGroupTree() LayerGroupTree::~LayerGroupTree() { - synfig::info("LayerGroupTree::~LayerGroupTree(): deleted"); + if (getenv("SYNFIG_DEBUG_DESTRUCTORS")) + synfig::info("LayerGroupTree::~LayerGroupTree(): Deleted"); } void @@ -115,13 +120,13 @@ LayerGroupTree::set_model(Glib::RefPtr layer_group_tree_sto { layer_group_tree_store_=layer_group_tree_store; LayerGroupTreeStore::Model model; - + #if 0 { Glib::RefPtr sorted_store(Gtk::TreeModelSort::create(layer_group_tree_store_)); sorted_store->set_default_sort_func(sigc::ptr_fun(&studio::LayerGroupTreeStore::time_sorter)); sorted_store->set_sort_func(model.time.index(),sigc::ptr_fun(&studio::LayerGroupTreeStore::time_sorter)); - sorted_store->set_sort_column_id(model.time.index(), Gtk::SORT_ASCENDING); + sorted_store->set_sort_column(model.time.index(), Gtk::SORT_ASCENDING); Gtk::TreeView::set_model(sorted_store); } #else @@ -133,7 +138,7 @@ void LayerGroupTree::set_editable(bool x) { editable_=x; -/* +/* if(editable_) { cell_renderer_time->property_editable()=true; @@ -153,9 +158,9 @@ void LayerGroupTree::on_edited_time(const Glib::ustring&path_string,synfig::Time time) { Gtk::TreePath path(path_string); - + const Gtk::TreeRow row(*(get_model()->get_iter(path))); - + synfig::Keyframe keyframe(row[model.keyframe]); if(time!=keyframe.get_time()) { @@ -170,9 +175,9 @@ void LayerGroupTree::on_edited_time_delta(const Glib::ustring&path_string,synfig::Time time) { Gtk::TreePath path(path_string); - + const Gtk::TreeRow row(*(get_model()->get_iter(path))); - + if(row)row[model.time_delta]=time; } @@ -180,9 +185,9 @@ void LayerGroupTree::on_edited_description(const Glib::ustring&path_string,const Glib::ustring &desc) { Gtk::TreePath path(path_string); - + const Gtk::TreeRow row = *(get_model()->get_iter(path)); - + const synfig::String description(desc); synfig::Keyframe keyframe(row[model.keyframe]); if(description!=keyframe.get_description()) @@ -221,7 +226,7 @@ LayerGroupTree::on_event(GdkEvent *event) signal_popup_layer_menu()((Layer::Handle)row[model.layer]); return true; } - + /*signal_user_click()(event->button.button,row,(ColumnID)column->get_sort_column_id()); if((ColumnID)column->get_sort_column_id()==COLUMNID_JUMP) { @@ -242,7 +247,7 @@ LayerGroupTree::on_event(GdkEvent *event) ) ) break; const Gtk::TreeRow row = *(get_model()->get_iter(path)); - + LayerList layer_list(row[model.all_layers]); if(!layer_list.empty()) {