karbon

vtranslate.cpp
1/* This file is part of the KDE project
2 Made by Tomislav Lukman (tomislav.lukman@ck.tel.hr)
3 Copyright (C) 2002, The Karbon Developers
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#include <tqcheckbox.h>
22#include <tqlabel.h>
23#include <tqlayout.h>
24#include <tqstring.h>
25#include <tdelocale.h>
26#include <knuminput.h>
27#include <kstdguiitem.h>
28#include <kpushbutton.h>
29
30#include "vtranslate.h"
31
32VTranslate::VTranslate( TQWidget* parent, const char* name )
33 : TQWidget( parent, name )
34{
35 setCaption( i18n( "Translate" ) );
36
37 TQVBoxLayout *mainlayout = new TQVBoxLayout(this, 7);
38 mainlayout->addSpacing(5);
39
40 TQGridLayout *inputlayout = new TQGridLayout(this, 5, 3);
41 mainlayout->addLayout(inputlayout);
42 m_labelX = new TQLabel(i18n("X:"), this);
43 inputlayout->addWidget(m_labelX, 0, 0);
44 labely = new TQLabel(i18n("Y:"), this);
45 inputlayout->addWidget(labely, 1, 0);
46 inputlayout->addColSpacing(1, 1);
47 inputlayout->addColSpacing(3, 5);
48 m_inputX = new KDoubleNumInput( this );
49 m_inputX->setRange(-10000.00, 10000.00, 1.00, false); //range is just for example - for now :-)
50 inputlayout->addWidget(m_inputX, 0, 2);
51 m_inputY = new KDoubleNumInput( this );
52 m_inputY->setRange(-10000.00, 10000.00, 1.00, false);
53 inputlayout->addWidget(m_inputY, 1, 2);
54 m_labelUnit1 = new TQLabel("", this);
55 inputlayout->addWidget(m_labelUnit1, 0, 4);
56 m_labelUnit2 = new TQLabel("", this);
57 inputlayout->addWidget(m_labelUnit2, 1, 4);
58 mainlayout->addSpacing(5);
59 m_checkBoxPosition = new TQCheckBox(i18n("Relative &position"), this);
60 mainlayout->addWidget(m_checkBoxPosition);
61 mainlayout->addSpacing(5);
62 m_buttonDuplicate = new TQPushButton(i18n("&Duplicate"), this);
63 mainlayout->addWidget(m_buttonDuplicate);
64 mainlayout->addSpacing(1);
65 m_buttonApply = new KPushButton(KStdGuiItem::apply(), this);
66 mainlayout->addWidget(m_buttonApply);
67
68 mainlayout->activate();
69
70 setFixedSize(baseSize()); //Set the size tp fixed values
71}
72
73VTranslate::~VTranslate()
74{
75}
76
77void VTranslate::setUnits( const TQString& units )
78{
79 m_labelUnit1->setText( units );
80 m_labelUnit2->setText( units );
81}
82
83#include "vtranslate.moc"
84