1 /* === S Y N F I G ========================================================= */
2 /*! \file dock_children.cpp
3 ** \brief Template File
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 ** Copyright (c) 2007 Chris Moore
11 ** This package is free software; you can redistribute it and/or
12 ** modify it under the terms of the GNU General Public License as
13 ** published by the Free Software Foundation; either version 2 of
14 ** the License, or (at your option) any later version.
16 ** This package is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ** General Public License for more details.
22 /* ========================================================================= */
24 /* === H E A D E R S ======================================================= */
33 #include "dock_children.h"
36 #include <gtkmm/scrolledwindow.h>
39 #include <sigc++/signal.h>
40 #include <sigc++/hide.h>
41 #include <sigc++/retype_return.h>
42 #include <sigc++/slot.h>
43 #include "childrentreestore.h"
44 #include "childrentree.h"
45 #include "canvasview.h"
51 /* === U S I N G =========================================================== */
55 using namespace synfig;
56 using namespace studio;
58 /* === M A C R O S ========================================================= */
60 /* === G L O B A L S ======================================================= */
62 /* === P R O C E D U R E S ================================================= */
64 /* === M E T H O D S ======================================================= */
66 Dock_Children::Dock_Children():
67 Dock_CanvasSpecific("children",_("Children"),Gtk::StockID("synfig-children"))
69 //! \todo the combination of set_use_scrolled(false) and
70 //! add(*tree_view) causes crashes when
71 //! Dockable::prev_widget_ is left referencing a
72 //! ChildrenTree that has already been destroyed.
73 // set_use_scrolled(false);
75 add(*create_action_tree());
78 Gtk::StockID("synfig-clear_redo"),
79 _("Clear the REDO Stack")
80 )->signal_clicked().connect(
83 &Dock_Children::clear_redo
89 Dock_Children::~Dock_Children()
94 Dock_Children::init_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
96 Glib::RefPtr<ChildrenTreeStore> children_tree_store;
97 children_tree_store=ChildrenTreeStore::create(canvas_view->canvas_interface());
99 ChildrenTree* children_tree(new ChildrenTree());
100 children_tree->set_model(children_tree_store);
101 children_tree->set_time_adjustment(canvas_view->time_adjustment());
104 canvas_view->set_tree_model(get_name(),children_tree_store);
105 canvas_view->set_ext_widget(get_name(),children_tree);
109 Dock_Children::changed_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
113 Gtk::Widget* tree_view(canvas_view->get_ext_widget(get_name()));
118 else clear_previous();