00001 /* 00002 =. This file is part of the Opie Project 00003 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> 00004 .>+-= 00005 _;:, .> :=|. This program is free software; you can 00006 .> <`_, > . <= redistribute it and/or modify it under 00007 :`=1 )Y*s>-.-- : the terms of the GNU General Public 00008 .="- .-=="i, .._ License as published by the Free Software 00009 - . .-<_> .<> Foundation; either version 2 of the License, 00010 ._= =} : or (at your option) any later version. 00011 .%`+i> _;_. 00012 .i_,=:_. -<s. This program is distributed in the hope that 00013 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 00014 : .. .:, . . . without even the implied warranty of 00015 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 00016 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 00017 ..}^=.= = ; Library General Public License for more 00018 ++= -. .` .: details. 00019 : = ...= . :.=- 00020 -. .:....=;==+<; You should have received a copy of the GNU 00021 -_. . . )=. = Library General Public License along with 00022 -- :-=` this library; see the file COPYING.LIB. 00023 If not, write to the Free Software Foundation, 00024 Inc., 59 Temple Place - Suite 330, 00025 Boston, MA 02111-1307, USA. 00026 00027 */ 00028 00029 /* 00030 * Opie Sheet (formerly Sheet/Qt) 00031 * by Serdar Ozler <sozler@sitebest.com> 00032 */ 00033 00034 #include "numberdlg.h" 00035 00036 NumberDialog::NumberDialog(QWidget *parent) 00037 :QDialog(parent, 0, TRUE) 00038 { 00039 edit=new QSpinBox(this); 00040 edit->setGeometry(120, 10, 70, 25); 00041 00042 label=new QLabel(this); 00043 label->setGeometry(10, 10, 100, 25); 00044 label->setBuddy(edit); 00045 00046 resize(200, 45); 00047 } 00048 00049 NumberDialog::~NumberDialog() 00050 {} 00051 00052 int NumberDialog::exec(const QString &caption, const QString &text, 00053 int value, int min, int max, int step) 00054 { 00055 setCaption(caption); 00056 label->setText(text); 00057 edit->setValue(value); 00058 edit->setMinValue(min); 00059 edit->setMaxValue(max); 00060 edit->setLineStep(step); 00061 00062 return QDialog::exec(); 00063 } 00064 00065 int NumberDialog::getValue() 00066 { 00067 return edit->value(); 00068 }
1.4.2