-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 6 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpad.h | 3 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 6 | ||||
-rw-r--r-- | noncore/graphics/drawpad/main.cpp | 1 |
5 files changed, 11 insertions, 6 deletions
@@ -1,10 +1,11 @@ | |||
1 | 2004-??-??The Opie Team <opie@handhelds.org> | 1 | 2004-??-??The Opie Team <opie@handhelds.org> |
2 | 2 | ||
3 | * Fixed Drawpad initialization (Bug #1314) (mickeyl) | ||
3 | * Added four themes courtesy Robert Griebl (http://www.softforge.de/zstyle) | 4 | * Added four themes courtesy Robert Griebl (http://www.softforge.de/zstyle) |
4 | * Added Conversion tool for pim-data (eilers) | 5 | * Added Conversion tool for pim-data (eilers) |
5 | * Modifcation of the PIM API for providing generic use of OPimRecords. (eilers) | 6 | * Modifcation of the PIM API for providing generic use of OPimRecords. (eilers) |
6 | 7 | ||
7 | 2004-25-04The Opie Team <opie@handhelds.org> | 8 | 2004-25-04The Opie Team <opie@handhelds.org> |
8 | 9 | ||
9 | * Released as Version 1.1.3 (devel) | 10 | * Released as Version 1.1.3 (devel) |
10 | * Introduced first implementation of SQL-Support using SQLite (eilers) | 11 | * Introduced first implementation of SQL-Support using SQLite (eilers) |
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index d9d0ce0..c0f42d9 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -44,17 +44,16 @@ | |||
44 | #include <qfile.h> | 44 | #include <qfile.h> |
45 | #include <qmessagebox.h> | 45 | #include <qmessagebox.h> |
46 | #include <qspinbox.h> | 46 | #include <qspinbox.h> |
47 | #include <qtoolbutton.h> | 47 | #include <qtoolbutton.h> |
48 | #include <qtooltip.h> | 48 | #include <qtooltip.h> |
49 | #include <qwhatsthis.h> | 49 | #include <qwhatsthis.h> |
50 | 50 | ||
51 | using namespace Opie::Ui; | 51 | using namespace Opie::Ui; |
52 | using namespace Opie::Ui; | ||
53 | DrawPad::DrawPad(QWidget* parent, const char* name, WFlags /*fl*/ ) | 52 | DrawPad::DrawPad(QWidget* parent, const char* name, WFlags /*fl*/ ) |
54 | : QMainWindow(parent, name, WStyle_ContextHelp) | 53 | : QMainWindow(parent, name, WStyle_ContextHelp) |
55 | { | 54 | { |
56 | // init members | 55 | // init members |
57 | connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), | 56 | connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), |
58 | this, SLOT(slotAppMessage(const QCString&, const QByteArray&)) ); | 57 | this, SLOT(slotAppMessage(const QCString&, const QByteArray&)) ); |
59 | 58 | ||
60 | m_pDrawPadCanvas = new DrawPadCanvas(this, this); | 59 | m_pDrawPadCanvas = new DrawPadCanvas(this, this); |
@@ -276,17 +275,20 @@ DrawPad::DrawPad(QWidget* parent, const char* name, WFlags /*fl*/ ) | |||
276 | connect(brushColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); | 275 | connect(brushColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBrushColor(const QColor&))); |
277 | 276 | ||
278 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); | 277 | QToolTip::add(m_pBrushColorToolButton, tr("Fill Color")); |
279 | m_pBrushColorToolButton->setPopup(brushColorPopupMenu); | 278 | m_pBrushColorToolButton->setPopup(brushColorPopupMenu); |
280 | m_pBrushColorToolButton->setPopupDelay(0); | 279 | m_pBrushColorToolButton->setPopupDelay(0); |
281 | 280 | ||
282 | changeBrushColor(Qt::white); | 281 | changeBrushColor(Qt::white); |
283 | 282 | ||
284 | finishStartup(); | 283 | // delay the rest of the initialization and do it from within the mainloop |
284 | // if we don't do this, the widget layout may not be constructed upon | ||
285 | // and we will end up with a wrong QScrollview page size (Mickeyl) | ||
286 | QTimer::singleShot( 100, this, SLOT( finishStartup() ) ); | ||
285 | } | 287 | } |
286 | 288 | ||
287 | 289 | ||
288 | void DrawPad::finishStartup() | 290 | void DrawPad::finishStartup() |
289 | { | 291 | { |
290 | // init pages | 292 | // init pages |
291 | 293 | ||
292 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); | 294 | QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); |
diff --git a/noncore/graphics/drawpad/drawpad.h b/noncore/graphics/drawpad/drawpad.h index ba9e47d..63d3057 100644 --- a/noncore/graphics/drawpad/drawpad.h +++ b/noncore/graphics/drawpad/drawpad.h | |||
@@ -36,19 +36,20 @@ public: | |||
36 | 36 | ||
37 | static QString appName() { return QString::fromLatin1("drawpad"); } | 37 | static QString appName() { return QString::fromLatin1("drawpad"); } |
38 | 38 | ||
39 | Tool* tool() { return m_pTool; } | 39 | Tool* tool() { return m_pTool; } |
40 | QPen pen() { return m_pen; } | 40 | QPen pen() { return m_pen; } |
41 | QBrush brush() { return m_brush; } | 41 | QBrush brush() { return m_brush; } |
42 | 42 | ||
43 | bool antiAliasing(); | 43 | bool antiAliasing(); |
44 | void finishStartup(); | ||
45 | 44 | ||
46 | private slots: | 45 | private slots: |
46 | void finishStartup(); | ||
47 | |||
47 | void newPage(); | 48 | void newPage(); |
48 | void clearPage(); | 49 | void clearPage(); |
49 | void deletePage(); | 50 | void deletePage(); |
50 | 51 | ||
51 | void slotAppMessage( const QCString&, const QByteArray& ); | 52 | void slotAppMessage( const QCString&, const QByteArray& ); |
52 | 53 | ||
53 | void setPointTool(); | 54 | void setPointTool(); |
54 | void setLineTool(); | 55 | void setLineTool(); |
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index 423ef26..5d0c6e4 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp | |||
@@ -511,21 +511,23 @@ void DrawPadCanvas::contentsMouseReleaseEvent(QMouseEvent* e) | |||
511 | 511 | ||
512 | void DrawPadCanvas::contentsMouseMoveEvent(QMouseEvent* e) | 512 | void DrawPadCanvas::contentsMouseMoveEvent(QMouseEvent* e) |
513 | { | 513 | { |
514 | m_pDrawPad->tool()->mouseMoveEvent(e); | 514 | m_pDrawPad->tool()->mouseMoveEvent(e); |
515 | } | 515 | } |
516 | 516 | ||
517 | void DrawPadCanvas::drawContents(QPainter* p, int cx, int cy, int cw, int ch) | 517 | void DrawPadCanvas::drawContents(QPainter* p, int cx, int cy, int cw, int ch) |
518 | { | 518 | { |
519 | Page* currentPage = m_pages.current(); | ||
520 | if ( !currentPage ) return; // no page yet --> initialization not finished (Mickeyl) | ||
519 | QRect clipRect(cx, cy, cw, ch); | 521 | QRect clipRect(cx, cy, cw, ch); |
520 | QRect pixmapRect(0, 0, m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); | 522 | QRect pixmapRect(0, 0, currentPage->pixmap()->width(), m_pages.current()->pixmap()->height()); |
521 | QRect drawRect = pixmapRect.intersect(clipRect); | 523 | QRect drawRect = pixmapRect.intersect(clipRect); |
522 | 524 | ||
523 | p->drawPixmap(drawRect.topLeft(), *(m_pages.current()->pixmap()), drawRect); | 525 | p->drawPixmap(drawRect.topLeft(), *(currentPage->pixmap()), drawRect); |
524 | 526 | ||
525 | if (drawRect.right() < clipRect.right()) { | 527 | if (drawRect.right() < clipRect.right()) { |
526 | p->fillRect(drawRect.right() + 1, cy, cw - drawRect.width(), ch, colorGroup().dark()); | 528 | p->fillRect(drawRect.right() + 1, cy, cw - drawRect.width(), ch, colorGroup().dark()); |
527 | } | 529 | } |
528 | 530 | ||
529 | if (drawRect.bottom() < clipRect.bottom()) { | 531 | if (drawRect.bottom() < clipRect.bottom()) { |
530 | p->fillRect(cx, drawRect.bottom() + 1, cw, ch - drawRect.height(), colorGroup().dark()); | 532 | p->fillRect(cx, drawRect.bottom() + 1, cw, ch - drawRect.height(), colorGroup().dark()); |
531 | } | 533 | } |
diff --git a/noncore/graphics/drawpad/main.cpp b/noncore/graphics/drawpad/main.cpp index e48bb2e..f468022 100644 --- a/noncore/graphics/drawpad/main.cpp +++ b/noncore/graphics/drawpad/main.cpp | |||
@@ -11,10 +11,9 @@ | |||
11 | * * | 11 | * * |
12 | ***************************************************************************/ | 12 | ***************************************************************************/ |
13 | 13 | ||
14 | #include "drawpad.h" | 14 | #include "drawpad.h" |
15 | 15 | ||
16 | #include <opie2/oapplicationfactory.h> | 16 | #include <opie2/oapplicationfactory.h> |
17 | 17 | ||
18 | using namespace Opie::Core; | 18 | using namespace Opie::Core; |
19 | using namespace Opie::Core; | ||
20 | OPIE_EXPORT_APP( OApplicationFactory<DrawPad> ) | 19 | OPIE_EXPORT_APP( OApplicationFactory<DrawPad> ) |