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"
48 /* === U S I N G =========================================================== */
52 using namespace synfig;
53 using namespace studio;
55 /* === M A C R O S ========================================================= */
57 /* === G L O B A L S ======================================================= */
59 /* === P R O C E D U R E S ================================================= */
61 /* === M E T H O D S ======================================================= */
63 Dock_Children::Dock_Children():
64 Dock_CanvasSpecific("children",_("Children"),Gtk::StockID("synfig-children"))
66 set_use_scrolled(false);
68 add(*create_action_tree());
71 Gtk::StockID("synfig-clear_redo"),
72 _("Clear the REDO Stack")
73 )->signal_clicked().connect(
76 &Dock_Children::clear_redo
82 Dock_Children::~Dock_Children()
87 Dock_Children::init_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
89 Glib::RefPtr<ChildrenTreeStore> children_tree_store;
90 children_tree_store=ChildrenTreeStore::create(canvas_view->canvas_interface());
92 ChildrenTree* children_tree(new ChildrenTree());
93 children_tree->set_model(children_tree_store);
94 children_tree->set_time_adjustment(canvas_view->time_adjustment());
97 canvas_view->set_tree_model(get_name(),children_tree_store);
98 canvas_view->set_ext_widget(get_name(),children_tree);
102 Dock_Children::changed_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
106 Gtk::Widget* tree_view(canvas_view->get_ext_widget(get_name()));
111 else clear_previous();