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
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === H E A D E R S ======================================================= */
32 #include "dock_children.h"
35 #include <gtkmm/scrolledwindow.h>
38 #include <sigc++/signal.h>
39 #include <sigc++/hide.h>
40 #include <sigc++/retype_return.h>
41 #include <sigc++/slot.h>
42 #include "childrentreestore.h"
43 #include "childrentree.h"
44 #include "canvasview.h"
50 /* === U S I N G =========================================================== */
54 using namespace synfig;
55 using namespace studio;
57 /* === M A C R O S ========================================================= */
59 /* === G L O B A L S ======================================================= */
61 /* === P R O C E D U R E S ================================================= */
63 /* === M E T H O D S ======================================================= */
65 Dock_Children::Dock_Children():
66 Dock_CanvasSpecific("children",_("Children"),Gtk::StockID("synfig-children"))
68 //! \todo the combination of set_use_scrolled(false) and
69 //! add(*tree_view) causes crashes when
70 //! Dockable::prev_widget_ is left referencing a
71 //! ChildrenTree that has already been destroyed.
72 // set_use_scrolled(false);
74 add(*create_action_tree());
77 Gtk::StockID("synfig-clear_redo"),
78 _("Clear the REDO Stack")
79 )->signal_clicked().connect(
82 &Dock_Children::clear_redo
88 Dock_Children::~Dock_Children()
93 Dock_Children::init_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
95 Glib::RefPtr<ChildrenTreeStore> children_tree_store;
96 children_tree_store=ChildrenTreeStore::create(canvas_view->canvas_interface());
98 ChildrenTree* children_tree(new ChildrenTree());
99 children_tree->set_model(children_tree_store);
100 children_tree->set_time_adjustment(canvas_view->time_adjustment());
103 canvas_view->set_tree_model(get_name(),children_tree_store);
104 canvas_view->set_ext_widget(get_name(),children_tree);
108 Dock_Children::changed_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
112 Gtk::Widget* tree_view(canvas_view->get_ext_widget(get_name()));
117 else clear_previous();