source: synfigstudio/trunk/fuentes/src/gui/docks/dialog_tooloptions.cpp @ 481

Last change on this file since 481 was 481, checked in by jrpelegrina, 4 years ago

First release to xenial

File size: 2.5 KB
Line 
1/* === S Y N F I G ========================================================= */
2/*!     \file dialog_tooloptions.cpp
3**      \brief Template File
4**
5**      $Id$
6**
7**      \legal
8**      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9**      Copyright (c) 2009 Nikita Kitaev
10**
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.
15**
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.
20**      \endlegal
21*/
22/* ========================================================================= */
23
24/* === H E A D E R S ======================================================= */
25
26#ifdef USING_PCH
27#       include "pch.h"
28#else
29#ifdef HAVE_CONFIG_H
30#       include <config.h>
31#endif
32
33#include <gtkmm/label.h>
34#include <gtkmm/scrolledwindow.h>
35#include <synfig/general.h>
36#include "docks/dialog_tooloptions.h"
37#include "general.h"
38
39#endif
40
41/* === U S I N G =========================================================== */
42
43using namespace std;
44using namespace etl;
45using namespace synfig;
46using namespace studio;
47
48/* === M A C R O S ========================================================= */
49
50/* === G L O B A L S ======================================================= */
51
52/* === P R O C E D U R E S ================================================= */
53
54/* === M E T H O D S ======================================================= */
55
56Dialog_ToolOptions::Dialog_ToolOptions():
57        Dockable("tool_options",_("Tool Options"),Gtk::StockID("synfig-about")),
58        empty_label(_("This tool has no options"))
59{
60        add(sub_vbox_);
61
62        set_widget(empty_label);
63        empty_label.show();
64}
65
66Dialog_ToolOptions::~Dialog_ToolOptions()
67{
68}
69
70void
71Dialog_ToolOptions::clear()
72{
73        Dockable::clear();
74        set_local_name(_("Tool Options"));
75        add(sub_vbox_);
76        set_widget(empty_label);
77        empty_label.show();
78
79        set_stock_id(Gtk::StockID("synfig-about"));
80}
81
82void
83Dialog_ToolOptions::set_widget(Gtk::Widget&x)
84{
85        std::vector<Gtk::Widget*> children = sub_vbox_.get_children();
86        for(std::vector<Gtk::Widget*>::iterator i = children.begin(); i != children.end(); ++i)
87                sub_vbox_.remove(**i);
88        sub_vbox_.show();
89        sub_vbox_.pack_start(x,false,false);
90        x.show();
91}
92
93void
94Dialog_ToolOptions::set_name(const synfig::String& name)
95{
96        set_stock_id(Gtk::StockID("synfig-"+name));
97}
Note: See TracBrowser for help on using the repository browser.