Diffstat (limited to 'noncore/graphics/drawpad/pageinformationdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/pageinformationdialog.cpp | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/noncore/graphics/drawpad/pageinformationdialog.cpp b/noncore/graphics/drawpad/pageinformationdialog.cpp new file mode 100644 index 0000000..54cf89d --- a/dev/null +++ b/noncore/graphics/drawpad/pageinformationdialog.cpp | |||
@@ -0,0 +1,70 @@ | |||
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 "pageinformationdialog.h" | ||
15 | |||
16 | #include "page.h" | ||
17 | |||
18 | #include <qgroupbox.h> | ||
19 | #include <qlabel.h> | ||
20 | #include <qlayout.h> | ||
21 | #include <qlineedit.h> | ||
22 | |||
23 | PageInformationDialog::PageInformationDialog(Page* page, QWidget* parent, const char* name) | ||
24 | : QDialog(parent, name, true) | ||
25 | { | ||
26 | m_pPage = page; | ||
27 | |||
28 | setCaption(tr("Page Information")); | ||
29 | |||
30 | QGroupBox* generalGroupBox = new QGroupBox(0, Qt::Vertical, tr("General"), this); | ||
31 | |||
32 | QLabel* titleLabel = new QLabel(tr("Title:"), generalGroupBox); | ||
33 | m_pTitleLineEdit = new QLineEdit(generalGroupBox); | ||
34 | |||
35 | QGroupBox* sizeGroupBox = new QGroupBox(0, Qt::Vertical, tr("Size"), this); | ||
36 | |||
37 | QLabel* widthLabel = new QLabel(tr("Width:"), sizeGroupBox); | ||
38 | QLabel* widthValueLabel = new QLabel(QString::number(m_pPage->width()), sizeGroupBox); | ||
39 | |||
40 | QLabel* heightLabel = new QLabel(tr("Height:"), sizeGroupBox); | ||
41 | QLabel* heightValueLabel = new QLabel(QString::number(m_pPage->height()), sizeGroupBox); | ||
42 | |||
43 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); | ||
44 | generalGroupBox->layout()->setSpacing(4); | ||
45 | sizeGroupBox->layout()->setSpacing(4); | ||
46 | QGridLayout* generalLayout = new QGridLayout(generalGroupBox->layout(), 1, 1); | ||
47 | QGridLayout* sizeLayout = new QGridLayout(sizeGroupBox->layout(), 2, 2); | ||
48 | |||
49 | generalLayout->addWidget(titleLabel, 0, 0); | ||
50 | generalLayout->addWidget(m_pTitleLineEdit, 0, 1); | ||
51 | |||
52 | sizeLayout->addWidget(widthLabel, 0, 0); | ||
53 | sizeLayout->addWidget(widthValueLabel, 0, 1); | ||
54 | sizeLayout->addWidget(heightLabel, 1, 0); | ||
55 | sizeLayout->addWidget(heightValueLabel, 1, 1); | ||
56 | |||
57 | sizeLayout->setColStretch(1, 1); | ||
58 | |||
59 | mainLayout->addWidget(generalGroupBox); | ||
60 | mainLayout->addWidget(sizeGroupBox); | ||
61 | } | ||
62 | |||
63 | PageInformationDialog::~PageInformationDialog() | ||
64 | { | ||
65 | } | ||
66 | |||
67 | QString PageInformationDialog::selectedTitle() | ||
68 | { | ||
69 | return (m_pTitleLineEdit->text()); | ||
70 | } | ||