summaryrefslogtreecommitdiff
authorleseb <leseb>2002-06-13 16:43:16 (UTC)
committer leseb <leseb>2002-06-13 16:43:16 (UTC)
commit54de91b66a2f0f985ff89503e919f85713d1f22c (patch) (unidiff)
tree55df26ca5f08584beb4e033a1fee4510a8e2d45c
parent6a178f4ad2c3a9b92224c3506165cf03df41202e (diff)
downloadopie-54de91b66a2f0f985ff89503e919f85713d1f22c.zip
opie-54de91b66a2f0f985ff89503e919f85713d1f22c.tar.gz
opie-54de91b66a2f0f985ff89503e919f85713d1f22c.tar.bz2
Starting to implement page attributes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/drawpad/drawpad.cpp13
-rw-r--r--noncore/graphics/drawpad/drawpad.h1
-rw-r--r--noncore/graphics/drawpad/drawpad.pro2
-rw-r--r--noncore/graphics/drawpad/newpagedialog.cpp14
-rw-r--r--noncore/graphics/drawpad/newpagedialog.h3
-rw-r--r--noncore/graphics/drawpad/pageinformationdialog.cpp70
-rw-r--r--noncore/graphics/drawpad/pageinformationdialog.h39
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
@@ -23,6 +23,7 @@
23#include "importdialog.h" 23#include "importdialog.h"
24#include "linetool.h" 24#include "linetool.h"
25#include "newpagedialog.h" 25#include "newpagedialog.h"
26#include "pageinformationdialog.h"
26#include "pointtool.h" 27#include "pointtool.h"
27#include "rectangletool.h" 28#include "rectangletool.h"
28#include "texttool.h" 29#include "texttool.h"
@@ -86,6 +87,10 @@ DrawPad::DrawPad(QWidget* parent, const char* name)
86 QAction* thumbnailViewAction = new QAction(tr("Thumbnail View"), tr("Thumbnail View..."), 0, this); 87 QAction* thumbnailViewAction = new QAction(tr("Thumbnail View"), tr("Thumbnail View..."), 0, this);
87 connect(thumbnailViewAction, SIGNAL(activated()), this, SLOT(thumbnailView())); 88 connect(thumbnailViewAction, SIGNAL(activated()), this, SLOT(thumbnailView()));
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
90 menuBar->insertItem(tr("Tools"), toolsPopupMenu); 95 menuBar->insertItem(tr("Tools"), toolsPopupMenu);
91 96
@@ -593,3 +598,11 @@ void DrawPad::thumbnailView()
593 thumbnailView.showMaximized(); 598 thumbnailView.showMaximized();
594 thumbnailView.exec(); 599 thumbnailView.exec();
595} 600}
601
602void 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
@@ -65,6 +65,7 @@ private slots:
65 void importPage(); 65 void importPage();
66 void exportPage(); 66 void exportPage();
67 void thumbnailView(); 67 void thumbnailView();
68 void pageInformation();
68 69
69private: 70private:
70 DrawPadCanvas* m_pDrawPadCanvas; 71 DrawPadCanvas* m_pDrawPadCanvas;
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
@@ -12,6 +12,7 @@ HEADERS = drawpad.h \
12 linetool.h \ 12 linetool.h \
13 newpagedialog.h \ 13 newpagedialog.h \
14 page.h \ 14 page.h \
15 pageinformationdialog.h \
15 pointtool.h \ 16 pointtool.h \
16 rectangletool.h \ 17 rectangletool.h \
17 shapetool.h \ 18 shapetool.h \
@@ -31,6 +32,7 @@ SOURCES = drawpad.cpp \
31 main.cpp \ 32 main.cpp \
32 newpagedialog.cpp \ 33 newpagedialog.cpp \
33 page.cpp \ 34 page.cpp \
35 pageinformationdialog.cpp \
34 pointtool.cpp \ 36 pointtool.cpp \
35 rectangletool.cpp \ 37 rectangletool.cpp \
36 shapetool.cpp \ 38 shapetool.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
@@ -17,6 +17,7 @@
17#include <qgroupbox.h> 17#include <qgroupbox.h>
18#include <qlabel.h> 18#include <qlabel.h>
19#include <qlayout.h> 19#include <qlayout.h>
20#include <qlineedit.h>
20#include <qradiobutton.h> 21#include <qradiobutton.h>
21#include <qspinbox.h> 22#include <qspinbox.h>
22 23
@@ -29,7 +30,12 @@ NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor,
29 m_penColor = penColor; 30 m_penColor = penColor;
30 m_brushColor = brushColor; 31 m_brushColor = brushColor;
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
34 QLabel* widthLabel = new QLabel(tr("Width:"), sizeGroupBox); 40 QLabel* widthLabel = new QLabel(tr("Width:"), sizeGroupBox);
35 QLabel* heightLabel = new QLabel(tr("Height:"), sizeGroupBox); 41 QLabel* heightLabel = new QLabel(tr("Height:"), sizeGroupBox);
@@ -49,11 +55,16 @@ NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor,
49 m_pContentButtonGroup->setButton(0); 55 m_pContentButtonGroup->setButton(0);
50 56
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);
55 QVBoxLayout* contentLayout = new QVBoxLayout(m_pContentButtonGroup->layout()); 63 QVBoxLayout* contentLayout = new QVBoxLayout(m_pContentButtonGroup->layout());
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);
58 sizeLayout->addWidget(heightLabel, 1, 0); 69 sizeLayout->addWidget(heightLabel, 1, 0);
59 sizeLayout->addWidget(m_pWidthSpinBox, 0, 1); 70 sizeLayout->addWidget(m_pWidthSpinBox, 0, 1);
@@ -65,6 +76,7 @@ NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor,
65 contentLayout->addWidget(penColorRadioButton); 76 contentLayout->addWidget(penColorRadioButton);
66 contentLayout->addWidget(brushColorRadioButton); 77 contentLayout->addWidget(brushColorRadioButton);
67 78
79 mainLayout->addWidget(generalGroupBox);
68 mainLayout->addWidget(sizeGroupBox); 80 mainLayout->addWidget(sizeGroupBox);
69 mainLayout->addWidget(m_pContentButtonGroup); 81 mainLayout->addWidget(m_pContentButtonGroup);
70} 82}
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
@@ -17,6 +17,7 @@
17#include <qdialog.h> 17#include <qdialog.h>
18 18
19class QButtonGroup; 19class QButtonGroup;
20class QLineEdit;
20class QSpinBox; 21class QSpinBox;
21 22
22class NewPageDialog : public QDialog 23class NewPageDialog : public QDialog
@@ -33,6 +34,8 @@ public:
33 const QColor& selectedColor(); 34 const QColor& selectedColor();
34 35
35private: 36private:
37 QLineEdit* m_pTitleLineEdit;
38
36 QSpinBox* m_pWidthSpinBox; 39 QSpinBox* m_pWidthSpinBox;
37 QSpinBox* m_pHeightSpinBox; 40 QSpinBox* m_pHeightSpinBox;
38 41
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
23PageInformationDialog::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
63PageInformationDialog::~PageInformationDialog()
64{
65}
66
67QString 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
19class Page;
20
21class QLineEdit;
22
23class PageInformationDialog : public QDialog
24{
25 Q_OBJECT
26
27public:
28 PageInformationDialog(Page* page, QWidget* parent = 0, const char* name = 0);
29 ~PageInformationDialog();
30
31 QString selectedTitle();
32
33private:
34 Page* m_pPage;
35
36 QLineEdit* m_pTitleLineEdit;
37};
38
39#endif // PAGEINFORMATIONDIALOG_H