krita

kis_tool_shape.cc

00001 /*
00002  *  Copyright (c) 2005 Adrian Page
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 #include <qwidget.h>
00020 #include <qlayout.h>
00021 #include <qcombobox.h>
00022 #include <qlabel.h>
00023 
00024 #include <kdebug.h>
00025 #include <klocale.h>
00026 
00027 #include "kis_tool_shape.h"
00028 #include "wdgshapeoptions.h"
00029 
00030 KisToolShape::KisToolShape(const QString& UIName) : super(UIName)
00031 {
00032     m_shapeOptionsWidget = 0;
00033     m_optionLayout = 0;
00034 }
00035 
00036 KisToolShape::~KisToolShape()
00037 {
00038 }
00039 
00040 QWidget* KisToolShape::createOptionWidget(QWidget* parent)
00041 {
00042     QWidget *widget = super::createOptionWidget(parent);
00043 
00044     m_shapeOptionsWidget = new WdgGeometryOptions(0);
00045     Q_CHECK_PTR(m_shapeOptionsWidget);
00046 
00047     m_optionLayout = new QGridLayout(widget, 2, 1);
00048    // super::addOptionWidgetLayout(m_optionLayout);
00049 
00050     m_shapeOptionsWidget->cmbFill->reparent(widget, QPoint(0,0), true);
00051     m_shapeOptionsWidget->textLabel3->reparent(widget, QPoint(0,0), true);
00052     addOptionWidgetOption(m_shapeOptionsWidget->cmbFill, m_shapeOptionsWidget->textLabel3);
00053 
00054     return widget;
00055 }
00056 
00057 KisPainter::FillStyle KisToolShape::fillStyle(void)
00058 {
00059     if (m_shapeOptionsWidget) {
00060         return static_cast<KisPainter::FillStyle>(m_shapeOptionsWidget->cmbFill->currentItem());
00061     } else {
00062         return KisPainter::FillStyleNone;
00063     }
00064 }
00065 
00066 #include "kis_tool_shape.moc"
00067 
KDE Home | KDE Accessibility Home | Description of Access Keys