1 /* === S Y N F I G ========================================================= */
2 /*! \file dock_params.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_params.h"
35 #include <gtkmm/scrolledwindow.h>
38 #include <sigc++/signal.h>
39 #include <sigc++/hide.h>
40 #include <sigc++/slot.h>
41 #include "canvasview.h"
42 #include "layerparamtreestore.h"
47 /* === U S I N G =========================================================== */
51 using namespace synfig;
52 using namespace studio;
54 /* === M A C R O S ========================================================= */
56 /* === G L O B A L S ======================================================= */
58 /* === P R O C E D U R E S ================================================= */
60 /* === M E T H O D S ======================================================= */
62 Dock_Params::Dock_Params():
63 Dock_CanvasSpecific("params",_("Params"),Gtk::Stock::INDEX/*Gtk::StockID("synfig-params")*/),
64 action_group(Gtk::ActionGroup::create())
67 App::ui_manager()->insert_action_group(action_group_layer_ops);
69 Glib::ustring ui_info =
71 " <toolbar action='toolbar-palette'>"
72 " <toolitem action='amount-increase' />"
73 " <toolitem action='amount-decrease' />"
78 App::ui_manager()->add_ui_from_string(ui_info);
82 Dock_Params::~Dock_Params()
88 Dock_Params::init_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
91 Gtk::TreeView* tree_view(
92 static_cast<Gtk::TreeView*>(canvas_view->get_ext_widget(get_name()))
97 tree_view->get_selection()->signal_changed().connect(
100 &Dock_Params::refresh_selected_param
107 Dock_Params::refresh_selected_param()
109 Gtk::TreeView* tree_view(
110 static_cast<Gtk::TreeView*>(get_canvas_view()->get_ext_widget(get_name()))
112 Gtk::TreeModel::iterator iter(tree_view->get_selection()->get_selected());
116 LayerParamTreeStore::Model model;
117 get_canvas_view()->work_area->set_selected_value_node(
118 (synfig::ValueNode::Handle)(*iter)[model.value_node]
123 get_canvas_view()->work_area->set_selected_value_node(0);
128 Dock_Params::changed_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
132 Gtk::Widget* tree_view(canvas_view->get_ext_widget(get_name()));
138 else clear_previous();