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"
49 /* === U S I N G =========================================================== */
53 using namespace synfig;
54 using namespace studio;
56 /* === M A C R O S ========================================================= */
58 /* === G L O B A L S ======================================================= */
60 /* === P R O C E D U R E S ================================================= */
62 /* === M E T H O D S ======================================================= */
64 Dock_Params::Dock_Params():
65 Dock_CanvasSpecific("params",_("Params"),Gtk::Stock::INDEX/*Gtk::StockID("synfig-params")*/),
66 action_group(Gtk::ActionGroup::create("action_group_dock_params"))
69 App::ui_manager()->insert_action_group(action_group_layer_ops);
71 Glib::ustring ui_info =
73 " <toolbar action='toolbar-palette'>"
74 " <toolitem action='amount-increase' />"
75 " <toolitem action='amount-decrease' />"
80 App::ui_manager()->add_ui_from_string(ui_info);
84 Dock_Params::~Dock_Params()
90 Dock_Params::init_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
92 Gtk::TreeView* tree_view(
93 static_cast<Gtk::TreeView*>(canvas_view->get_ext_widget(get_name()))
98 tree_view->get_selection()->signal_changed().connect(
101 &Dock_Params::refresh_selected_param
108 Dock_Params::refresh_selected_param()
110 Gtk::TreeView* tree_view(
111 static_cast<Gtk::TreeView*>(get_canvas_view()->get_ext_widget(get_name()))
113 Gtk::TreeModel::iterator iter(tree_view->get_selection()->get_selected());
117 LayerParamTreeStore::Model model;
118 get_canvas_view()->work_area->set_selected_value_node(
119 (synfig::ValueNode::Handle)(*iter)[model.value_node]
124 get_canvas_view()->work_area->set_selected_value_node(0);
129 Dock_Params::changed_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
133 Gtk::Widget* tree_view(canvas_view->get_ext_widget(get_name()));
139 else clear_previous();