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 /noncore/graphics/drawpad | |
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 | |||
@@ -2,48 +2,49 @@ | |||
2 | * * | 2 | * * |
3 | * DrawPad - a drawing program for Opie Environment * | 3 | * DrawPad - a drawing program for Opie Environment * |
4 | * * | 4 | * * |
5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * | 5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * |
6 | * * | 6 | * * |
7 | * This program is free software; you can redistribute it and/or modify * | 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 * | 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 * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | * * | 11 | * * |
12 | ***************************************************************************/ | 12 | ***************************************************************************/ |
13 | 13 | ||
14 | #include "drawpad.h" | 14 | #include "drawpad.h" |
15 | 15 | ||
16 | #include "drawpadcanvas.h" | 16 | #include "drawpadcanvas.h" |
17 | #include "ellipsetool.h" | 17 | #include "ellipsetool.h" |
18 | #include "erasetool.h" | 18 | #include "erasetool.h" |
19 | #include "exportdialog.h" | 19 | #include "exportdialog.h" |
20 | #include "filledellipsetool.h" | 20 | #include "filledellipsetool.h" |
21 | #include "filledrectangletool.h" | 21 | #include "filledrectangletool.h" |
22 | #include "filltool.h" | 22 | #include "filltool.h" |
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" |
29 | #include "thumbnailview.h" | 30 | #include "thumbnailview.h" |
30 | 31 | ||
31 | #include <opie/colordialog.h> | 32 | #include <opie/colordialog.h> |
32 | #include <opie/colorpopupmenu.h> | 33 | #include <opie/colorpopupmenu.h> |
33 | 34 | ||
34 | #include <qpe/applnk.h> | 35 | #include <qpe/applnk.h> |
35 | #include <qpe/global.h> | 36 | #include <qpe/global.h> |
36 | #include <qpe/qpemenubar.h> | 37 | #include <qpe/qpemenubar.h> |
37 | #include <qpe/qpetoolbar.h> | 38 | #include <qpe/qpetoolbar.h> |
38 | #include <qpe/resource.h> | 39 | #include <qpe/resource.h> |
39 | 40 | ||
40 | #include <qaction.h> | 41 | #include <qaction.h> |
41 | #include <qfile.h> | 42 | #include <qfile.h> |
42 | #include <qmessagebox.h> | 43 | #include <qmessagebox.h> |
43 | #include <qpainter.h> | 44 | #include <qpainter.h> |
44 | #include <qspinbox.h> | 45 | #include <qspinbox.h> |
45 | #include <qtoolbutton.h> | 46 | #include <qtoolbutton.h> |
46 | #include <qtooltip.h> | 47 | #include <qtooltip.h> |
47 | 48 | ||
48 | DrawPad::DrawPad(QWidget* parent, const char* name) | 49 | DrawPad::DrawPad(QWidget* parent, const char* name) |
49 | : QMainWindow(parent, name) | 50 | : QMainWindow(parent, name) |
@@ -65,48 +66,52 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
65 | QPEToolBar* menuToolBar = new QPEToolBar(this); | 66 | QPEToolBar* menuToolBar = new QPEToolBar(this); |
66 | QPEMenuBar* menuBar = new QPEMenuBar(menuToolBar); | 67 | QPEMenuBar* menuBar = new QPEMenuBar(menuToolBar); |
67 | 68 | ||
68 | QPopupMenu *toolsPopupMenu = new QPopupMenu(menuBar); | 69 | QPopupMenu *toolsPopupMenu = new QPopupMenu(menuBar); |
69 | 70 | ||
70 | QAction* deleteAllAction = new QAction(tr("Delete All"), QString::null, 0, this); | 71 | QAction* deleteAllAction = new QAction(tr("Delete All"), QString::null, 0, this); |
71 | connect(deleteAllAction, SIGNAL(activated()), this, SLOT(deleteAll())); | 72 | connect(deleteAllAction, SIGNAL(activated()), this, SLOT(deleteAll())); |
72 | deleteAllAction->addTo(toolsPopupMenu); | 73 | deleteAllAction->addTo(toolsPopupMenu); |
73 | 74 | ||
74 | toolsPopupMenu->insertSeparator(); | 75 | toolsPopupMenu->insertSeparator(); |
75 | 76 | ||
76 | QAction* importPageAction = new QAction(tr("Import"), tr("Import..."), 0, this); | 77 | QAction* importPageAction = new QAction(tr("Import"), tr("Import..."), 0, this); |
77 | connect(importPageAction, SIGNAL(activated()), this, SLOT(importPage())); | 78 | connect(importPageAction, SIGNAL(activated()), this, SLOT(importPage())); |
78 | importPageAction->addTo(toolsPopupMenu); | 79 | importPageAction->addTo(toolsPopupMenu); |
79 | 80 | ||
80 | QAction* exportPageAction = new QAction(tr("Export"), tr("Export..."), 0, this); | 81 | QAction* exportPageAction = new QAction(tr("Export"), tr("Export..."), 0, this); |
81 | connect(exportPageAction, SIGNAL(activated()), this, SLOT(exportPage())); | 82 | connect(exportPageAction, SIGNAL(activated()), this, SLOT(exportPage())); |
82 | exportPageAction->addTo(toolsPopupMenu); | 83 | exportPageAction->addTo(toolsPopupMenu); |
83 | 84 | ||
84 | toolsPopupMenu->insertSeparator(); | 85 | toolsPopupMenu->insertSeparator(); |
85 | 86 | ||
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 | ||
92 | // init page toolbar | 97 | // init page toolbar |
93 | 98 | ||
94 | QPEToolBar* pageToolBar = new QPEToolBar(this); | 99 | QPEToolBar* pageToolBar = new QPEToolBar(this); |
95 | 100 | ||
96 | QAction* newPageAction = new QAction(tr("New Page"), Resource::loadIconSet("new"), QString::null, 0, this); | 101 | QAction* newPageAction = new QAction(tr("New Page"), Resource::loadIconSet("new"), QString::null, 0, this); |
97 | connect(newPageAction, SIGNAL(activated()), this, SLOT(newPage())); | 102 | connect(newPageAction, SIGNAL(activated()), this, SLOT(newPage())); |
98 | newPageAction->addTo(pageToolBar); | 103 | newPageAction->addTo(pageToolBar); |
99 | 104 | ||
100 | QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadIconSet("drawpad/clear"), QString::null, 0, this); | 105 | QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadIconSet("drawpad/clear"), QString::null, 0, this); |
101 | connect(clearPageAction, SIGNAL(activated()), this, SLOT(clearPage())); | 106 | connect(clearPageAction, SIGNAL(activated()), this, SLOT(clearPage())); |
102 | clearPageAction->addTo(pageToolBar); | 107 | clearPageAction->addTo(pageToolBar); |
103 | 108 | ||
104 | QAction* deletePageAction = new QAction(tr("Delete Page"), Resource::loadIconSet("trash"), QString::null, 0, this); | 109 | QAction* deletePageAction = new QAction(tr("Delete Page"), Resource::loadIconSet("trash"), QString::null, 0, this); |
105 | connect(deletePageAction, SIGNAL(activated()), this, SLOT(deletePage())); | 110 | connect(deletePageAction, SIGNAL(activated()), this, SLOT(deletePage())); |
106 | deletePageAction->addTo(pageToolBar); | 111 | deletePageAction->addTo(pageToolBar); |
107 | 112 | ||
108 | QPEToolBar* emptyToolBar = new QPEToolBar(this); | 113 | QPEToolBar* emptyToolBar = new QPEToolBar(this); |
109 | emptyToolBar->setHorizontalStretchable(true); | 114 | emptyToolBar->setHorizontalStretchable(true); |
110 | 115 | ||
111 | // init navigation toolbar | 116 | // init navigation toolbar |
112 | 117 | ||
@@ -572,24 +577,32 @@ void DrawPad::importPage() | |||
572 | delete docLnk; | 577 | delete docLnk; |
573 | } | 578 | } |
574 | } | 579 | } |
575 | } | 580 | } |
576 | 581 | ||
577 | void DrawPad::exportPage() | 582 | void DrawPad::exportPage() |
578 | { | 583 | { |
579 | ExportDialog exportDialog(m_pDrawPadCanvas->pagePosition(), m_pDrawPadCanvas->pageCount(), this); | 584 | ExportDialog exportDialog(m_pDrawPadCanvas->pagePosition(), m_pDrawPadCanvas->pageCount(), this); |
580 | 585 | ||
581 | exportDialog.showMaximized(); | 586 | exportDialog.showMaximized(); |
582 | 587 | ||
583 | if (exportDialog.exec() == QDialog::Accepted) { | 588 | if (exportDialog.exec() == QDialog::Accepted) { |
584 | m_pDrawPadCanvas->exportPage(exportDialog.selectedFromPage(), exportDialog.selectedToPage(), | 589 | m_pDrawPadCanvas->exportPage(exportDialog.selectedFromPage(), exportDialog.selectedToPage(), |
585 | exportDialog.selectedName(), exportDialog.selectedFormat()); | 590 | exportDialog.selectedName(), exportDialog.selectedFormat()); |
586 | } | 591 | } |
587 | } | 592 | } |
588 | 593 | ||
589 | void DrawPad::thumbnailView() | 594 | void DrawPad::thumbnailView() |
590 | { | 595 | { |
591 | ThumbnailView thumbnailView(this, m_pDrawPadCanvas, this); | 596 | ThumbnailView thumbnailView(this, m_pDrawPadCanvas, this); |
592 | 597 | ||
593 | thumbnailView.showMaximized(); | 598 | thumbnailView.showMaximized(); |
594 | thumbnailView.exec(); | 599 | thumbnailView.exec(); |
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 | |||
@@ -44,48 +44,49 @@ private slots: | |||
44 | void deletePage(); | 44 | void deletePage(); |
45 | 45 | ||
46 | void setPointTool(); | 46 | void setPointTool(); |
47 | void setLineTool(); | 47 | void setLineTool(); |
48 | void setRectangleTool(); | 48 | void setRectangleTool(); |
49 | void setFilledRectangleTool(); | 49 | void setFilledRectangleTool(); |
50 | void setEllipseTool(); | 50 | void setEllipseTool(); |
51 | void setFilledEllipseTool(); | 51 | void setFilledEllipseTool(); |
52 | void setTextTool(); | 52 | void setTextTool(); |
53 | void setFillTool(); | 53 | void setFillTool(); |
54 | void setEraseTool(); | 54 | void setEraseTool(); |
55 | 55 | ||
56 | void changePenWidth(int value); | 56 | void changePenWidth(int value); |
57 | void changePenColor(const QColor& color); | 57 | void changePenColor(const QColor& color); |
58 | void changeBrushColor(const QColor& color); | 58 | void changeBrushColor(const QColor& color); |
59 | 59 | ||
60 | void updateUndoRedoToolButtons(); | 60 | void updateUndoRedoToolButtons(); |
61 | void updateNavigationToolButtons(); | 61 | void updateNavigationToolButtons(); |
62 | void updateCaption(); | 62 | void updateCaption(); |
63 | 63 | ||
64 | void deleteAll(); | 64 | void deleteAll(); |
65 | void importPage(); | 65 | void importPage(); |
66 | void exportPage(); | 66 | void exportPage(); |
67 | void thumbnailView(); | 67 | void thumbnailView(); |
68 | void pageInformation(); | ||
68 | 69 | ||
69 | private: | 70 | private: |
70 | DrawPadCanvas* m_pDrawPadCanvas; | 71 | DrawPadCanvas* m_pDrawPadCanvas; |
71 | 72 | ||
72 | Tool* m_pTool; | 73 | Tool* m_pTool; |
73 | QPen m_pen; | 74 | QPen m_pen; |
74 | QBrush m_brush; | 75 | QBrush m_brush; |
75 | 76 | ||
76 | QAction* m_pUndoAction; | 77 | QAction* m_pUndoAction; |
77 | QAction* m_pRedoAction; | 78 | QAction* m_pRedoAction; |
78 | 79 | ||
79 | QAction* m_pFirstPageAction; | 80 | QAction* m_pFirstPageAction; |
80 | QAction* m_pPreviousPageAction; | 81 | QAction* m_pPreviousPageAction; |
81 | QAction* m_pNextPageAction; | 82 | QAction* m_pNextPageAction; |
82 | QAction* m_pLastPageAction; | 83 | QAction* m_pLastPageAction; |
83 | 84 | ||
84 | QAction* m_pPointToolAction; | 85 | QAction* m_pPointToolAction; |
85 | QAction* m_pLineToolAction; | 86 | QAction* m_pLineToolAction; |
86 | QAction* m_pRectangleToolAction; | 87 | QAction* m_pRectangleToolAction; |
87 | QAction* m_pFilledRectangleToolAction; | 88 | QAction* m_pFilledRectangleToolAction; |
88 | QAction* m_pEllipseToolAction; | 89 | QAction* m_pEllipseToolAction; |
89 | QAction* m_pFilledEllipseToolAction; | 90 | QAction* m_pFilledEllipseToolAction; |
90 | QAction* m_pTextToolAction; | 91 | QAction* m_pTextToolAction; |
91 | QAction* m_pFillToolAction; | 92 | QAction* m_pFillToolAction; |
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 | |||
@@ -1,57 +1,59 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on release |
3 | HEADERS = drawpad.h \ | 3 | HEADERS = drawpad.h \ |
4 | drawpadcanvas.h \ | 4 | drawpadcanvas.h \ |
5 | ellipsetool.h \ | 5 | ellipsetool.h \ |
6 | erasetool.h \ | 6 | erasetool.h \ |
7 | exportdialog.h \ | 7 | exportdialog.h \ |
8 | filltool.h \ | 8 | filltool.h \ |
9 | filledellipsetool.h \ | 9 | filledellipsetool.h \ |
10 | filledrectangletool.h \ | 10 | filledrectangletool.h \ |
11 | importdialog.h \ | 11 | importdialog.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 \ |
18 | texttool.h \ | 19 | texttool.h \ |
19 | thumbnailview.h \ | 20 | thumbnailview.h \ |
20 | tool.h | 21 | tool.h |
21 | SOURCES = drawpad.cpp \ | 22 | SOURCES = drawpad.cpp \ |
22 | drawpadcanvas.cpp \ | 23 | drawpadcanvas.cpp \ |
23 | ellipsetool.cpp \ | 24 | ellipsetool.cpp \ |
24 | erasetool.cpp \ | 25 | erasetool.cpp \ |
25 | exportdialog.cpp \ | 26 | exportdialog.cpp \ |
26 | filltool.cpp \ | 27 | filltool.cpp \ |
27 | filledellipsetool.cpp \ | 28 | filledellipsetool.cpp \ |
28 | filledrectangletool.cpp \ | 29 | filledrectangletool.cpp \ |
29 | importdialog.cpp \ | 30 | importdialog.cpp \ |
30 | linetool.cpp \ | 31 | linetool.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 \ |
37 | texttool.cpp \ | 39 | texttool.cpp \ |
38 | thumbnailview.cpp \ | 40 | thumbnailview.cpp \ |
39 | tool.cpp | 41 | tool.cpp |
40 | INCLUDEPATH+= $(OPIEDIR)/include \ | 42 | INCLUDEPATH+= $(OPIEDIR)/include \ |
41 | $(QTDIR)/src/3rdparty/zlib | 43 | $(QTDIR)/src/3rdparty/zlib |
42 | DEPENDPATH+= $(OPIEDIR)/include | 44 | DEPENDPATH+= $(OPIEDIR)/include |
43 | LIBS += -lqpe -lopie | 45 | LIBS += -lqpe -lopie |
44 | DESTDIR = $(OPIEDIR)/bin | 46 | DESTDIR = $(OPIEDIR)/bin |
45 | TARGET = drawpad | 47 | TARGET = drawpad |
46 | 48 | ||
47 | TRANSLATIONS= ../../i18n/de/drawpad.ts | 49 | TRANSLATIONS= ../../i18n/de/drawpad.ts |
48 | TRANSLATIONS+= ../../i18n/en/drawpad.ts | 50 | TRANSLATIONS+= ../../i18n/en/drawpad.ts |
49 | TRANSLATIONS+= ../../i18n/fr/drawpad.ts | 51 | TRANSLATIONS+= ../../i18n/fr/drawpad.ts |
50 | TRANSLATIONS+= ../../i18n/hu/drawpad.ts | 52 | TRANSLATIONS+= ../../i18n/hu/drawpad.ts |
51 | TRANSLATIONS+= ../../i18n/ja/drawpad.ts | 53 | TRANSLATIONS+= ../../i18n/ja/drawpad.ts |
52 | TRANSLATIONS+= ../../i18n/ko/drawpad.ts | 54 | TRANSLATIONS+= ../../i18n/ko/drawpad.ts |
53 | TRANSLATIONS+= ../../i18n/no/drawpad.ts | 55 | TRANSLATIONS+= ../../i18n/no/drawpad.ts |
54 | TRANSLATIONS+= ../../i18n/pl/drawpad.ts | 56 | TRANSLATIONS+= ../../i18n/pl/drawpad.ts |
55 | TRANSLATIONS+= ../../i18n/pt_BR/drawpad.ts | 57 | TRANSLATIONS+= ../../i18n/pt_BR/drawpad.ts |
56 | TRANSLATIONS+= ../../i18n/sl/drawpad.ts | 58 | TRANSLATIONS+= ../../i18n/sl/drawpad.ts |
57 | TRANSLATIONS+= ../../i18n/zh_CN/drawpad.ts | 59 | TRANSLATIONS+= ../../i18n/zh_CN/drawpad.ts |
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 | |||
@@ -1,91 +1,103 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * DrawPad - a drawing program for Opie Environment * | 3 | * DrawPad - a drawing program for Opie Environment * |
4 | * * | 4 | * * |
5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * | 5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * |
6 | * * | 6 | * * |
7 | * This program is free software; you can redistribute it and/or modify * | 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 * | 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 * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | * * | 11 | * * |
12 | ***************************************************************************/ | 12 | ***************************************************************************/ |
13 | 13 | ||
14 | #include "newpagedialog.h" | 14 | #include "newpagedialog.h" |
15 | 15 | ||
16 | #include <qbuttongroup.h> | 16 | #include <qbuttongroup.h> |
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 | ||
23 | NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor, | 24 | NewPageDialog::NewPageDialog(uint width, uint height, const QColor& penColor, |
24 | const QColor& brushColor, QWidget* parent, const char* name) | 25 | const QColor& brushColor, QWidget* parent, const char* name) |
25 | : QDialog(parent, name, true) | 26 | : QDialog(parent, name, true) |
26 | { | 27 | { |
27 | setCaption(tr("New Page")); | 28 | setCaption(tr("New Page")); |
28 | 29 | ||
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); |
36 | 42 | ||
37 | m_pWidthSpinBox = new QSpinBox(1, 1024, 1, sizeGroupBox); | 43 | m_pWidthSpinBox = new QSpinBox(1, 1024, 1, sizeGroupBox); |
38 | m_pHeightSpinBox = new QSpinBox(1, 1024, 1, sizeGroupBox); | 44 | m_pHeightSpinBox = new QSpinBox(1, 1024, 1, sizeGroupBox); |
39 | 45 | ||
40 | m_pWidthSpinBox->setValue(width); | 46 | m_pWidthSpinBox->setValue(width); |
41 | m_pHeightSpinBox->setValue(height); | 47 | m_pHeightSpinBox->setValue(height); |
42 | 48 | ||
43 | m_pContentButtonGroup = new QButtonGroup(0, Qt::Vertical, tr("Background"), this); | 49 | m_pContentButtonGroup = new QButtonGroup(0, Qt::Vertical, tr("Background"), this); |
44 | 50 | ||
45 | QRadioButton* whiteColorRadioButton = new QRadioButton(tr("White"), m_pContentButtonGroup); | 51 | QRadioButton* whiteColorRadioButton = new QRadioButton(tr("White"), m_pContentButtonGroup); |
46 | QRadioButton* penColorRadioButton = new QRadioButton(tr("Pen Color"), m_pContentButtonGroup); | 52 | QRadioButton* penColorRadioButton = new QRadioButton(tr("Pen Color"), m_pContentButtonGroup); |
47 | QRadioButton* brushColorRadioButton = new QRadioButton(tr("Fill Color"), m_pContentButtonGroup); | 53 | QRadioButton* brushColorRadioButton = new QRadioButton(tr("Fill Color"), m_pContentButtonGroup); |
48 | 54 | ||
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); |
60 | sizeLayout->addWidget(m_pHeightSpinBox, 1, 1); | 71 | sizeLayout->addWidget(m_pHeightSpinBox, 1, 1); |
61 | 72 | ||
62 | sizeLayout->setColStretch(1, 1); | 73 | sizeLayout->setColStretch(1, 1); |
63 | 74 | ||
64 | contentLayout->addWidget(whiteColorRadioButton); | 75 | contentLayout->addWidget(whiteColorRadioButton); |
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 | } |
71 | 83 | ||
72 | NewPageDialog::~NewPageDialog() | 84 | NewPageDialog::~NewPageDialog() |
73 | { | 85 | { |
74 | } | 86 | } |
75 | 87 | ||
76 | uint NewPageDialog::selectedWidth() | 88 | uint NewPageDialog::selectedWidth() |
77 | { | 89 | { |
78 | return (m_pWidthSpinBox->value()); | 90 | return (m_pWidthSpinBox->value()); |
79 | } | 91 | } |
80 | 92 | ||
81 | uint NewPageDialog::selectedHeight() | 93 | uint NewPageDialog::selectedHeight() |
82 | { | 94 | { |
83 | return (m_pHeightSpinBox->value()); | 95 | return (m_pHeightSpinBox->value()); |
84 | } | 96 | } |
85 | 97 | ||
86 | const QColor& NewPageDialog::selectedColor() | 98 | const QColor& NewPageDialog::selectedColor() |
87 | { | 99 | { |
88 | switch (m_pContentButtonGroup->id(m_pContentButtonGroup->selected())) { | 100 | switch (m_pContentButtonGroup->id(m_pContentButtonGroup->selected())) { |
89 | case 0: | 101 | case 0: |
90 | return (Qt::white); | 102 | return (Qt::white); |
91 | break; | 103 | break; |
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 | |||
@@ -1,45 +1,48 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * DrawPad - a drawing program for Opie Environment * | 3 | * DrawPad - a drawing program for Opie Environment * |
4 | * * | 4 | * * |
5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * | 5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * |
6 | * * | 6 | * * |
7 | * This program is free software; you can redistribute it and/or modify * | 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 * | 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 * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | * * | 11 | * * |
12 | ***************************************************************************/ | 12 | ***************************************************************************/ |
13 | 13 | ||
14 | #ifndef NEWPAGEDIALOG_H | 14 | #ifndef NEWPAGEDIALOG_H |
15 | #define NEWPAGEDIALOG_H | 15 | #define NEWPAGEDIALOG_H |
16 | 16 | ||
17 | #include <qdialog.h> | 17 | #include <qdialog.h> |
18 | 18 | ||
19 | class QButtonGroup; | 19 | class QButtonGroup; |
20 | class QLineEdit; | ||
20 | class QSpinBox; | 21 | class QSpinBox; |
21 | 22 | ||
22 | class NewPageDialog : public QDialog | 23 | class NewPageDialog : public QDialog |
23 | { | 24 | { |
24 | Q_OBJECT | 25 | Q_OBJECT |
25 | 26 | ||
26 | public: | 27 | public: |
27 | NewPageDialog(uint width, uint height, const QColor& foregroundColor, | 28 | NewPageDialog(uint width, uint height, const QColor& foregroundColor, |
28 | const QColor& backgroundColor, QWidget* parent = 0, const char* name = 0); | 29 | const QColor& backgroundColor, QWidget* parent = 0, const char* name = 0); |
29 | ~NewPageDialog(); | 30 | ~NewPageDialog(); |
30 | 31 | ||
31 | uint selectedWidth(); | 32 | uint selectedWidth(); |
32 | uint selectedHeight(); | 33 | uint selectedHeight(); |
33 | const QColor& selectedColor(); | 34 | const QColor& selectedColor(); |
34 | 35 | ||
35 | private: | 36 | private: |
37 | QLineEdit* m_pTitleLineEdit; | ||
38 | |||
36 | QSpinBox* m_pWidthSpinBox; | 39 | QSpinBox* m_pWidthSpinBox; |
37 | QSpinBox* m_pHeightSpinBox; | 40 | QSpinBox* m_pHeightSpinBox; |
38 | 41 | ||
39 | QColor m_penColor; | 42 | QColor m_penColor; |
40 | QColor m_brushColor; | 43 | QColor m_brushColor; |
41 | 44 | ||
42 | QButtonGroup* m_pContentButtonGroup; | 45 | QButtonGroup* m_pContentButtonGroup; |
43 | }; | 46 | }; |
44 | 47 | ||
45 | #endif // NEWPAGEDIALOG_H | 48 | #endif // NEWPAGEDIALOG_H |
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 | ||