summaryrefslogtreecommitdiff
path: root/noncore/graphics/drawpad/newpagedialog.cpp
Unidiff
Diffstat (limited to 'noncore/graphics/drawpad/newpagedialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/drawpad/newpagedialog.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/noncore/graphics/drawpad/newpagedialog.cpp b/noncore/graphics/drawpad/newpagedialog.cpp
new file mode 100644
index 0000000..c11d977
--- a/dev/null
+++ b/noncore/graphics/drawpad/newpagedialog.cpp
@@ -0,0 +1,61 @@
1/***************************************************************************
2 * *
3 * DrawPad - a drawing program for Opie Environment *
4 * *
5 * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> *
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 ***************************************************************************/
13
14#include "newpagedialog.h"
15
16#include <qlabel.h>
17#include <qlayout.h>
18#include <qspinbox.h>
19
20NewPageDialog::NewPageDialog(QWidget* parent, const char* name)
21 : QDialog(parent, name, true)
22{
23 setCaption(tr("New Page"));
24
25 QLabel* widthLabel = new QLabel(tr("Width :"), this);
26 QLabel* heightLabel = new QLabel(tr("Height :"), this);
27
28 m_pWidthSpinBox = new QSpinBox(1, 1024, 1, this);
29 m_pHeightSpinBox = new QSpinBox(1, 1024, 1, this);
30
31 QGridLayout* gridLayout = new QGridLayout(this, 2, 2, 2, 2);
32
33 gridLayout->addWidget(widthLabel, 0, 0);
34 gridLayout->addWidget(heightLabel, 1, 0);
35 gridLayout->addWidget(m_pWidthSpinBox, 0, 1);
36 gridLayout->addWidget(m_pHeightSpinBox, 1, 1);
37}
38
39NewPageDialog::~NewPageDialog()
40{
41}
42
43void NewPageDialog::setWidth(int width)
44{
45 m_pWidthSpinBox->setValue(width);
46}
47
48void NewPageDialog::setHeight(int height)
49{
50 m_pHeightSpinBox->setValue(height);
51}
52
53int NewPageDialog::width()
54{
55 return m_pWidthSpinBox->value();
56}
57
58int NewPageDialog::height()
59{
60 return m_pHeightSpinBox->value();
61}