karbon

vtranslate.cc

00001 /* This file is part of the KDE project
00002    Made by Tomislav Lukman (tomislav.lukman@ck.tel.hr)
00003    Copyright (C) 2002, The Karbon Developers
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #include <qcheckbox.h>
00022 #include <qlabel.h>
00023 #include <qlayout.h>
00024 #include <qstring.h>
00025 #include <klocale.h>
00026 #include <knuminput.h>
00027 #include <kstdguiitem.h>
00028 #include <kpushbutton.h>
00029 
00030 #include "vtranslate.h"
00031 
00032 VTranslate::VTranslate( QWidget* parent, const char* name )
00033     : QWidget( parent, name )
00034 {
00035     setCaption( i18n( "Translate" ) );
00036 
00037     QVBoxLayout *mainlayout = new QVBoxLayout(this, 7);
00038     mainlayout->addSpacing(5);
00039 
00040     QGridLayout *inputlayout = new QGridLayout(this, 5, 3);
00041     mainlayout->addLayout(inputlayout);
00042     m_labelX = new QLabel(i18n("X:"), this);
00043     inputlayout->addWidget(m_labelX, 0, 0);
00044     labely = new QLabel(i18n("Y:"), this);
00045     inputlayout->addWidget(labely, 1, 0);
00046     inputlayout->addColSpacing(1, 1);
00047     inputlayout->addColSpacing(3, 5);
00048     m_inputX = new KDoubleNumInput( this );
00049     m_inputX->setRange(-10000.00, 10000.00, 1.00, false); //range is just for example - for now :-)
00050     inputlayout->addWidget(m_inputX, 0, 2);
00051     m_inputY = new KDoubleNumInput( this );
00052     m_inputY->setRange(-10000.00, 10000.00, 1.00, false);
00053     inputlayout->addWidget(m_inputY, 1, 2);
00054     m_labelUnit1 = new QLabel("", this);
00055     inputlayout->addWidget(m_labelUnit1, 0, 4);
00056     m_labelUnit2 = new QLabel("", this);
00057     inputlayout->addWidget(m_labelUnit2, 1, 4);
00058     mainlayout->addSpacing(5);
00059     m_checkBoxPosition = new QCheckBox(i18n("Relative &position"), this);
00060     mainlayout->addWidget(m_checkBoxPosition);
00061     mainlayout->addSpacing(5);
00062     m_buttonDuplicate = new QPushButton(i18n("&Duplicate"), this);
00063     mainlayout->addWidget(m_buttonDuplicate);
00064     mainlayout->addSpacing(1);
00065     m_buttonApply = new KPushButton(KStdGuiItem::apply(), this);
00066     mainlayout->addWidget(m_buttonApply);
00067 
00068     mainlayout->activate();
00069 
00070     setFixedSize(baseSize()); //Set the size tp fixed values
00071 }
00072 
00073 VTranslate::~VTranslate()
00074 {
00075 }
00076 
00077 void VTranslate::setUnits( const QString& units )
00078 {
00079     m_labelUnit1->setText( units );
00080     m_labelUnit2->setText( units );
00081 }
00082 
00083 #include "vtranslate.moc"
00084 
KDE Home | KDE Accessibility Home | Description of Access Keys