grab stable branch
[synfig.git] / synfig-studio / tags / stable / src / gtkmm / dialog_tooloptions.cpp
1 /* === S I N F G =========================================================== */
2 /*!     \file dialog_tooloptions.cpp
3 **      \brief Template File
4 **
5 **      $Id: dialog_tooloptions.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
6 **
7 **      \legal
8 **      Copyright (c) 2002 Robert B. Quattlebaum Jr.
9 **
10 **      This software and associated documentation
11 **      are CONFIDENTIAL and PROPRIETARY property of
12 **      the above-mentioned copyright holder.
13 **
14 **      You may not copy, print, publish, or in any
15 **      other way distribute this software without
16 **      a prior written agreement with
17 **      the copyright holder.
18 **      \endlegal
19 */
20 /* ========================================================================= */
21
22 /* === H E A D E R S ======================================================= */
23
24 #ifdef USING_PCH
25 #       include "pch.h"
26 #else
27 #ifdef HAVE_CONFIG_H
28 #       include <config.h>
29 #endif
30
31 #include <gtkmm/label.h>
32 #include <gtkmm/scrolledwindow.h>
33 #include <sinfg/general.h>
34 #include "dialog_tooloptions.h"
35 #endif
36
37 /* === U S I N G =========================================================== */
38
39 using namespace std;
40 using namespace etl;
41 using namespace sinfg;
42 using namespace studio;
43
44 /* === M A C R O S ========================================================= */
45
46 /* === G L O B A L S ======================================================= */
47
48 /* === P R O C E D U R E S ================================================= */
49
50 /* === M E T H O D S ======================================================= */
51
52 Dialog_ToolOptions::Dialog_ToolOptions():
53         Dockable("tool_options",_("Tool Options"),Gtk::StockID("sinfg-normal")),
54         empty_label(_("This tool has no options"))
55 {
56         //scrolled_.add(sub_vbox_);
57         //scrolled_.set_policy(Gtk::POLICY_AUTOMATIC,Gtk::POLICY_AUTOMATIC);
58         //scrolled_.show();     
59         //get_vbox()->pack_start(scrolled_);
60
61         add(sub_vbox_);
62         
63         set_widget(empty_label);
64         empty_label.show();
65 }
66
67 Dialog_ToolOptions::~Dialog_ToolOptions()
68 {
69 }
70
71 void
72 Dialog_ToolOptions::clear()
73 {
74         Dockable::clear();
75         set_local_name(_("Tool Options"));
76         add(sub_vbox_);
77         set_widget(empty_label);
78         empty_label.show();
79
80         set_stock_id(Gtk::StockID("sinfg-normal"));
81 }
82
83 void
84 Dialog_ToolOptions::set_widget(Gtk::Widget&x)
85 {
86         if(!sub_vbox_.children().empty())
87                 sub_vbox_.children().clear();
88
89         sub_vbox_.show();
90         sub_vbox_.pack_start(x,false,false);
91         x.show();
92 }
93
94 void
95 Dialog_ToolOptions::set_name(const sinfg::String& name)
96 {
97         set_stock_id(Gtk::StockID("sinfg-"+name));
98 }