void LabEngine::doJournal() { _graphics->blackAllScreen(); _lastPage = false; _journalBackImage->_width = _graphics->_screenWidth; _journalBackImage->_height = _graphics->_screenHeight; _journalBackImage->setData(nullptr, true); updateEvents(); loadJournalData(); _interface->attachButtonList(&_journalButtonList); drawJournal(0, true); _event->mouseShow(); processJournal(); _interface->attachButtonList(nullptr); _graphics->fade(false); _event->mouseHide(); delete[] _blankJournal; _blankJournal = nullptr; _journalBackImage->setData(nullptr, true); _interface->freeButtonList(&_journalButtonList); _graphics->freeFont(&_journalFont); _graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0); _graphics->blackScreen(); }
void CalPrintJournal::print( QPainter &p, int width, int height ) { int x=0, y=0; Journal::List journals( mCalendar->journals() ); if ( mUseDateRange ) { Journal::List allJournals = journals; journals.clear(); Journal::List::Iterator it = allJournals.begin(); for ( ; it != allJournals.end(); ++it ) { QDate dt = (*it)->dtStart().date(); if ( mFromDate <= dt && dt <= mToDate ) { journals.append( *it ); } } } drawHeader( p, i18n( "Journal entries" ), QDate(), QDate(), QRect( 0, 0, width, headerHeight() ) ); y = headerHeight() + 15; Journal::List::Iterator it = journals.begin(); for ( ; it != journals.end(); ++it ) { drawJournal( *it, p, x, y, width, height ); } }
void LabEngine::processJournal() { while (1) { IntuiMessage *msg = _event->getMsg(); if (shouldQuit()) { _quitLab = true; return; } updateEvents(); _graphics->screenUpdate(); _system->delayMillis(10); if (!msg) continue; MessageClass msgClass = msg->_msgClass; if ((msgClass == kMessageRightClick) || ((msgClass == kMessageRawKey) && (msg->_code == Common::KEYCODE_ESCAPE))) return; else if (msgClass == kMessageButtonUp) { uint16 buttonId = msg->_code; if (buttonId == 0) { if (_journalPage >= 2) { _journalPage -= 2; drawJournal(1, false); } } else if (buttonId == 1) { return; } else if (buttonId == 2) { if (!_lastPage) { _journalPage += 2; drawJournal(2, false); } } } } // while }