static XP_Bool scrollTimerProc( void* closure, XWTimerReason XP_UNUSED_DBG(why) ) { XP_Bool draw = XP_FALSE; BoardCtxt* board = (BoardCtxt*)closure; DragState* ds = &board->dragState; XP_ASSERT( why == TIMER_PENDOWN ); if ( ds->scrollTimerSet ) { XP_S16 changeX = 0; XP_S16 changeY = 0; ds->scrollTimerSet = XP_FALSE; XP_Bool canScroll = onBorderCanScroll( board, SCROLL_H, ds->cur.u.board.col, &changeX ); canScroll = onBorderCanScroll( board, SCROLL_V, ds->cur.u.board.row, &changeY ) || canScroll; if ( canScroll ) { invalDragObj( board, &ds->cur ); if ( 0 != changeX ) { ds->cur.u.board.col += (changeX >0 ? 1 : -1); } if ( 0 != changeY ) { ds->cur.u.board.row += (changeY >0 ? 1 : -1); } if ( scrollIntoView( board, ds->cur.u.board.col, ds->cur.u.board.row ) ) { board_draw( board ); /* may fail, e.g. on wince */ startScrollTimerIf( board, XP_TRUE ); draw = XP_TRUE; } } } return draw; } /* scrollTimerProc */
void FormPlugin::switchActiveInput(TextInput* newInput) { NPP instance = this->inst(); if (m_activeInput) { inval(instance, m_activeInput->rect, true); // inval the old gWindowI.clearVisibleRects(instance); } m_activeInput = newInput; // set the new active input if (m_activeInput) { inval(instance, m_activeInput->rect, true); // inval the new scrollIntoView(m_activeInput); } }
void PeopleApplication::createDetailPage(const QModelIndex &index) { if (m_detailPage) return; if (!index.isValid()) return; searchCancel(); m_currentIndex = index; m_currentPerson = new SeasidePerson(index); m_currentPerson->setViewType("personDetail"); connect(m_currentPerson, SIGNAL(callNumber(const QString&)), this, SLOT(callNumber(const QString&))); connect(m_currentPerson, SIGNAL(composeIM(const QString&)), this, SLOT(composeIM(const QString&))); connect(m_currentPerson, SIGNAL(composeSMS(const QString&)), this, SLOT(composeSMS(const QString&))); connect(m_currentPerson, SIGNAL(composeEmail(const QString&)), this, SLOT(composeEmail(const QString&))); connect(m_currentPerson, SIGNAL(viewRequest(qreal,qreal)), this, SLOT(scrollIntoView(qreal,qreal))); m_detailPage = new MApplicationPage; m_detailPage->setTitle(QObject::tr("Contact Detail","Title for detail view")); m_detailPage->setCentralWidget(m_currentPerson); MAction *action = new MAction(QObject::tr("<b>Edit</b>","Edit toolbar button to edit contact details"), this); action->setLocation(MAction::ApplicationMenuLocation); m_detailPage->addAction(action); connect(action, SIGNAL(triggered()), this, SLOT(editCurrent())); connect(m_detailPage, SIGNAL(backButtonClicked()), this, SLOT(detailBack())); m_detailPage->appear(MApplicationPage::DestroyWhenDismissed); }
void FormPlugin::handleTextInput(TextInput* input, ANPKeyCode keyCode, int32_t unichar) { NPP instance = this->inst(); //make sure the input field is in view scrollIntoView(input); //handle the delete operation if (keyCode == kDel_ANPKeyCode) { if (input->charPtr > 0) { input->charPtr--; } return; } //check to see that the input is not full if (input->charPtr >= (sizeof(input->text) - 1)) return; //add the character input->text[input->charPtr] = static_cast<char>(unichar); input->charPtr++; gLogI.log(kDebug_ANPLogType, "----%p Text: %c", instance, unichar); }