dlg_shrink_selection.cc 1.85 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/*
 *  dlg_shrink_selection.cc - part of Krita
 *
 *  Copyright (c) 2006 Michael Thaler <michael.thaler@physik.tu-muenchen.de>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

Boudewijn Rempt's avatar
Boudewijn Rempt committed
21 22
#include "dlg_shrink_selection.h"

23 24 25
#include <math.h>

#include <klocale.h>
26
#include <kis_debug.h>
Boudewijn Rempt's avatar
java--  
Boudewijn Rempt committed
27 28
DlgShrinkSelection::DlgShrinkSelection(QWidget *  parent, const char * name)
        : KDialog(parent)
29
{
Boudewijn Rempt's avatar
Boudewijn Rempt committed
30 31 32
    setCaption(i18n("Shrink Selection"));
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
Adrian Page's avatar
Adrian Page committed
33 34 35
    setObjectName(name);

    m_page = new WdgShrinkSelection(this);
36
    Q_CHECK_PTR(m_page);
Adrian Page's avatar
Adrian Page committed
37
    m_page->setObjectName("shrink_selection");
38 39 40 41 42 43 44 45 46 47 48 49

    setMainWidget(m_page);
    resize(m_page->sizeHint());

    connect(this, SIGNAL(okClicked()), this, SLOT(okClicked()));
}

DlgShrinkSelection::~DlgShrinkSelection()
{
    delete m_page;
}

Laurent Montel's avatar
Laurent Montel committed
50
qint32 DlgShrinkSelection::xradius()
51 52 53 54
{
    return m_page->radiusSpinBox->value();
}

Laurent Montel's avatar
Laurent Montel committed
55
qint32 DlgShrinkSelection::yradius()
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
{
    return m_page->radiusSpinBox->value();
}

bool DlgShrinkSelection::shrinkFromImageBorder()
{
    return m_page->shrinkFromImageBorderCheckBox->isChecked();
}


// SLOTS

void DlgShrinkSelection::okClicked()
{
    accept();
}

#include "dlg_shrink_selection.moc"