chalk

kis_tool.cpp
1/*
2 * Copyright (c) 2002, 2003 Patrick Julien <freak@codepimps.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#include <tqwidget.h>
20#include <tqstring.h>
21#include <tdeaction.h>
22#include <tqlabel.h>
23
24#include <tdelocale.h>
25#include <kdebug.h>
26
27#include "kis_tool.h"
28#include "kis_tool.moc"
29
30
31class KisTool::KisToolPrivate
32{
33public:
34 TQString uiname;
35 TQLabel * optionWidget;
36};
37
38KisTool::KisTool(const TQString & name)
39{
40 m_action = 0;
41 m_ownAction = false;
42 d = new KisToolPrivate();
43 d->uiname = name;
44 d->optionWidget = 0;
45}
46
47KisTool::~KisTool()
48{
49 if (m_ownAction) {
50 delete m_action;
51 m_action = 0;
52 }
53 delete d;
54}
55
56TQWidget* KisTool::createOptionWidget(TQWidget* parent)
57{
58
59 d->optionWidget = new TQLabel(i18n("No options for %1.").arg(d->uiname), parent);
60 d->optionWidget->setCaption(d->uiname);
61 d->optionWidget->setAlignment(TQt::AlignCenter);
62 return d->optionWidget;
63}
64
65TQWidget* KisTool::optionWidget()
66{
67 return d->optionWidget;
68}
69