You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
2.3 KiB
84 lines
2.3 KiB
15 years ago
|
/*
|
||
|
KDE Draw - a small graphics drawing program for the KDE
|
||
|
Copyright (C) 1998 Thomas Tanghus (tanghus@kde.org)
|
||
|
Copyright (C) 2002 Nadeem Hasan ( nhasan@kde.org )
|
||
|
|
||
|
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 Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
15 years ago
|
#include <tqlabel.h>
|
||
13 years ago
|
#include <tqlayout.h>
|
||
15 years ago
|
#include <tqgroupbox.h>
|
||
15 years ago
|
|
||
12 years ago
|
#include <tdelocale.h>
|
||
15 years ago
|
#include <knuminput.h>
|
||
|
|
||
|
#include "kresize.h"
|
||
|
|
||
14 years ago
|
KResizeWidget::KResizeWidget( TQWidget* parent, const char* name,
|
||
|
const TQSize& size ) : TQWidget( parent, name )
|
||
15 years ago
|
{
|
||
15 years ago
|
TQHBoxLayout* genLayout = new TQHBoxLayout( this );
|
||
15 years ago
|
|
||
15 years ago
|
TQGroupBox* group = new TQGroupBox( i18n( "Size" ), this );
|
||
15 years ago
|
group->setColumnLayout( 0, Qt::Horizontal );
|
||
|
genLayout->addWidget( group );
|
||
|
|
||
13 years ago
|
TQHBoxLayout* layout = new TQHBoxLayout( group->layout(), 6 );
|
||
15 years ago
|
|
||
|
m_width = new KIntSpinBox( 1, 200, 1, 1, 10, group );
|
||
|
m_width->setValue( size.width() );
|
||
13 years ago
|
layout->addWidget( m_width, 1 );
|
||
15 years ago
|
|
||
15 years ago
|
TQLabel* label = new TQLabel( "X", group );
|
||
13 years ago
|
layout->addWidget( label );
|
||
15 years ago
|
|
||
|
m_height = new KIntSpinBox( 1, 200, 1, 1, 10, group);
|
||
|
m_height->setValue( size.height() );
|
||
13 years ago
|
layout->addWidget( m_height, 1 );
|
||
15 years ago
|
|
||
|
setMinimumSize( 200, 100 );
|
||
|
}
|
||
|
|
||
|
KResizeWidget::~KResizeWidget()
|
||
|
{
|
||
|
}
|
||
|
|
||
15 years ago
|
const TQSize KResizeWidget::getSize()
|
||
15 years ago
|
{
|
||
15 years ago
|
return TQSize( m_width->value(), m_height->value() );
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
KResizeDialog::KResizeDialog( TQWidget* parent, const char* name,
|
||
15 years ago
|
const TQSize size )
|
||
14 years ago
|
: KDialogBase( parent, name, true, i18n( "Select Size" ), Ok|Cancel )
|
||
15 years ago
|
{
|
||
|
m_resize = new KResizeWidget( this, "resize widget", size );
|
||
|
|
||
|
setMainWidget( m_resize );
|
||
|
}
|
||
|
|
||
|
KResizeDialog::~KResizeDialog()
|
||
|
{
|
||
|
}
|
||
|
|
||
15 years ago
|
const TQSize KResizeDialog::getSize()
|
||
15 years ago
|
{
|
||
|
return m_resize->getSize();
|
||
|
}
|
||
|
|
||
|
#include "kresize.moc"
|