chalk

kis_tool_shape.cpp
1/*
2 * Copyright (c) 2005 Adrian Page
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 <tqlayout.h>
21#include <tqcombobox.h>
22#include <tqlabel.h>
23
24#include <kdebug.h>
25#include <tdelocale.h>
26
27#include "kis_tool_shape.h"
28#include "wdgshapeoptions.h"
29
30KisToolShape::KisToolShape(const TQString& UIName) : super(UIName)
31{
32 m_shapeOptionsWidget = 0;
33 m_optionLayout = 0;
34}
35
36KisToolShape::~KisToolShape()
37{
38}
39
40TQWidget* KisToolShape::createOptionWidget(TQWidget* parent)
41{
42 TQWidget *widget = super::createOptionWidget(parent);
43
44 m_shapeOptionsWidget = new WdgGeometryOptions(0);
45 TQ_CHECK_PTR(m_shapeOptionsWidget);
46
47 m_optionLayout = new TQGridLayout(widget, 2, 1);
48 // super::addOptionWidgetLayout(m_optionLayout);
49
50 m_shapeOptionsWidget->cmbFill->reparent(widget, TQPoint(0,0), true);
51 m_shapeOptionsWidget->textLabel3->reparent(widget, TQPoint(0,0), true);
52 addOptionWidgetOption(m_shapeOptionsWidget->cmbFill, m_shapeOptionsWidget->textLabel3);
53
54 return widget;
55}
56
57KisPainter::FillStyle KisToolShape::fillStyle(void)
58{
59 if (m_shapeOptionsWidget) {
60 return static_cast<KisPainter::FillStyle>(m_shapeOptionsWidget->cmbFill->currentItem());
61 } else {
62 return KisPainter::FillStyleNone;
63 }
64}
65
66#include "kis_tool_shape.moc"
67
FillStyle
This enum contains the styles with which we can fill things like polygons and ellipses.