author | leseb <leseb> | 2002-06-13 16:43:16 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-06-13 16:43:16 (UTC) |
commit | 54de91b66a2f0f985ff89503e919f85713d1f22c (patch) (unidiff) | |
tree | 55df26ca5f08584beb4e033a1fee4510a8e2d45c | |
parent | 6a178f4ad2c3a9b92224c3506165cf03df41202e (diff) | |
download | opie-54de91b66a2f0f985ff89503e919f85713d1f22c.zip opie-54de91b66a2f0f985ff89503e919f85713d1f22c.tar.gz opie-54de91b66a2f0f985ff89503e919f85713d1f22c.tar.bz2 |
Starting to implement page attributes
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 13 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpad.h | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpad.pro | 2 | ||||
-rw-r--r-- | noncore/graphics/drawpad/newpagedialog.cpp | 14 | ||||
-rw-r--r-- | noncore/graphics/drawpad/newpagedialog.h | 3 | ||||
-rw-r--r-- | noncore/graphics/drawpad/pageinformationdialog.cpp | 70 | ||||
-rw-r--r-- | noncore/graphics/drawpad/pageinformationdialog.h | 39 |
7 files changed, 141 insertions, 1 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index ef55268..369e7f0 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -25,2 +25,3 @@ | |||
25 | #include "newpagedialog.h" | 25 | #include "newpagedialog.h" |
26 | #include "pageinformationdialog.h" | ||
26 | #include "pointtool.h" | 27 | #include "pointtool.h" |
@@ -88,2 +89,6 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
88 | thumbnailViewAction->addTo(toolsPopupMenu); | 89 | thumbnailViewAction->addTo(toolsPopupMenu); |
90 | |||
91 | QAction* pageInformationAction = new QAction(tr("Page Information"), tr("Page Information..."), 0, this); | ||
92 | connect(pageInformationAction, SIGNAL(activated()), this, SLOT(pageInformation())); | ||
93 | pageInformationAction->addTo(toolsPopupMenu); | ||
89 | 94 | ||
@@ -595 +600,9 @@ void DrawPad::thumbnailView() | |||
595 | } | 600 | } |
601 | |||
602 | void DrawPad::pageInformation() | ||
603 | { | ||
604 | PageInformationDialog pageInformationDialog(m_pDrawPadCanvas->currentPage()); | ||
605 | |||
606 | if (pageInformationDialog.exec() == QDialog::Accepted) { | ||
607 | } | ||
608 | } | ||
diff --git a/noncore/graphics/drawpad/drawpad.h b/noncore/graphics/drawpad/drawpad.h index 9a821f6..ce62802 100644 --- a/noncore/graphics/drawpad/drawpad.h +++ b/noncore/graphics/drawpad/drawpad.h | |||
@@ -67,2 +67,3 @@ private slots: | |||
67 | void thumbnailView(); | 67 | void thumbnailView(); |
68 | void pageInformation(); | ||
68 | 69 | ||
diff --git a/noncore/graphics/drawpad/drawpad.pro b/noncore/graphics/drawpad/drawpad.pro index 9a640d2..8dc89a2 100644 --- a/noncore/graphics/drawpad/drawpad.pro +++ b/noncore/graphics/drawpad/drawpad.pro | |||
@@ -14,2 +14,3 @@ HEADERS = drawpad.h \ | |||
14 | page.h \ | 14 | page.h \ |
15 | pageinformationdialog.h \ | ||
15 | pointtool.h \ | 16 | pointtool.h \ |
@@ -33,2 +34,3 @@ SOURCES = drawpad.cpp \ | |||
33 | page.cpp \ | 34 | page.cpp \ |
35 | pageinformationdialog.cpp \ | ||
34 | pointtool.cpp \ | 36 | pointtool.cpp \ |
diff --git a/noncore/graphics/drawpad/newpagedialog.cpp b/noncore/graphics/drawpad/newpagedialog.cpp index 0592af2..ff31aad 100644 --- a/noncore/graphics/drawpad/newpagedialog.cpp +++ b/noncore/graphics/drawpad/newpagedialog.cpp | |||
@@ -19,2 +19,3 @@ | |||
19 | #include <qlayout.h> | 19 | #include <qlayout.h> |
20 | #include <qlineedit.h> | ||
20 | #include <qradiobutton.h> | 21 | #include <qradiobutton.h> |
@@ -31,3 +32,8 @@ NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor, | |||
31 | 32 | ||
32 | QGroupBox* sizeGroupBox = new QGroupBox(0, Qt::Vertical, tr("Page Size"), this); | 33 | QGroupBox* generalGroupBox = new QGroupBox(0, Qt::Vertical, tr("General"), this); |
34 | |||
35 | QLabel* titleLabel = new QLabel(tr("Title:"), generalGroupBox); | ||
36 | m_pTitleLineEdit = new QLineEdit(generalGroupBox); | ||
37 | |||
38 | QGroupBox* sizeGroupBox = new QGroupBox(0, Qt::Vertical, tr("Size"), this); | ||
33 | 39 | ||
@@ -51,4 +57,6 @@ NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor, | |||
51 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); | 57 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); |
58 | generalGroupBox->layout()->setSpacing(4); | ||
52 | sizeGroupBox->layout()->setSpacing(4); | 59 | sizeGroupBox->layout()->setSpacing(4); |
53 | m_pContentButtonGroup->layout()->setSpacing(4); | 60 | m_pContentButtonGroup->layout()->setSpacing(4); |
61 | QGridLayout* generalLayout = new QGridLayout(generalGroupBox->layout(), 1, 1); | ||
54 | QGridLayout* sizeLayout = new QGridLayout(sizeGroupBox->layout(), 2, 2); | 62 | QGridLayout* sizeLayout = new QGridLayout(sizeGroupBox->layout(), 2, 2); |
@@ -56,2 +64,5 @@ NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor, | |||
56 | 64 | ||
65 | generalLayout->addWidget(titleLabel, 0, 0); | ||
66 | generalLayout->addWidget(m_pTitleLineEdit, 0, 1); | ||
67 | |||
57 | sizeLayout->addWidget(widthLabel, 0, 0); | 68 | sizeLayout->addWidget(widthLabel, 0, 0); |
@@ -67,2 +78,3 @@ NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor, | |||
67 | 78 | ||
79 | mainLayout->addWidget(generalGroupBox); | ||
68 | mainLayout->addWidget(sizeGroupBox); | 80 | mainLayout->addWidget(sizeGroupBox); |
diff --git a/noncore/graphics/drawpad/newpagedialog.h b/noncore/graphics/drawpad/newpagedialog.h index d680394..fe8f562 100644 --- a/noncore/graphics/drawpad/newpagedialog.h +++ b/noncore/graphics/drawpad/newpagedialog.h | |||
@@ -19,2 +19,3 @@ | |||
19 | class QButtonGroup; | 19 | class QButtonGroup; |
20 | class QLineEdit; | ||
20 | class QSpinBox; | 21 | class QSpinBox; |
@@ -35,2 +36,4 @@ public: | |||
35 | private: | 36 | private: |
37 | QLineEdit* m_pTitleLineEdit; | ||
38 | |||
36 | QSpinBox* m_pWidthSpinBox; | 39 | QSpinBox* m_pWidthSpinBox; |
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 | } | ||
diff --git a/noncore/graphics/drawpad/pageinformationdialog.h b/noncore/graphics/drawpad/pageinformationdialog.h new file mode 100644 index 0000000..cce74ec --- a/dev/null +++ b/noncore/graphics/drawpad/pageinformationdialog.h | |||
@@ -0,0 +1,39 @@ | |||
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 | #ifndef PAGEINFORMATIONDIALOG_H | ||
15 | #define PAGEINFORMATIONDIALOG_H | ||
16 | |||
17 | #include <qdialog.h> | ||
18 | |||
19 | class Page; | ||
20 | |||
21 | class QLineEdit; | ||
22 | |||
23 | class PageInformationDialog : public QDialog | ||
24 | { | ||
25 | Q_OBJECT | ||
26 | |||
27 | public: | ||
28 | PageInformationDialog(Page* page, QWidget* parent = 0, const char* name = 0); | ||
29 | ~PageInformationDialog(); | ||
30 | |||
31 | QString selectedTitle(); | ||
32 | |||
33 | private: | ||
34 | Page* m_pPage; | ||
35 | |||
36 | QLineEdit* m_pTitleLineEdit; | ||
37 | }; | ||
38 | |||
39 | #endif // PAGEINFORMATIONDIALOG_H | ||