-rw-r--r-- | korganizer/koagenda.cpp | 169 |
1 files changed, 90 insertions, 79 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 1d4d6de..fe59787 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -24,22 +24,33 @@ | |||
24 | without including the source code for Qt in the source distribution. | 24 | without including the source code for Qt in the source distribution. |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #ifndef _WIN32_ | 27 | #ifndef _WIN32_ |
28 | #define protected public | 28 | #define protected public |
29 | #include <qwidget.h> | 29 | #include <qwidget.h> |
30 | #undef protected | 30 | #undef protected |
31 | #endif | 31 | #endif |
32 | #include <qintdict.h> | 32 | #include <q3intdict.h> |
33 | #include <qdatetime.h> | 33 | #include <qdatetime.h> |
34 | #include <qapplication.h> | 34 | #include <qapplication.h> |
35 | #include <qpopupmenu.h> | 35 | #include <q3popupmenu.h> |
36 | #include <qcursor.h> | 36 | #include <qcursor.h> |
37 | #include <qpainter.h> | 37 | #include <qpainter.h> |
38 | #include <QDesktopWidget> | ||
39 | //Added by qt3to4: | ||
40 | #include <QResizeEvent> | ||
41 | #include <QLabel> | ||
42 | #include <QPixmap> | ||
43 | #include <QMouseEvent> | ||
44 | #include <QKeyEvent> | ||
45 | #include <Q3MemArray> | ||
46 | #include <QEvent> | ||
47 | #include <Q3Frame> | ||
48 | #include <Q3PtrList> | ||
38 | 49 | ||
39 | #include <kdebug.h> | 50 | #include <kdebug.h> |
40 | #include <klocale.h> | 51 | #include <klocale.h> |
41 | #include <kiconloader.h> | 52 | #include <kiconloader.h> |
42 | #include <kglobal.h> | 53 | #include <kglobal.h> |
43 | 54 | ||
44 | #include "koagendaitem.h" | 55 | #include "koagendaitem.h" |
45 | #include "koprefs.h" | 56 | #include "koprefs.h" |
@@ -58,17 +69,17 @@ | |||
58 | extern int globalFlagBlockAgenda; | 69 | extern int globalFlagBlockAgenda; |
59 | extern int globalFlagBlockAgendaItemPaint; | 70 | extern int globalFlagBlockAgendaItemPaint; |
60 | extern int globalFlagBlockAgendaItemUpdate; | 71 | extern int globalFlagBlockAgendaItemUpdate; |
61 | extern int globalFlagBlockStartup; | 72 | extern int globalFlagBlockStartup; |
62 | 73 | ||
63 | 74 | ||
64 | //////////////////////////////////////////////////////////////////////////// | 75 | //////////////////////////////////////////////////////////////////////////// |
65 | MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name) | 76 | MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name) |
66 | : QFrame(_agenda->viewport(),name), agenda(_agenda) | 77 | : Q3Frame(_agenda->viewport(),name), agenda(_agenda) |
67 | { | 78 | { |
68 | setLineWidth(0); | 79 | setLineWidth(0); |
69 | setMargin(0); | 80 | setMargin(0); |
70 | setBackgroundColor(Qt::red); | 81 | setBackgroundColor(Qt::red); |
71 | minutes = new QTimer(this); | 82 | minutes = new QTimer(this); |
72 | connect(minutes, SIGNAL(timeout()), this, SLOT(updateLoc())); | 83 | connect(minutes, SIGNAL(timeout()), this, SLOT(updateLoc())); |
73 | minutes->start(0, true); | 84 | minutes->start(0, true); |
74 | mTimeBox = new QLabel(this); | 85 | mTimeBox = new QLabel(this); |
@@ -164,18 +175,18 @@ void MarcusBains::updateLocation(bool recalculate) | |||
164 | 175 | ||
165 | //////////////////////////////////////////////////////////////////////////// | 176 | //////////////////////////////////////////////////////////////////////////// |
166 | 177 | ||
167 | 178 | ||
168 | /* | 179 | /* |
169 | Create an agenda widget with rows rows and columns columns. | 180 | Create an agenda widget with rows rows and columns columns. |
170 | */ | 181 | */ |
171 | KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, | 182 | KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, |
172 | const char *name,WFlags f) : | 183 | const char *name,Qt::WFlags f) : |
173 | QScrollView(parent,name,f) | 184 | Q3ScrollView(parent,name,f) |
174 | { | 185 | { |
175 | 186 | ||
176 | mAllAgendaPopup = 0; | 187 | mAllAgendaPopup = 0; |
177 | mColumns = columns; | 188 | mColumns = columns; |
178 | mRows = rows; | 189 | mRows = rows; |
179 | mGridSpacingY = rowSize; | 190 | mGridSpacingY = rowSize; |
180 | mAllDayMode = false; | 191 | mAllDayMode = false; |
181 | #ifndef DESKTOP_VERSION | 192 | #ifndef DESKTOP_VERSION |
@@ -185,18 +196,18 @@ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, | |||
185 | init(); | 196 | init(); |
186 | connect ( this, SIGNAL (contentsMoving ( int , int ) ), this, SLOT ( slotContentMove(int,int)) ); | 197 | connect ( this, SIGNAL (contentsMoving ( int , int ) ), this, SLOT ( slotContentMove(int,int)) ); |
187 | } | 198 | } |
188 | 199 | ||
189 | /* | 200 | /* |
190 | Create an agenda widget with columns columns and one row. This is used for | 201 | Create an agenda widget with columns columns and one row. This is used for |
191 | all-day events. | 202 | all-day events. |
192 | */ | 203 | */ |
193 | KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) : | 204 | KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,Qt::WFlags f) : |
194 | QScrollView(parent,name,f) | 205 | Q3ScrollView(parent,name,f) |
195 | { | 206 | { |
196 | mAllAgendaPopup = 0; | 207 | mAllAgendaPopup = 0; |
197 | blockResize = false; | 208 | blockResize = false; |
198 | mColumns = columns; | 209 | mColumns = columns; |
199 | mRows = 1; | 210 | mRows = 1; |
200 | //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize); | 211 | //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize); |
201 | mGridSpacingY = KOPrefs::instance()->mAllDaySize; | 212 | mGridSpacingY = KOPrefs::instance()->mAllDaySize; |
202 | mAllDayMode = true; | 213 | mAllDayMode = true; |
@@ -226,49 +237,49 @@ QDate KOAgenda::selectedIncidenceDate() const | |||
226 | } | 237 | } |
227 | 238 | ||
228 | 239 | ||
229 | void KOAgenda::init() | 240 | void KOAgenda::init() |
230 | { | 241 | { |
231 | mPopupTimer = new QTimer(this); | 242 | mPopupTimer = new QTimer(this); |
232 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); | 243 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); |
233 | 244 | ||
234 | mNewItemPopup = new QPopupMenu( this ); | 245 | mNewItemPopup = new Q3PopupMenu( this ); |
235 | connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) ); | 246 | connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) ); |
236 | QString pathString = ""; | 247 | QString pathString = ""; |
237 | if ( !KOPrefs::instance()->mToolBarMiniIcons ) { | 248 | if ( !KOPrefs::instance()->mToolBarMiniIcons ) { |
238 | if ( QApplication::desktop()->width() < 480 ) | 249 | if ( QApplication::desktop()->width() < 480 ) |
239 | pathString += "icons16/"; | 250 | pathString += "icons16/"; |
240 | } else | 251 | } else |
241 | pathString += "iconsmini/"; | 252 | pathString += "iconsmini/"; |
242 | 253 | ||
243 | mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 ); | 254 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 ); |
244 | mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 ); | 255 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 ); |
245 | mNewItemPopup->insertSeparator ( ); | 256 | mNewItemPopup->insertSeparator ( ); |
246 | mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); | 257 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"day" ), i18n("Day view"),3 ); |
247 | mNewItemPopup->insertItem ( SmallIcon( pathString +"xdays" ), i18n("Next days"),8 ); | 258 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"xdays" ), i18n("Next days"),8 ); |
248 | mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next week"),4 ); | 259 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"week" ), i18n("Next week"),4 ); |
249 | mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 ); | 260 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 ); |
250 | mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("This month"),6 ); | 261 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"month" ), i18n("This month"),6 ); |
251 | mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); | 262 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); |
252 | #ifndef _WIN32_ | 263 | #ifndef _WIN32_ |
253 | int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase | 264 | Qt::WindowFlags wflags = viewport()-> windowFlags() |Qt::WRepaintNoErase;//WResizeNoErase |
254 | viewport()->setWFlags ( wflags); | 265 | viewport()->setWindowFlags ( wflags); |
255 | #endif | 266 | #endif |
256 | mGridSpacingX = 80; | 267 | mGridSpacingX = 80; |
257 | mResizeBorderWidth = 8; | 268 | mResizeBorderWidth = 8; |
258 | mScrollBorderWidth = 8; | 269 | mScrollBorderWidth = 8; |
259 | mScrollDelay = 30; | 270 | mScrollDelay = 30; |
260 | mScrollOffset = 10; | 271 | mScrollOffset = 10; |
261 | mPaintPixmap.resize( 20,20); | 272 | mPaintPixmap.resize( 20,20); |
262 | //enableClipper(true); | 273 | //enableClipper(true); |
263 | 274 | ||
264 | // Grab key strokes for keyboard navigation of agenda. Seems to have no | 275 | // Grab key strokes for keyboard navigation of agenda. Seems to have no |
265 | // effect. Has to be fixed. | 276 | // effect. Has to be fixed. |
266 | setFocusPolicy(WheelFocus); | 277 | setFocusPolicy(Qt::WheelFocus); |
267 | 278 | ||
268 | connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp())); | 279 | connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp())); |
269 | connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown())); | 280 | connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown())); |
270 | connect(&mResizeTimer,SIGNAL(timeout()),SLOT(finishResize())); | 281 | connect(&mResizeTimer,SIGNAL(timeout()),SLOT(finishResize())); |
271 | 282 | ||
272 | mStartCellX = 0; | 283 | mStartCellX = 0; |
273 | mStartCellY = 0; | 284 | mStartCellY = 0; |
274 | mCurrentCellX = 0; | 285 | mCurrentCellX = 0; |
@@ -390,21 +401,21 @@ bool KOAgenda::eventFilter ( QObject *object, QEvent *event ) | |||
390 | case QEvent::MouseButtonPress: | 401 | case QEvent::MouseButtonPress: |
391 | case QEvent::MouseButtonDblClick: | 402 | case QEvent::MouseButtonDblClick: |
392 | case QEvent::MouseButtonRelease: | 403 | case QEvent::MouseButtonRelease: |
393 | case QEvent::MouseMove: | 404 | case QEvent::MouseMove: |
394 | return eventFilter_mouse(object, static_cast<QMouseEvent *>(event)); | 405 | return eventFilter_mouse(object, static_cast<QMouseEvent *>(event)); |
395 | 406 | ||
396 | case (QEvent::Leave): | 407 | case (QEvent::Leave): |
397 | if (!mActionItem) | 408 | if (!mActionItem) |
398 | setCursor(arrowCursor); | 409 | setCursor(Qt::arrowCursor); |
399 | return true; | 410 | return true; |
400 | 411 | ||
401 | default: | 412 | default: |
402 | return QScrollView::eventFilter(object,event); | 413 | return Q3ScrollView::eventFilter(object,event); |
403 | } | 414 | } |
404 | } | 415 | } |
405 | void KOAgenda::popupMenu() | 416 | void KOAgenda::popupMenu() |
406 | { | 417 | { |
407 | mPopupTimer->stop(); | 418 | mPopupTimer->stop(); |
408 | if ( mPopupKind == 1 || mPopupKind == 3 ) { | 419 | if ( mPopupKind == 1 || mPopupKind == 3 ) { |
409 | if (mActionItem ) { | 420 | if (mActionItem ) { |
410 | endItemAction(); | 421 | endItemAction(); |
@@ -500,21 +511,21 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
500 | blockmoveDist = blockmoveDist*2; | 511 | blockmoveDist = blockmoveDist*2; |
501 | viewportPos = ((QWidget *)object)->mapToParent(me->pos()); | 512 | viewportPos = ((QWidget *)object)->mapToParent(me->pos()); |
502 | } else { | 513 | } else { |
503 | viewportPos = me->pos(); | 514 | viewportPos = me->pos(); |
504 | } | 515 | } |
505 | bool objIsNotViewport = (object != viewport()); | 516 | bool objIsNotViewport = (object != viewport()); |
506 | bool leftButt = false; | 517 | bool leftButt = false; |
507 | #ifdef DESKTOP_VERSION | 518 | #ifdef DESKTOP_VERSION |
508 | leftButt = (me->button() == LeftButton); | 519 | leftButt = (me->button() == Qt::LeftButton); |
509 | #endif | 520 | #endif |
510 | switch (me->type()) { | 521 | switch (me->type()) { |
511 | case QEvent::MouseButtonPress: | 522 | case QEvent::MouseButtonPress: |
512 | if (me->button() == LeftButton) { | 523 | if (me->button() == Qt::LeftButton) { |
513 | mPopupTimer->start( 600 ); | 524 | mPopupTimer->start( 600 ); |
514 | mLeftMouseDown = true; | 525 | mLeftMouseDown = true; |
515 | } | 526 | } |
516 | blockMoving = true; | 527 | blockMoving = true; |
517 | startX = viewportPos.x(); | 528 | startX = viewportPos.x(); |
518 | startY = viewportPos.y(); | 529 | startY = viewportPos.y(); |
519 | mPopupPos = me->globalPos(); | 530 | mPopupPos = me->globalPos(); |
520 | if ( objIsNotViewport && !leftButt ) { | 531 | if ( objIsNotViewport && !leftButt ) { |
@@ -573,20 +584,20 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
573 | } | 584 | } |
574 | } | 585 | } |
575 | } | 586 | } |
576 | } | 587 | } |
577 | } | 588 | } |
578 | if ( objIsNotViewport ) { | 589 | if ( objIsNotViewport ) { |
579 | mPopupItem = (KOAgendaItem *)object; | 590 | mPopupItem = (KOAgendaItem *)object; |
580 | mPopupKind = 1; | 591 | mPopupKind = 1; |
581 | if (me->button() == RightButton) { | 592 | if (me->button() == Qt::RightButton) { |
582 | mPopupKind = 3; | 593 | mPopupKind = 3; |
583 | popupMenu(); | 594 | popupMenu(); |
584 | } else if (me->button() == LeftButton) { | 595 | } else if (me->button() == Qt::LeftButton) { |
585 | mActionItem = (KOAgendaItem *)object; | 596 | mActionItem = (KOAgendaItem *)object; |
586 | if (mActionItem) { | 597 | if (mActionItem) { |
587 | emit signalClearSelection(); | 598 | emit signalClearSelection(); |
588 | slotClearSelection(); | 599 | slotClearSelection(); |
589 | selectItem(mActionItem); | 600 | selectItem(mActionItem); |
590 | Incidence *incidence = mActionItem->incidence(); | 601 | Incidence *incidence = mActionItem->incidence(); |
591 | if ( incidence->isReadOnly() /*|| incidence->doesRecur() */) { | 602 | if ( incidence->isReadOnly() /*|| incidence->doesRecur() */) { |
592 | mActionItem = 0; | 603 | mActionItem = 0; |
@@ -595,66 +606,66 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
595 | } | 606 | } |
596 | } | 607 | } |
597 | } | 608 | } |
598 | } else { // ---------- viewport() | 609 | } else { // ---------- viewport() |
599 | mPopupItem = 0; | 610 | mPopupItem = 0; |
600 | mPopupKind = 2; | 611 | mPopupKind = 2; |
601 | selectItem(0); | 612 | selectItem(0); |
602 | mActionItem = 0; | 613 | mActionItem = 0; |
603 | if (me->button() == RightButton) { | 614 | if (me->button() == Qt::RightButton) { |
604 | int x,y; | 615 | int x,y; |
605 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 616 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
606 | int gx,gy; | 617 | int gx,gy; |
607 | contentsToGrid(x,y,gx,gy); | 618 | contentsToGrid(x,y,gx,gy); |
608 | mCurrentCellX = gx; | 619 | mCurrentCellX = gx; |
609 | mCurrentCellY = gy; | 620 | mCurrentCellY = gy; |
610 | mStartCellX = gx; | 621 | mStartCellX = gx; |
611 | mStartCellY = gy; | 622 | mStartCellY = gy; |
612 | mPopupKind = 4; | 623 | mPopupKind = 4; |
613 | popupMenu(); | 624 | popupMenu(); |
614 | } else if (me->button() == LeftButton) { | 625 | } else if (me->button() == Qt::LeftButton) { |
615 | setCursor(arrowCursor); | 626 | setCursor(Qt::arrowCursor); |
616 | startSelectAction(viewportPos); | 627 | startSelectAction(viewportPos); |
617 | } | 628 | } |
618 | } | 629 | } |
619 | break; | 630 | break; |
620 | 631 | ||
621 | case QEvent::MouseButtonRelease: | 632 | case QEvent::MouseButtonRelease: |
622 | if (me->button() == LeftButton ) { | 633 | if (me->button() == Qt::LeftButton ) { |
623 | mPopupTimer->stop(); | 634 | mPopupTimer->stop(); |
624 | } | 635 | } |
625 | if (object != viewport()) { | 636 | if (object != viewport()) { |
626 | if (me->button() == LeftButton && mLeftMouseDown) { | 637 | if (me->button() == Qt::LeftButton && mLeftMouseDown) { |
627 | if (mActionItem) { | 638 | if (mActionItem) { |
628 | QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); | 639 | QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); |
629 | //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); | 640 | //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); |
630 | if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { | 641 | if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { |
631 | mScrollUpTimer.stop(); | 642 | mScrollUpTimer.stop(); |
632 | mScrollDownTimer.stop(); | 643 | mScrollDownTimer.stop(); |
633 | mActionItem->resetMove(); | 644 | mActionItem->resetMove(); |
634 | placeSubCells( mActionItem ); | 645 | placeSubCells( mActionItem ); |
635 | // emit startDragSignal( mActionItem->incidence() ); | 646 | // emit startDragSignal( mActionItem->incidence() ); |
636 | setCursor( arrowCursor ); | 647 | setCursor( Qt::arrowCursor ); |
637 | mActionItem = 0; | 648 | mActionItem = 0; |
638 | mActionType = NOP; | 649 | mActionType = NOP; |
639 | mItemMoved = 0; | 650 | mItemMoved = 0; |
640 | mLeftMouseDown = false; | 651 | mLeftMouseDown = false; |
641 | return true; | 652 | return true; |
642 | } | 653 | } |
643 | endItemAction(); | 654 | endItemAction(); |
644 | } | 655 | } |
645 | } | 656 | } |
646 | 657 | ||
647 | } else { // ---------- viewport() | 658 | } else { // ---------- viewport() |
648 | if (me->button() == LeftButton && mLeftMouseDown ) { //left click | 659 | if (me->button() == Qt::LeftButton && mLeftMouseDown ) { //left click |
649 | endSelectAction( true ); // emit new event signal | 660 | endSelectAction( true ); // emit new event signal |
650 | } | 661 | } |
651 | } | 662 | } |
652 | if (me->button() == LeftButton) | 663 | if (me->button() == Qt::LeftButton) |
653 | mLeftMouseDown = false; | 664 | mLeftMouseDown = false; |
654 | 665 | ||
655 | break; | 666 | break; |
656 | 667 | ||
657 | case QEvent::MouseMove: | 668 | case QEvent::MouseMove: |
658 | //qDebug("mm "); | 669 | //qDebug("mm "); |
659 | if ( !mLeftMouseDown ) | 670 | if ( !mLeftMouseDown ) |
660 | return false; | 671 | return false; |
@@ -845,42 +856,42 @@ void KOAgenda::startItemAction(QPoint viewportPos) | |||
845 | mCurrentCellY = gy; | 856 | mCurrentCellY = gy; |
846 | bool allowResize = ( mActionItem->incidence()->typeID() != todoID ); | 857 | bool allowResize = ( mActionItem->incidence()->typeID() != todoID ); |
847 | 858 | ||
848 | if (mAllDayMode) { | 859 | if (mAllDayMode) { |
849 | int gridDistanceX = (x - gx * mGridSpacingX); | 860 | int gridDistanceX = (x - gx * mGridSpacingX); |
850 | if ( allowResize && gridDistanceX < mResizeBorderWidth && | 861 | if ( allowResize && gridDistanceX < mResizeBorderWidth && |
851 | mActionItem->cellX() == mCurrentCellX) { | 862 | mActionItem->cellX() == mCurrentCellX) { |
852 | mActionType = RESIZELEFT; | 863 | mActionType = RESIZELEFT; |
853 | setCursor(sizeHorCursor); | 864 | setCursor(Qt::sizeHorCursor); |
854 | } else if ( allowResize && (mGridSpacingX - gridDistanceX) < mResizeBorderWidth && | 865 | } else if ( allowResize && (mGridSpacingX - gridDistanceX) < mResizeBorderWidth && |
855 | mActionItem->cellXWidth() == mCurrentCellX) { | 866 | mActionItem->cellXWidth() == mCurrentCellX) { |
856 | mActionType = RESIZERIGHT; | 867 | mActionType = RESIZERIGHT; |
857 | setCursor(sizeHorCursor); | 868 | setCursor(Qt::sizeHorCursor); |
858 | } else { | 869 | } else { |
859 | mActionType = MOVE; | 870 | mActionType = MOVE; |
860 | mActionItem->startMove(); | 871 | mActionItem->startMove(); |
861 | setCursor(sizeAllCursor); | 872 | setCursor(Qt::sizeAllCursor); |
862 | } | 873 | } |
863 | } else { | 874 | } else { |
864 | int gridDistanceY = (y - gy * mGridSpacingY); | 875 | int gridDistanceY = (y - gy * mGridSpacingY); |
865 | if (allowResize && gridDistanceY < mResizeBorderWidth && | 876 | if (allowResize && gridDistanceY < mResizeBorderWidth && |
866 | mActionItem->cellYTop() == mCurrentCellY && | 877 | mActionItem->cellYTop() == mCurrentCellY && |
867 | !mActionItem->firstMultiItem()) { | 878 | !mActionItem->firstMultiItem()) { |
868 | mActionType = RESIZETOP; | 879 | mActionType = RESIZETOP; |
869 | setCursor(sizeVerCursor); | 880 | setCursor(Qt::sizeVerCursor); |
870 | } else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth && | 881 | } else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth && |
871 | mActionItem->cellYBottom() == mCurrentCellY && | 882 | mActionItem->cellYBottom() == mCurrentCellY && |
872 | !mActionItem->lastMultiItem()) { | 883 | !mActionItem->lastMultiItem()) { |
873 | mActionType = RESIZEBOTTOM; | 884 | mActionType = RESIZEBOTTOM; |
874 | setCursor(sizeVerCursor); | 885 | setCursor(Qt::sizeVerCursor); |
875 | } else { | 886 | } else { |
876 | mActionType = MOVE; | 887 | mActionType = MOVE; |
877 | mActionItem->startMove(); | 888 | mActionItem->startMove(); |
878 | setCursor(sizeAllCursor); | 889 | setCursor(Qt::sizeAllCursor); |
879 | } | 890 | } |
880 | } | 891 | } |
881 | } | 892 | } |
882 | 893 | ||
883 | void KOAgenda::performItemAction(QPoint viewportPos) | 894 | void KOAgenda::performItemAction(QPoint viewportPos) |
884 | { | 895 | { |
885 | // kdDebug() << "viewportPos: " << viewportPos.x() << "," << viewportPos.y() << endl; | 896 | // kdDebug() << "viewportPos: " << viewportPos.x() << "," << viewportPos.y() << endl; |
886 | // QPoint point = viewport()->mapToGlobal(viewportPos); | 897 | // QPoint point = viewport()->mapToGlobal(viewportPos); |
@@ -901,37 +912,37 @@ void KOAgenda::performItemAction(QPoint viewportPos) | |||
901 | if ( /*clipperPos.y() < 0 || clipperPos.y() > visibleHeight() ||*/ | 912 | if ( /*clipperPos.y() < 0 || clipperPos.y() > visibleHeight() ||*/ |
902 | clipperPos.x() < 0 || clipperPos.x() > visibleWidth() ) { | 913 | clipperPos.x() < 0 || clipperPos.x() > visibleWidth() ) { |
903 | if ( mActionType == MOVE ) { | 914 | if ( mActionType == MOVE ) { |
904 | mScrollUpTimer.stop(); | 915 | mScrollUpTimer.stop(); |
905 | mScrollDownTimer.stop(); | 916 | mScrollDownTimer.stop(); |
906 | mActionItem->resetMove(); | 917 | mActionItem->resetMove(); |
907 | placeSubCells( mActionItem ); | 918 | placeSubCells( mActionItem ); |
908 | // emit startDragSignal( mActionItem->incidence() ); | 919 | // emit startDragSignal( mActionItem->incidence() ); |
909 | setCursor( arrowCursor ); | 920 | setCursor( Qt::arrowCursor ); |
910 | mActionItem = 0; | 921 | mActionItem = 0; |
911 | mActionType = NOP; | 922 | mActionType = NOP; |
912 | mItemMoved = 0; | 923 | mItemMoved = 0; |
913 | return; | 924 | return; |
914 | } | 925 | } |
915 | } else { | 926 | } else { |
916 | switch ( mActionType ) { | 927 | switch ( mActionType ) { |
917 | case MOVE: | 928 | case MOVE: |
918 | setCursor( sizeAllCursor ); | 929 | setCursor( Qt::sizeAllCursor ); |
919 | break; | 930 | break; |
920 | case RESIZETOP: | 931 | case RESIZETOP: |
921 | case RESIZEBOTTOM: | 932 | case RESIZEBOTTOM: |
922 | setCursor( sizeVerCursor ); | 933 | setCursor( Qt::sizeVerCursor ); |
923 | break; | 934 | break; |
924 | case RESIZELEFT: | 935 | case RESIZELEFT: |
925 | case RESIZERIGHT: | 936 | case RESIZERIGHT: |
926 | setCursor( sizeHorCursor ); | 937 | setCursor( Qt::sizeHorCursor ); |
927 | break; | 938 | break; |
928 | default: | 939 | default: |
929 | setCursor( arrowCursor ); | 940 | setCursor( Qt::arrowCursor ); |
930 | } | 941 | } |
931 | } | 942 | } |
932 | 943 | ||
933 | // Scroll if item was moved to upper or lower end of agenda. | 944 | // Scroll if item was moved to upper or lower end of agenda. |
934 | if (clipperPos.y() < mScrollBorderWidth) { | 945 | if (clipperPos.y() < mScrollBorderWidth) { |
935 | mScrollUpTimer.start(mScrollDelay); | 946 | mScrollUpTimer.start(mScrollDelay); |
936 | } else if (visibleHeight() - clipperPos.y() < | 947 | } else if (visibleHeight() - clipperPos.y() < |
937 | mScrollBorderWidth) { | 948 | mScrollBorderWidth) { |
@@ -966,17 +977,17 @@ void KOAgenda::performItemAction(QPoint viewportPos) | |||
966 | } else if (mActionType == RESIZETOP) { | 977 | } else if (mActionType == RESIZETOP) { |
967 | if (mCurrentCellY <= mActionItem->cellYBottom()) { | 978 | if (mCurrentCellY <= mActionItem->cellYBottom()) { |
968 | mActionItem->expandTop(gy - mCurrentCellY); | 979 | mActionItem->expandTop(gy - mCurrentCellY); |
969 | mActionItem->resize(mActionItem->width(), | 980 | mActionItem->resize(mActionItem->width(), |
970 | mGridSpacingY * mActionItem->cellHeight()); | 981 | mGridSpacingY * mActionItem->cellHeight()); |
971 | int x,y; | 982 | int x,y; |
972 | gridToContents(mCurrentCellX,mActionItem->cellYTop(),x,y); | 983 | gridToContents(mCurrentCellX,mActionItem->cellYTop(),x,y); |
973 | //moveChild(mActionItem,childX(mActionItem),y); | 984 | //moveChild(mActionItem,childX(mActionItem),y); |
974 | QScrollView::moveChild( mActionItem,childX(mActionItem),y ); | 985 | Q3ScrollView::moveChild( mActionItem,childX(mActionItem),y ); |
975 | } | 986 | } |
976 | } else if (mActionType == RESIZEBOTTOM) { | 987 | } else if (mActionType == RESIZEBOTTOM) { |
977 | if (mCurrentCellY >= mActionItem->cellYTop()) { | 988 | if (mCurrentCellY >= mActionItem->cellYTop()) { |
978 | mActionItem->expandBottom(gy - mCurrentCellY); | 989 | mActionItem->expandBottom(gy - mCurrentCellY); |
979 | mActionItem->resize(mActionItem->width(), | 990 | mActionItem->resize(mActionItem->width(), |
980 | mGridSpacingY * mActionItem->cellHeight()); | 991 | mGridSpacingY * mActionItem->cellHeight()); |
981 | } | 992 | } |
982 | } else if (mActionType == RESIZELEFT) { | 993 | } else if (mActionType == RESIZELEFT) { |
@@ -1014,17 +1025,17 @@ void KOAgenda::endItemAction() | |||
1014 | placeItem->recreateIncidence(); | 1025 | placeItem->recreateIncidence(); |
1015 | emit addToCalSignal(placeItem->incidence(), oldInc ); | 1026 | emit addToCalSignal(placeItem->incidence(), oldInc ); |
1016 | } | 1027 | } |
1017 | int type = mActionType; | 1028 | int type = mActionType; |
1018 | if ( mAllDayMode ) | 1029 | if ( mAllDayMode ) |
1019 | type = -1; | 1030 | type = -1; |
1020 | KOAgendaItem *modifiedItem = placeItem; | 1031 | KOAgendaItem *modifiedItem = placeItem; |
1021 | //emit itemModified( placeItem, mActionType /*KOGlobals::EVENTEDITED */); | 1032 | //emit itemModified( placeItem, mActionType /*KOGlobals::EVENTEDITED */); |
1022 | QPtrList<KOAgendaItem> oldconflictItems ;//= placeItem->conflictItems(); | 1033 | Q3PtrList<KOAgendaItem> oldconflictItems ;//= placeItem->conflictItems(); |
1023 | KOAgendaItem *item; | 1034 | KOAgendaItem *item; |
1024 | 1035 | ||
1025 | if ( placeItem->incidence()->typeID() == todoID ) { | 1036 | if ( placeItem->incidence()->typeID() == todoID ) { |
1026 | mSelectedItem = 0; | 1037 | mSelectedItem = 0; |
1027 | //qDebug("todo %d %d %d ", mCurrentCellX, modifiedItem->cellX() ,modifiedItem->cellXWidth()); | 1038 | //qDebug("todo %d %d %d ", mCurrentCellX, modifiedItem->cellX() ,modifiedItem->cellXWidth()); |
1028 | modifiedItem->mLastMoveXPos = mCurrentCellX; | 1039 | modifiedItem->mLastMoveXPos = mCurrentCellX; |
1029 | emit itemModified( modifiedItem, mActionType ); | 1040 | emit itemModified( modifiedItem, mActionType ); |
1030 | } | 1041 | } |
@@ -1105,17 +1116,17 @@ void KOAgenda::endItemAction() | |||
1105 | 1116 | ||
1106 | } | 1117 | } |
1107 | 1118 | ||
1108 | } | 1119 | } |
1109 | if ( mActionItem ) | 1120 | if ( mActionItem ) |
1110 | emit incidenceSelected( mActionItem->incidence() ); | 1121 | emit incidenceSelected( mActionItem->incidence() ); |
1111 | mScrollUpTimer.stop(); | 1122 | mScrollUpTimer.stop(); |
1112 | mScrollDownTimer.stop(); | 1123 | mScrollDownTimer.stop(); |
1113 | setCursor( arrowCursor ); | 1124 | setCursor( Qt::arrowCursor ); |
1114 | mActionItem = 0; | 1125 | mActionItem = 0; |
1115 | mActionType = NOP; | 1126 | mActionType = NOP; |
1116 | mItemMoved = 0; | 1127 | mItemMoved = 0; |
1117 | 1128 | ||
1118 | } | 1129 | } |
1119 | 1130 | ||
1120 | void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos) | 1131 | void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos) |
1121 | { | 1132 | { |
@@ -1131,35 +1142,35 @@ void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos) | |||
1131 | int gx,gy; | 1142 | int gx,gy; |
1132 | contentsToGrid(x,y,gx,gy); | 1143 | contentsToGrid(x,y,gx,gy); |
1133 | 1144 | ||
1134 | // Change cursor to resize cursor if appropriate | 1145 | // Change cursor to resize cursor if appropriate |
1135 | if (mAllDayMode) { | 1146 | if (mAllDayMode) { |
1136 | int gridDistanceX = (x - gx * mGridSpacingX); | 1147 | int gridDistanceX = (x - gx * mGridSpacingX); |
1137 | if (gridDistanceX < mResizeBorderWidth && | 1148 | if (gridDistanceX < mResizeBorderWidth && |
1138 | moveItem->cellX() == gx) { | 1149 | moveItem->cellX() == gx) { |
1139 | setCursor(sizeHorCursor); | 1150 | setCursor(Qt::sizeHorCursor); |
1140 | } else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth && | 1151 | } else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth && |
1141 | moveItem->cellXWidth() == gx) { | 1152 | moveItem->cellXWidth() == gx) { |
1142 | setCursor(sizeHorCursor); | 1153 | setCursor(Qt::sizeHorCursor); |
1143 | } else { | 1154 | } else { |
1144 | setCursor(arrowCursor); | 1155 | setCursor(Qt::arrowCursor); |
1145 | } | 1156 | } |
1146 | } else { | 1157 | } else { |
1147 | int gridDistanceY = (y - gy * mGridSpacingY); | 1158 | int gridDistanceY = (y - gy * mGridSpacingY); |
1148 | if (gridDistanceY < mResizeBorderWidth && | 1159 | if (gridDistanceY < mResizeBorderWidth && |
1149 | moveItem->cellYTop() == gy && | 1160 | moveItem->cellYTop() == gy && |
1150 | !moveItem->firstMultiItem()) { | 1161 | !moveItem->firstMultiItem()) { |
1151 | setCursor(sizeVerCursor); | 1162 | setCursor(Qt::sizeVerCursor); |
1152 | } else if ((mGridSpacingY - gridDistanceY) < mResizeBorderWidth && | 1163 | } else if ((mGridSpacingY - gridDistanceY) < mResizeBorderWidth && |
1153 | moveItem->cellYBottom() == gy && | 1164 | moveItem->cellYBottom() == gy && |
1154 | !moveItem->lastMultiItem()) { | 1165 | !moveItem->lastMultiItem()) { |
1155 | setCursor(sizeVerCursor); | 1166 | setCursor(Qt::sizeVerCursor); |
1156 | } else { | 1167 | } else { |
1157 | setCursor(arrowCursor); | 1168 | setCursor(Qt::arrowCursor); |
1158 | } | 1169 | } |
1159 | } | 1170 | } |
1160 | } | 1171 | } |
1161 | 1172 | ||
1162 | 1173 | ||
1163 | /* | 1174 | /* |
1164 | Place item in cell and take care that multiple items using the same cell do | 1175 | Place item in cell and take care that multiple items using the same cell do |
1165 | not overlap. This method is not yet optimal. It doesn´t use the maximum space | 1176 | not overlap. This method is not yet optimal. It doesn´t use the maximum space |
@@ -1168,19 +1179,19 @@ void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos) | |||
1168 | widths of the items are changed, which are within the Y region the item to | 1179 | widths of the items are changed, which are within the Y region the item to |
1169 | place spans. When the sub cell width change of one of this items affects a | 1180 | place spans. When the sub cell width change of one of this items affects a |
1170 | cell, where other items are, which do not overlap in Y with the item to place, | 1181 | cell, where other items are, which do not overlap in Y with the item to place, |
1171 | the display gets corrupted, although the corruption looks quite nice. | 1182 | the display gets corrupted, although the corruption looks quite nice. |
1172 | */ | 1183 | */ |
1173 | void KOAgenda::placeSubCells(KOAgendaItem *placeItem) | 1184 | void KOAgenda::placeSubCells(KOAgendaItem *placeItem) |
1174 | { | 1185 | { |
1175 | 1186 | ||
1176 | QPtrList<KOAgendaItem> conflictItems; | 1187 | Q3PtrList<KOAgendaItem> conflictItems; |
1177 | int maxSubCells = 0; | 1188 | int maxSubCells = 0; |
1178 | QIntDict<KOAgendaItem> subCellDict(7); | 1189 | Q3IntDict<KOAgendaItem> subCellDict(7); |
1179 | 1190 | ||
1180 | KOAgendaItem *item; | 1191 | KOAgendaItem *item; |
1181 | for ( item=mItems.first(); item != 0; item=mItems.next() ) { | 1192 | for ( item=mItems.first(); item != 0; item=mItems.next() ) { |
1182 | if (item != placeItem) { | 1193 | if (item != placeItem) { |
1183 | if (placeItem->cellX() <= item->cellXWidth() && | 1194 | if (placeItem->cellX() <= item->cellXWidth() && |
1184 | placeItem->cellXWidth() >= item->cellX()) { | 1195 | placeItem->cellXWidth() >= item->cellX()) { |
1185 | if ((placeItem->cellYTop() <= item->cellYBottom()) && | 1196 | if ((placeItem->cellYTop() <= item->cellYBottom()) && |
1186 | (placeItem->cellYBottom() >= item->cellYTop())) { | 1197 | (placeItem->cellYBottom() >= item->cellYTop())) { |
@@ -1235,17 +1246,17 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) | |||
1235 | // qDebug("moveChild %s %d %d ", item->incidence()->summary().latin1() ,x,y); | 1246 | // qDebug("moveChild %s %d %d ", item->incidence()->summary().latin1() ,x,y); |
1236 | //item->updateItem(); | 1247 | //item->updateItem(); |
1237 | } | 1248 | } |
1238 | // Adjust sub cell geometry of all conflict items of all conflict items | 1249 | // Adjust sub cell geometry of all conflict items of all conflict items |
1239 | for ( item=conflictItems.first(); item != 0; | 1250 | for ( item=conflictItems.first(); item != 0; |
1240 | item=conflictItems.next() ) { | 1251 | item=conflictItems.next() ) { |
1241 | if ( placeItem != item ) { | 1252 | if ( placeItem != item ) { |
1242 | KOAgendaItem *item2; | 1253 | KOAgendaItem *item2; |
1243 | QPtrList<KOAgendaItem> conflictItems2 = item->conflictItems(); | 1254 | Q3PtrList<KOAgendaItem> conflictItems2 = item->conflictItems(); |
1244 | for ( item2=conflictItems2.first(); item2 != 0; | 1255 | for ( item2=conflictItems2.first(); item2 != 0; |
1245 | item2=conflictItems2.next() ) { | 1256 | item2=conflictItems2.next() ) { |
1246 | if ( item2->subCells() != maxSubCells) { | 1257 | if ( item2->subCells() != maxSubCells) { |
1247 | item2->setSubCells(maxSubCells); | 1258 | item2->setSubCells(maxSubCells); |
1248 | int diff = 0; | 1259 | int diff = 0; |
1249 | if (mAllDayMode) { | 1260 | if (mAllDayMode) { |
1250 | diff = item2->resizeMe(mGridSpacingX, item2->cellWidth() * mGridSpacingX, newSubCellWidth); | 1261 | diff = item2->resizeMe(mGridSpacingX, item2->cellWidth() * mGridSpacingX, newSubCellWidth); |
1251 | } else { | 1262 | } else { |
@@ -1320,34 +1331,34 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) | |||
1320 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) ) { | 1331 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) ) { |
1321 | 1332 | ||
1322 | int vxSel, vySel; | 1333 | int vxSel, vySel; |
1323 | contentsToViewport ( selectionX, mSelectionYTop, vxSel,vySel); | 1334 | contentsToViewport ( selectionX, mSelectionYTop, vxSel,vySel); |
1324 | int off = mSelectionHeight; | 1335 | int off = mSelectionHeight; |
1325 | if ( vySel < 0 ) | 1336 | if ( vySel < 0 ) |
1326 | off += vySel; | 1337 | off += vySel; |
1327 | //qDebug("OFF %d %d %d", off,vySel, vy ); | 1338 | //qDebug("OFF %d %d %d", off,vySel, vy ); |
1328 | bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,CopyROP); | 1339 | bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,QPainter::CompositionMode_Source); |
1329 | } else { | 1340 | } else { |
1330 | bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); | 1341 | bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,QPainter::CompositionMode_Source); |
1331 | } | 1342 | } |
1332 | } | 1343 | } |
1333 | if ( mSelectionHeight > 0 ) { | 1344 | if ( mSelectionHeight > 0 ) { |
1334 | //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); | 1345 | //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); |
1335 | if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && | 1346 | if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && |
1336 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { | 1347 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { |
1337 | contentsToViewport ( selectionX, mSelectionYTop, vx,vy); | 1348 | contentsToViewport ( selectionX, mSelectionYTop, vx,vy); |
1338 | // bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); | 1349 | // bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); |
1339 | int hei = mSelectionHeight; | 1350 | int hei = mSelectionHeight; |
1340 | int offset = 0; | 1351 | int offset = 0; |
1341 | while ( hei > 0 ) { | 1352 | while ( hei > 0 ) { |
1342 | int p_hei = 5; | 1353 | int p_hei = 5; |
1343 | if ( hei < 5 ) p_hei = hei; | 1354 | if ( hei < 5 ) p_hei = hei; |
1344 | hei -= 5; | 1355 | hei -= 5; |
1345 | bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP); | 1356 | bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,QPainter::CompositionMode_Source); |
1346 | offset += 5; | 1357 | offset += 5; |
1347 | } | 1358 | } |
1348 | } | 1359 | } |
1349 | } | 1360 | } |
1350 | p->begin( pd ); | 1361 | p->begin( pd ); |
1351 | } else { | 1362 | } else { |
1352 | #if 0 | 1363 | #if 0 |
1353 | qDebug("mCurPixWid %d %d ",mCurPixWid, contentsWidth() ); | 1364 | qDebug("mCurPixWid %d %d ",mCurPixWid, contentsWidth() ); |
@@ -1360,31 +1371,31 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) | |||
1360 | p->end(); | 1371 | p->end(); |
1361 | int vx, vy; | 1372 | int vx, vy; |
1362 | int selectionX = KOGlobals::self()->reverseLayout() ? | 1373 | int selectionX = KOGlobals::self()->reverseLayout() ? |
1363 | (mColumns - 1 - mSelectionCellX) * mGridSpacingX : | 1374 | (mColumns - 1 - mSelectionCellX) * mGridSpacingX : |
1364 | mSelectionCellX * mGridSpacingX; | 1375 | mSelectionCellX * mGridSpacingX; |
1365 | contentsToViewport ( cx, cy, vx,vy); | 1376 | contentsToViewport ( cx, cy, vx,vy); |
1366 | // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ; | 1377 | // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ; |
1367 | if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) | 1378 | if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) |
1368 | bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); | 1379 | bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,QPainter::CompositionMode_Source); |
1369 | 1380 | ||
1370 | if ( mSelectionHeight > 0 ) { | 1381 | if ( mSelectionHeight > 0 ) { |
1371 | //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); | 1382 | //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); |
1372 | if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && | 1383 | if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && |
1373 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { | 1384 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { |
1374 | contentsToViewport ( selectionX, mSelectionYTop, vx,vy); | 1385 | contentsToViewport ( selectionX, mSelectionYTop, vx,vy); |
1375 | //bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); | 1386 | //bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); |
1376 | int hei = mSelectionHeight; | 1387 | int hei = mSelectionHeight; |
1377 | int offset = 0; | 1388 | int offset = 0; |
1378 | while ( hei > 0 ) { | 1389 | while ( hei > 0 ) { |
1379 | int p_hei = 5; | 1390 | int p_hei = 5; |
1380 | if ( hei < 5 ) p_hei = hei; | 1391 | if ( hei < 5 ) p_hei = hei; |
1381 | hei -= 5; | 1392 | hei -= 5; |
1382 | bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP); | 1393 | bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,QPainter::CompositionMode_Source); |
1383 | offset += 5; | 1394 | offset += 5; |
1384 | } | 1395 | } |
1385 | } | 1396 | } |
1386 | } | 1397 | } |
1387 | p->begin( pd ); | 1398 | p->begin( pd ); |
1388 | } | 1399 | } |
1389 | 1400 | ||
1390 | } | 1401 | } |
@@ -1571,24 +1582,24 @@ void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// i | |||
1571 | p->drawLine(x,cy,x,cy+ch); | 1582 | p->drawLine(x,cy,x,cy+ch); |
1572 | x+=mGridSpacingX; | 1583 | x+=mGridSpacingX; |
1573 | } | 1584 | } |
1574 | } | 1585 | } |
1575 | // Draw horizontal lines of grid | 1586 | // Draw horizontal lines of grid |
1576 | int y = ((int)(cy/lGridSpacingY))*lGridSpacingY; | 1587 | int y = ((int)(cy/lGridSpacingY))*lGridSpacingY; |
1577 | if ( lGridSpacingY > 0 ) { | 1588 | if ( lGridSpacingY > 0 ) { |
1578 | while (y < cy + ch) { | 1589 | while (y < cy + ch) { |
1579 | p->setPen( SolidLine ); | 1590 | p->setPen( Qt::SolidLine ); |
1580 | p->drawLine(cx,y,cx+cw,y); | 1591 | p->drawLine(cx,y,cx+cw,y); |
1581 | y+=lGridSpacingY; | 1592 | y+=lGridSpacingY; |
1582 | p->setPen( DotLine ); | 1593 | p->setPen( Qt::DotLine ); |
1583 | p->drawLine(cx,y,cx+cw,y); | 1594 | p->drawLine(cx,y,cx+cw,y); |
1584 | y+=lGridSpacingY; | 1595 | y+=lGridSpacingY; |
1585 | } | 1596 | } |
1586 | p->setPen( SolidLine ); | 1597 | p->setPen( Qt::SolidLine ); |
1587 | } | 1598 | } |
1588 | mPixPainter.end() ; | 1599 | mPixPainter.end() ; |
1589 | } | 1600 | } |
1590 | 1601 | ||
1591 | /* | 1602 | /* |
1592 | Convert srcollview contents coordinates to agenda grid coordinates. | 1603 | Convert srcollview contents coordinates to agenda grid coordinates. |
1593 | */ | 1604 | */ |
1594 | void KOAgenda::contentsToGrid (int x, int y, int& gx, int& gy) | 1605 | void KOAgenda::contentsToGrid (int x, int y, int& gx, int& gy) |
@@ -1712,17 +1723,17 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) | |||
1712 | if ( item ) { | 1723 | if ( item ) { |
1713 | blockSignals( true ); | 1724 | blockSignals( true ); |
1714 | //qDebug("item found "); | 1725 | //qDebug("item found "); |
1715 | item->hide(); | 1726 | item->hide(); |
1716 | item->setCellX(-2, -1 ); | 1727 | item->setCellX(-2, -1 ); |
1717 | item->select(false); | 1728 | item->select(false); |
1718 | mUnusedItems.append( item ); | 1729 | mUnusedItems.append( item ); |
1719 | mItems.remove( item ); | 1730 | mItems.remove( item ); |
1720 | QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); | 1731 | Q3PtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); |
1721 | KOAgendaItem *itemit; | 1732 | KOAgendaItem *itemit; |
1722 | //globalFlagBlockAgendaItemPaint = 1; | 1733 | //globalFlagBlockAgendaItemPaint = 1; |
1723 | for ( itemit=oldconflictItems.first(); itemit != 0; | 1734 | for ( itemit=oldconflictItems.first(); itemit != 0; |
1724 | itemit=oldconflictItems.next() ) { | 1735 | itemit=oldconflictItems.next() ) { |
1725 | if ( itemit != item ) | 1736 | if ( itemit != item ) |
1726 | placeSubCells(itemit); | 1737 | placeSubCells(itemit); |
1727 | } | 1738 | } |
1728 | qApp->processEvents(); | 1739 | qApp->processEvents(); |
@@ -1742,17 +1753,17 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) | |||
1742 | if ( remove ) { | 1753 | if ( remove ) { |
1743 | //qDebug("remove****************************************** "); | 1754 | //qDebug("remove****************************************** "); |
1744 | return; | 1755 | return; |
1745 | } | 1756 | } |
1746 | if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) | 1757 | if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) |
1747 | return; | 1758 | return; |
1748 | //qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ "); | 1759 | //qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ "); |
1749 | QDate currentDate = QDate::currentDate(); | 1760 | QDate currentDate = QDate::currentDate(); |
1750 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda ); | 1761 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < (QDateTime)currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda ); |
1751 | QDateTime dt; | 1762 | QDateTime dt; |
1752 | if ( todo->hasCompletedDate() ) | 1763 | if ( todo->hasCompletedDate() ) |
1753 | dt = todo->completed(); | 1764 | dt = todo->completed(); |
1754 | else | 1765 | else |
1755 | dt = todo->dtDue(); | 1766 | dt = todo->dtDue(); |
1756 | if ( overdue ) { | 1767 | if ( overdue ) { |
1757 | days += todo->dtDue().date().daysTo( currentDate ); | 1768 | days += todo->dtDue().date().daysTo( currentDate ); |
1758 | } | 1769 | } |
@@ -1774,17 +1785,17 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) | |||
1774 | int endY = timeToY(dt.time()) - 1; | 1785 | int endY = timeToY(dt.time()) - 1; |
1775 | int hi = 12/KOPrefs::instance()->mHourSize; | 1786 | int hi = 12/KOPrefs::instance()->mHourSize; |
1776 | int startY = endY - 1-hi; | 1787 | int startY = endY - 1-hi; |
1777 | item = insertItem(todo,currentDate,days,startY,endY); | 1788 | item = insertItem(todo,currentDate,days,startY,endY); |
1778 | item->show(); | 1789 | item->show(); |
1779 | } | 1790 | } |
1780 | qApp->processEvents(); | 1791 | qApp->processEvents(); |
1781 | globalFlagBlockAgendaItemPaint = 0; | 1792 | globalFlagBlockAgendaItemPaint = 0; |
1782 | QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); | 1793 | Q3PtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); |
1783 | KOAgendaItem *itemit; | 1794 | KOAgendaItem *itemit; |
1784 | for ( itemit=oldconflictItems.first(); itemit != 0; | 1795 | for ( itemit=oldconflictItems.first(); itemit != 0; |
1785 | itemit=oldconflictItems.next() ) { | 1796 | itemit=oldconflictItems.next() ) { |
1786 | globalFlagBlockAgendaItemUpdate = 0; | 1797 | globalFlagBlockAgendaItemUpdate = 0; |
1787 | itemit->repaintMe(); | 1798 | itemit->repaintMe(); |
1788 | globalFlagBlockAgendaItemUpdate = 1; | 1799 | globalFlagBlockAgendaItemUpdate = 1; |
1789 | itemit->repaint(); | 1800 | itemit->repaint(); |
1790 | } | 1801 | } |
@@ -1862,17 +1873,17 @@ void KOAgenda::insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd, | |||
1862 | return; | 1873 | return; |
1863 | } | 1874 | } |
1864 | 1875 | ||
1865 | int cellX,cellYTop,cellYBottom; | 1876 | int cellX,cellYTop,cellYBottom; |
1866 | QString newtext; | 1877 | QString newtext; |
1867 | int width = XEnd - XBegin + 1; | 1878 | int width = XEnd - XBegin + 1; |
1868 | int count = 0; | 1879 | int count = 0; |
1869 | KOAgendaItem *current = 0; | 1880 | KOAgendaItem *current = 0; |
1870 | QPtrList<KOAgendaItem> multiItems; | 1881 | Q3PtrList<KOAgendaItem> multiItems; |
1871 | for (cellX = XBegin;cellX <= XEnd;++cellX) { | 1882 | for (cellX = XBegin;cellX <= XEnd;++cellX) { |
1872 | if (cellX == XBegin) cellYTop = YTop; | 1883 | if (cellX == XBegin) cellYTop = YTop; |
1873 | else cellYTop = 0; | 1884 | else cellYTop = 0; |
1874 | if (cellX == XEnd) cellYBottom = YBottom; | 1885 | if (cellX == XEnd) cellYBottom = YBottom; |
1875 | else cellYBottom = rows() - 1; | 1886 | else cellYBottom = rows() - 1; |
1876 | newtext = QString("(%1/%2): ").arg(++count).arg(width); | 1887 | newtext = QString("(%1/%2): ").arg(++count).arg(width); |
1877 | newtext.append(event->summary()); | 1888 | newtext.append(event->summary()); |
1878 | current = insertItem(event,qd,cellX,cellYTop,cellYBottom); | 1889 | current = insertItem(event,qd,cellX,cellYTop,cellYBottom); |
@@ -1922,17 +1933,17 @@ void KOAgenda::finishResize ( ) | |||
1922 | /* | 1933 | /* |
1923 | Overridden from QScrollView to provide proper resizing of KOAgendaItems. | 1934 | Overridden from QScrollView to provide proper resizing of KOAgendaItems. |
1924 | */ | 1935 | */ |
1925 | void KOAgenda::resizeEvent ( QResizeEvent *ev ) | 1936 | void KOAgenda::resizeEvent ( QResizeEvent *ev ) |
1926 | { | 1937 | { |
1927 | mSelectionHeight = 0; | 1938 | mSelectionHeight = 0; |
1928 | mResizeTimer.start( 150 , true ); | 1939 | mResizeTimer.start( 150 , true ); |
1929 | computeSizes(); | 1940 | computeSizes(); |
1930 | QScrollView::resizeEvent( ev ); | 1941 | Q3ScrollView::resizeEvent( ev ); |
1931 | return; | 1942 | return; |
1932 | 1943 | ||
1933 | } | 1944 | } |
1934 | void KOAgenda::computeSizes() | 1945 | void KOAgenda::computeSizes() |
1935 | { | 1946 | { |
1936 | if ( globalFlagBlockStartup ) | 1947 | if ( globalFlagBlockStartup ) |
1937 | return; | 1948 | return; |
1938 | int frameOffset = frameWidth() * 2 +1; | 1949 | int frameOffset = frameWidth() * 2 +1; |
@@ -2011,17 +2022,17 @@ void KOAgenda::scrollDown() | |||
2011 | void KOAgenda::popupAlarm() | 2022 | void KOAgenda::popupAlarm() |
2012 | { | 2023 | { |
2013 | if (!mClickedItem) { | 2024 | if (!mClickedItem) { |
2014 | qDebug("KOAgenda::popupAlarm() called without having a clicked item "); | 2025 | qDebug("KOAgenda::popupAlarm() called without having a clicked item "); |
2015 | return; | 2026 | return; |
2016 | } | 2027 | } |
2017 | // TODO: deal correctly with multiple alarms | 2028 | // TODO: deal correctly with multiple alarms |
2018 | Alarm* alarm; | 2029 | Alarm* alarm; |
2019 | QPtrList<Alarm> list(mClickedItem->incidence()->alarms()); | 2030 | Q3PtrList<Alarm> list(mClickedItem->incidence()->alarms()); |
2020 | for(alarm=list.first();alarm;alarm=list.next()) { | 2031 | for(alarm=list.first();alarm;alarm=list.next()) { |
2021 | alarm->toggleAlarm(); | 2032 | alarm->toggleAlarm(); |
2022 | } | 2033 | } |
2023 | emit itemModified( mClickedItem , KOGlobals::EVENTEDITED ); | 2034 | emit itemModified( mClickedItem , KOGlobals::EVENTEDITED ); |
2024 | mClickedItem->paintMe( true ); | 2035 | mClickedItem->paintMe( true ); |
2025 | mClickedItem->repaint( false ); | 2036 | mClickedItem->repaint( false ); |
2026 | } | 2037 | } |
2027 | 2038 | ||
@@ -2102,26 +2113,26 @@ void KOAgenda::selectItem(KOAgendaItem *item) | |||
2102 | mSelectedItem->select(); | 2113 | mSelectedItem->select(); |
2103 | emit incidenceSelected( mSelectedItem->incidence() ); | 2114 | emit incidenceSelected( mSelectedItem->incidence() ); |
2104 | } | 2115 | } |
2105 | 2116 | ||
2106 | // This function seems never be called. | 2117 | // This function seems never be called. |
2107 | void KOAgenda::keyPressEvent( QKeyEvent *kev ) | 2118 | void KOAgenda::keyPressEvent( QKeyEvent *kev ) |
2108 | { | 2119 | { |
2109 | switch(kev->key()) { | 2120 | switch(kev->key()) { |
2110 | case Key_PageDown: | 2121 | case Qt::Key_PageDown: |
2111 | verticalScrollBar()->addPage(); | 2122 | verticalScrollBar()->addPage(); |
2112 | break; | 2123 | break; |
2113 | case Key_PageUp: | 2124 | case Qt::Key_PageUp: |
2114 | verticalScrollBar()->subtractPage(); | 2125 | verticalScrollBar()->subtractPage(); |
2115 | break; | 2126 | break; |
2116 | case Key_Down: | 2127 | case Qt::Key_Down: |
2117 | verticalScrollBar()->addLine(); | 2128 | verticalScrollBar()->addLine(); |
2118 | break; | 2129 | break; |
2119 | case Key_Up: | 2130 | case Qt::Key_Up: |
2120 | verticalScrollBar()->subtractLine(); | 2131 | verticalScrollBar()->subtractLine(); |
2121 | break; | 2132 | break; |
2122 | default: | 2133 | default: |
2123 | ; | 2134 | ; |
2124 | } | 2135 | } |
2125 | } | 2136 | } |
2126 | 2137 | ||
2127 | void KOAgenda::calculateWorkingHours() | 2138 | void KOAgenda::calculateWorkingHours() |
@@ -2141,33 +2152,33 @@ DateList KOAgenda::dateList() const | |||
2141 | return mSelectedDates; | 2152 | return mSelectedDates; |
2142 | } | 2153 | } |
2143 | 2154 | ||
2144 | void KOAgenda::setDateList(const DateList &selectedDates) | 2155 | void KOAgenda::setDateList(const DateList &selectedDates) |
2145 | { | 2156 | { |
2146 | mSelectedDates = selectedDates; | 2157 | mSelectedDates = selectedDates; |
2147 | } | 2158 | } |
2148 | 2159 | ||
2149 | void KOAgenda::setHolidayMask(QMemArray<bool> *mask) | 2160 | void KOAgenda::setHolidayMask(Q3MemArray<bool> *mask) |
2150 | { | 2161 | { |
2151 | mHolidayMask = mask; | 2162 | mHolidayMask = mask; |
2152 | 2163 | ||
2153 | /* | 2164 | /* |
2154 | kdDebug() << "HolidayMask: "; | 2165 | kdDebug() << "HolidayMask: "; |
2155 | for(uint i=0;i<mask->count();++i) { | 2166 | for(uint i=0;i<mask->count();++i) { |
2156 | kdDebug() << (mask->at(i) ? "*" : "o"); | 2167 | kdDebug() << (mask->at(i) ? "*" : "o"); |
2157 | } | 2168 | } |
2158 | kdDebug() << endl; | 2169 | kdDebug() << endl; |
2159 | */ | 2170 | */ |
2160 | } | 2171 | } |
2161 | 2172 | ||
2162 | void KOAgenda::contentsMousePressEvent ( QMouseEvent *event ) | 2173 | void KOAgenda::contentsMousePressEvent ( QMouseEvent *event ) |
2163 | { | 2174 | { |
2164 | 2175 | ||
2165 | QScrollView::contentsMousePressEvent(event); | 2176 | Q3ScrollView::contentsMousePressEvent(event); |
2166 | } | 2177 | } |
2167 | 2178 | ||
2168 | void KOAgenda::storePosition() | 2179 | void KOAgenda::storePosition() |
2169 | { | 2180 | { |
2170 | //mContentPosition | 2181 | //mContentPosition |
2171 | int max = mGridSpacingY*4*24; | 2182 | int max = mGridSpacingY*4*24; |
2172 | if ( contentsY() < 5 && max > viewport()->height()*3/2 ) | 2183 | if ( contentsY() < 5 && max > viewport()->height()*3/2 ) |
2173 | mContentPosition = 0; | 2184 | mContentPosition = 0; |
@@ -2191,23 +2202,23 @@ void KOAgenda::restorePosition() | |||
2191 | posY = (int) ((max/mContentPosition)-(viewport()->height()/2)); | 2202 | posY = (int) ((max/mContentPosition)-(viewport()->height()/2)); |
2192 | setContentsPos (0, posY ); | 2203 | setContentsPos (0, posY ); |
2193 | //qDebug("posY %d hei %d", posY, max); | 2204 | //qDebug("posY %d hei %d", posY, max); |
2194 | 2205 | ||
2195 | } | 2206 | } |
2196 | void KOAgenda::moveChild( QWidget *w, int x , int y ) | 2207 | void KOAgenda::moveChild( QWidget *w, int x , int y ) |
2197 | { | 2208 | { |
2198 | ++x; | 2209 | ++x; |
2199 | QScrollView::moveChild( w, x , y ); | 2210 | Q3ScrollView::moveChild( w, x , y ); |
2200 | } | 2211 | } |
2201 | #include <qmessagebox.h> | 2212 | #include <qmessagebox.h> |
2202 | #ifdef DESKTOP_VERSION | 2213 | #ifdef DESKTOP_VERSION |
2203 | #include <qprinter.h> | 2214 | #include <qprinter.h> |
2204 | #include <qpainter.h> | 2215 | #include <qpainter.h> |
2205 | #include <qpaintdevicemetrics.h> | 2216 | #include <q3paintdevicemetrics.h> |
2206 | 2217 | ||
2207 | #endif | 2218 | #endif |
2208 | void KOAgenda::printSelection() | 2219 | void KOAgenda::printSelection() |
2209 | { | 2220 | { |
2210 | #ifdef DESKTOP_VERSION | 2221 | #ifdef DESKTOP_VERSION |
2211 | if ( mStartCellY == mCurrentCellY ) { | 2222 | if ( mStartCellY == mCurrentCellY ) { |
2212 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 2223 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
2213 | i18n("Nothing selected!\n\nThis prints the full width of the Agenda view as you see it!\n\nTo determine the vertical range of the printing, please select\na vertical range (with the left mouse button down) in one column. "), | 2224 | i18n("Nothing selected!\n\nThis prints the full width of the Agenda view as you see it!\n\nTo determine the vertical range of the printing, please select\na vertical range (with the left mouse button down) in one column. "), |
@@ -2226,17 +2237,17 @@ void KOAgenda::printSelection() | |||
2226 | 2237 | ||
2227 | //return; | 2238 | //return; |
2228 | QPrinter* printer = new QPrinter(); | 2239 | QPrinter* printer = new QPrinter(); |
2229 | if ( !printer->setup()) { | 2240 | if ( !printer->setup()) { |
2230 | delete printer; | 2241 | delete printer; |
2231 | return; | 2242 | return; |
2232 | } | 2243 | } |
2233 | QPainter p( printer ); | 2244 | QPainter p( printer ); |
2234 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( printer ); | 2245 | Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( printer ); |
2235 | QString date = i18n("Date range: ")+KGlobal::locale()->formatDate( mSelectedDates.first() )+" - "+KGlobal::locale()->formatDate( mSelectedDates.last() ); | 2246 | QString date = i18n("Date range: ")+KGlobal::locale()->formatDate( mSelectedDates.first() )+" - "+KGlobal::locale()->formatDate( mSelectedDates.last() ); |
2236 | //date += " --- printing time: " + KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true ); | 2247 | //date += " --- printing time: " + KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true ); |
2237 | int hei = p.boundingRect(0,0, 5, 5, Qt::AlignLeft, date ).height(); | 2248 | int hei = p.boundingRect(0,0, 5, 5, Qt::AlignLeft, date ).height(); |
2238 | // p.drawText( 0, 0, date ); | 2249 | // p.drawText( 0, 0, date ); |
2239 | int offset = m.width()/8; | 2250 | int offset = m.width()/8; |
2240 | // compute the scale | 2251 | // compute the scale |
2241 | dx = ((float) m.width()-offset) / (float)w; | 2252 | dx = ((float) m.width()-offset) / (float)w; |
2242 | dy = (float)(m.height() - ( 2 * hei )-offset ) / (float)h; | 2253 | dy = (float)(m.height() - ( 2 * hei )-offset ) / (float)h; |