Diffstat (limited to 'noncore/apps/opie-sheet/numberdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-sheet/numberdlg.cpp | 70 |
1 files changed, 44 insertions, 26 deletions
diff --git a/noncore/apps/opie-sheet/numberdlg.cpp b/noncore/apps/opie-sheet/numberdlg.cpp index 90fbaa2..43574e9 100644 --- a/noncore/apps/opie-sheet/numberdlg.cpp +++ b/noncore/apps/opie-sheet/numberdlg.cpp | |||
@@ -1,11 +1,30 @@ | |||
1 | /*************************************************************************** | 1 | /* |
2 | * * | 2 | =. This file is part of the Opie Project |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> |
4 | * it under the terms of the GNU General Public License as published by * | 4 | .>+-= |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | _;:, .> :=|. This program is free software; you can |
6 | * (at your option) any later version. * | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | * * | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | ***************************************************************************/ | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
10 | ._= =} : or (at your option) any later version. | ||
11 | .%`+i> _;_. | ||
12 | .i_,=:_. -<s. This program is distributed in the hope that | ||
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
14 | : .. .:, . . . without even the implied warranty of | ||
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
17 | ..}^=.= = ; Library General Public License for more | ||
18 | ++= -. .` .: details. | ||
19 | : = ...= . :.=- | ||
20 | -. .:....=;==+<; You should have received a copy of the GNU | ||
21 | -_. . . )=. = Library General Public License along with | ||
22 | -- :-=` this library; see the file COPYING.LIB. | ||
23 | If not, write to the Free Software Foundation, | ||
24 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
26 | |||
27 | */ | ||
9 | 28 | ||
10 | /* | 29 | /* |
11 | * Opie Sheet (formerly Sheet/Qt) | 30 | * Opie Sheet (formerly Sheet/Qt) |
@@ -15,36 +34,35 @@ | |||
15 | #include "numberdlg.h" | 34 | #include "numberdlg.h" |
16 | 35 | ||
17 | NumberDialog::NumberDialog(QWidget *parent) | 36 | NumberDialog::NumberDialog(QWidget *parent) |
18 | :QDialog(parent, 0, TRUE) | 37 | :QDialog(parent, 0, TRUE) |
19 | { | 38 | { |
20 | edit=new QSpinBox(this); | 39 | edit=new QSpinBox(this); |
21 | edit->setGeometry(120, 10, 70, 25); | 40 | edit->setGeometry(120, 10, 70, 25); |
22 | 41 | ||
23 | label=new QLabel(this); | 42 | label=new QLabel(this); |
24 | label->setGeometry(10, 10, 100, 25); | 43 | label->setGeometry(10, 10, 100, 25); |
25 | label->setBuddy(edit); | 44 | label->setBuddy(edit); |
26 | 45 | ||
27 | resize(200, 45); | 46 | resize(200, 45); |
28 | } | 47 | } |
29 | 48 | ||
30 | NumberDialog::~NumberDialog() | 49 | NumberDialog::~NumberDialog() |
31 | { | 50 | {} |
32 | } | ||
33 | 51 | ||
34 | int NumberDialog::exec(const QString &caption, const QString &text, | 52 | int NumberDialog::exec(const QString &caption, const QString &text, |
35 | int value, int min, int max, int step) | 53 | int value, int min, int max, int step) |
36 | { | 54 | { |
37 | setCaption(caption); | 55 | setCaption(caption); |
38 | label->setText(text); | 56 | label->setText(text); |
39 | edit->setValue(value); | 57 | edit->setValue(value); |
40 | edit->setMinValue(min); | 58 | edit->setMinValue(min); |
41 | edit->setMaxValue(max); | 59 | edit->setMaxValue(max); |
42 | edit->setLineStep(step); | 60 | edit->setLineStep(step); |
43 | 61 | ||
44 | return QDialog::exec(); | 62 | return QDialog::exec(); |
45 | } | 63 | } |
46 | 64 | ||
47 | int NumberDialog::getValue() | 65 | int NumberDialog::getValue() |
48 | { | 66 | { |
49 | return edit->value(); | 67 | return edit->value(); |
50 | } | 68 | } |