本文整理汇总了C++中scrollUp函数的典型用法代码示例。如果您正苦于以下问题:C++ scrollUp函数的具体用法?C++ scrollUp怎么用?C++ scrollUp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了scrollUp函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: switch
void
ImageView::prevPage()
{
switch (m_scrollMode) {
case IVPM_DOWN_RIGHT:
if (scrollLeft() || scrollUp()) return;
break;
case IVPM_DOWN_LEFT:
if (scrollRight() || scrollUp()) return;
break;
case IVPM_RIGHT_DOWN:
if (scrollUp() || scrollLeft()) return;
break;
case IVPM_LEFT_DOWN:
if (scrollUp() || scrollRight()) return;
break;
}
switch (m_pageMode) {
case IVPM_RIGHT_DOWN:
if (upSlice() || leftSlice()) return;
break;
case IVPM_LEFT_DOWN:
if (upSlice() || rightSlice()) return;
break;
case IVPM_DOWN_RIGHT:
if (leftSlice() || upSlice()) return;
break;
case IVPM_DOWN_LEFT:
if (rightSlice() || upSlice()) return;
break;
}
emit loadPrev();
}
开发者ID:lanterrt,项目名称:QAView,代码行数:34,代码来源:imageview.cpp
示例2: switch
int qmapcontrol::MapControl::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: mouseEventCoordinate((*reinterpret_cast< const QMouseEvent*(*)>(_a[1])),(*reinterpret_cast< const QPointF(*)>(_a[2]))); break;
case 1: boxDragged((*reinterpret_cast< const QRectF(*)>(_a[1]))); break;
case 2: geometryClicked((*reinterpret_cast< Geometry*(*)>(_a[1])),(*reinterpret_cast< QPoint(*)>(_a[2]))); break;
case 3: viewChanged((*reinterpret_cast< const QPointF(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
case 4: zoomIn(); break;
case 5: zoomOut(); break;
case 6: setZoom((*reinterpret_cast< int(*)>(_a[1]))); break;
case 7: scrollLeft((*reinterpret_cast< int(*)>(_a[1]))); break;
case 8: scrollLeft(); break;
case 9: scrollRight((*reinterpret_cast< int(*)>(_a[1]))); break;
case 10: scrollRight(); break;
case 11: scrollUp((*reinterpret_cast< int(*)>(_a[1]))); break;
case 12: scrollUp(); break;
case 13: scrollDown((*reinterpret_cast< int(*)>(_a[1]))); break;
case 14: scrollDown(); break;
case 15: scroll((*reinterpret_cast< const QPoint(*)>(_a[1]))); break;
case 16: updateRequest((*reinterpret_cast< QRect(*)>(_a[1]))); break;
case 17: updateRequestNew(); break;
case 18: resize((*reinterpret_cast< const QSize(*)>(_a[1]))); break;
case 19: tick(); break;
case 20: loadingFinished(); break;
case 21: positionChanged((*reinterpret_cast< Geometry*(*)>(_a[1]))); break;
default: ;
}
_id -= 22;
}
return _id;
}
开发者ID:s0lstice,项目名称:carto-qt,代码行数:35,代码来源:moc_mapcontrol.cpp
示例3: mouse
void WidgetScrollBox::logic(int x, int y) {
Point mouse(x, y);
if (isWithin(pos,mouse)) {
inpt->lock_scroll = true;
if (inpt->scroll_up) scrollUp();
if (inpt->scroll_down) scrollDown();
}
else {
inpt->lock_scroll = false;
}
// check ScrollBar clicks
if (contents && contents->getGraphicsHeight() > pos.h && scrollbar) {
switch (scrollbar->checkClick(mouse.x,mouse.y)) {
case 1:
scrollUp();
break;
case 2:
scrollDown();
break;
case 3:
cursor = scrollbar->getValue();
break;
default:
break;
}
}
}
开发者ID:RetroAsh,项目名称:flare-engine-next,代码行数:29,代码来源:WidgetScrollBox.cpp
示例4: RETARGET_TFTTX
/**************************************************************************//**
* @brief Transmit/display a character
* @param[in] c ASCII character to output
* @return -1 on failure, or positive character integer on sucesss
*****************************************************************************/
void RETARGET_TFTTX(int c)
{
/* check for CR */
if (c == '\r')
{
xpos = 0;
return;
}
/* check for LF */
if (c == '\n')
{
ypos = ypos + 1;
xpos = 0;
if (ypos >= LINES)
{
/* scroll characters one line up */
scrollUp();
ypos = (LINES - 1);
}
return;
}
/* check for bell character, changes color to red */
if (c == '\b')
{
if (rgbColor[1] == 0xff)
{
rgbColor[1] = 0x00;
rgbColor[2] = 0x00;
}
else
{
rgbColor[1] = 0xff;
rgbColor[2] = 0xff;
}
return;
}
/* check for non-printable characters */
if (c < ' ' || c > '~')
{
c = ' ';
}
xpos = xpos + 1;
if (xpos >= CHARS)
{
xpos = 0;
ypos = ypos + 1;
}
if (ypos >= LINES)
{
scrollUp();
ypos = 29;
}
charBuffer[ypos][xpos] = c - ' ';
}
开发者ID:Sowhat2112,项目名称:KreyosFirmware,代码行数:60,代码来源:retargettft.c
示例5: disconnect
void dragTarget::scrollUp()
{
disconnect(scrollUpTimer, SIGNAL(timeout()), this, SLOT(scrollUp()));
puts("scrollUp chiamato");
this -> scrollToItem(tempScroll);
tempScroll = itemAbove(tempScroll);
connect(scrollUpTimer, SIGNAL(timeout()), this, SLOT(scrollUp()));
if(tempScroll == NULL)
{
disconnect(scrollUpTimer, SIGNAL(timeout()), this, SLOT(scrollUp()));
scrollUpTimer -> stop();
}
}
开发者ID:alediaferia,项目名称:aku,代码行数:13,代码来源:dragtarget.cpp
示例6: deleteAndZero
void SignalChainManager::removeTab(int tabIndex)
{
SignalChainTabButton* t = signalChainArray.remove(tabIndex);
deleteAndZero(t);
for (int n = 0; n < signalChainArray.size(); n++)
{
int tNum = signalChainArray[n]->getEditor()->tabNumber();
if (tNum > tabIndex)
{
signalChainArray[n]->getEditor()->tabNumber(tNum-1);
signalChainArray[n]->setNumber(tNum-1);
}
}
if (signalChainArray.size()-topTab < 4)
{
scrollUp();
}
refreshTabs();
}
开发者ID:ElegantCodeFTW,项目名称:GUI,代码行数:26,代码来源:SignalChainManager.cpp
示例7: scrollDown
void KoHelpWidget::timerEvent( QTimerEvent* )
{
if ( m_scrollDown )
scrollDown();
else
scrollUp();
} // KoHelpWidget::timerEvent
开发者ID:KDE,项目名称:calligra-history,代码行数:7,代码来源:KoContextHelp.cpp
示例8: scrollUp
void Terminal::newLine(void)
{
_column = 0;
++_row;
if(_row == vga::height)
scrollUp();
}
开发者ID:TheoVerhelst,项目名称:TheOS,代码行数:7,代码来源:Terminal.cpp
示例9: newLineCheck
void newLineCheck()
{
if(cursorY >=sh-1)
{
scrollUp(1);
}
}
开发者ID:cxleb,项目名称:cx,代码行数:7,代码来源:textscreen.c
示例10: scrollUp
void WidgetListBox::subActive(Widget &widget) {
if (widget.getTag().endsWith("#Up")) {
scrollUp(1);
return;
}
if (widget.getTag().endsWith("#Down")) {
scrollDown(1);
return;
}
if (widget.getTag().endsWith("#Bar")) {
ptrdiff_t max = _items.size() - _visibleItems.size();
if (max <= 0)
return;
size_t startItem = _scrollbar->getState() * max;
if (startItem == _startItem)
return;
_startItem = startItem;
updateVisible();
return;
}
WidgetListItem *listItem = dynamic_cast<WidgetListItem *>(&widget);
if (listItem) {
if (_selectedItem != listItem->_itemNumber) {
_selectedItem = listItem->_itemNumber;
setActive(true);
}
}
}
开发者ID:clone2727,项目名称:xoreos,代码行数:34,代码来源:listbox.cpp
示例11: gotoPos
////
// Scrolling Routines
////
bool CMap::gotoPos(int x, int y)
{
int dx,dy;
bool retval = false;
dx = x - m_scrollx;
dy = y - m_scrolly;
if( dx > 0 )
for( int scrollx=0 ; scrollx<dx ; scrollx++) scrollRight(true);
else retval = true;
if( dx < 0 )
for( int scrollx=0 ; scrollx<-dx ; scrollx++) scrollLeft(true);
else retval = true;
if( dy > 0 )
for( int scrolly=0 ; scrolly<dy ; scrolly++) scrollDown(true);
else retval = true;
if( dy < 0 )
for( int scrolly=0 ; scrolly<-dy ; scrolly++) scrollUp(true);
else retval = true;
return retval;
}
开发者ID:Shayster,项目名称:Commander-Genius,代码行数:28,代码来源:CMap.cpp
示例12: text_height
bool EditboxVScrollView::mouseDrag(int x, int y)
{
int textheight;
textheight = text_height(textfont);
if(model->getSelection().isSelecting())
{
return BasicEditboxView::mouseDrag(x,y);
}
else
{
//maybe pressing arrow, or sliding?
if(toparrow_state == 1)
{
scrollUp();
return true;
}
if(bottomarrow_state == 1)
{
scrollDown();
return true;
}
if(barstate == 1)
{
//fake a click
//first, clip the coords
int fakex = toparrow_x+1;
return mouseClick(fakex,y);
}
return mouseDragOther(x,y);
}
}
开发者ID:ZoriaRPG,项目名称:ZeldaClassic,代码行数:35,代码来源:EditboxView.cpp
示例13: Mobot_init
bool MainWindow::connectRobot (const QString& address) {
if (m_connectedRobots.end() != m_connectedRobots.find(address)) {
/* The requested robot is already connected */
return true;
}
auto newrobot = new mobot_t;
Mobot_init(newrobot);
/* extract the 8-bit byte array from QString, from which we can then extract
* the C-string */
auto baAddress = address.toLocal8Bit();
if (-1 == Mobot_connectWithAddress(newrobot, baAddress.data(), 1)) {
delete newrobot;
qDebug() << "(barobolab) ERROR: Mobot_connectWithTTY failed\n";
return false;
}
Mobot_enableButtonCallback(newrobot, strdup(baAddress.data()), JsInterface::robotButtonCallback);
auto l = new RobotListener(newrobot, address);
QObject::connect(l, SIGNAL(scrollUp(QString)), m_interface, SLOT(scrollUpSlot(QString)));
QObject::connect(l, SIGNAL(scrollDown(QString)), m_interface, SLOT(scrollDownSlot(QString)));
QThread *thread = new QThread(this);
l->moveToThread(thread);
thread->start();
QMetaObject::invokeMethod(l, "startWork", Qt::QueuedConnection);
m_connectedRobots.insert(std::make_pair(address, newrobot));
m_robotListeners.insert(std::make_pair(address, l));
return true;
}
开发者ID:aruggles,项目名称:BaroboLabHack,代码行数:30,代码来源:mainwindow.cpp
示例14: scrollDown
// Most common render function for this TextViewer
void CTextViewer::ponder()
{
// Normal Keys/Axes
if( g_pInput->getHoldedCommand(IC_DOWN) )
{
m_timer++;
if(m_timer >= 2)
scrollDown();
}
if( g_pInput->getHoldedCommand(IC_UP) )
{
m_timer++;
if(m_timer >= 2)
scrollUp();
}
// Page Keys
if( g_pInput->getPressedKey(KPGDN) )
setPosition(m_linepos+16);
if( g_pInput->getPressedKey(KPGUP) )
setPosition(m_linepos-16);
if(m_timer>=8) m_timer=0;
if(g_pInput->getPressedKey(KQUIT) || g_pInput->getPressedKey(KQ) || g_pInput->getPressedCommand(IC_BACK) )
m_mustclose = true;
}
开发者ID:alicecola31,项目名称:Commander-Genius,代码行数:28,代码来源:CTextViewer.cpp
示例15: scrollDown
// Most common render function for this TextViewer
void CTextViewer::process()
{
// Normal Keys/Axes
if( g_pInput->getHoldedCommand(IC_DOWN) )
{
m_timer++;
if(m_timer >= 2)
scrollDown();
}
if( g_pInput->getHoldedCommand(IC_UP) )
{
m_timer++;
if(m_timer >= 2)
scrollUp();
}
// Page Keys
if( g_pInput->getPressedKey(KPGDN) )
setPosition(m_linepos+16);
if( g_pInput->getPressedKey(KPGUP) )
setPosition(m_linepos-16);
if(m_timer>=8) m_timer=0;
if(g_pInput->getPressedKey(KQUIT) || g_pInput->getPressedKey(KQ) )
m_mustclose = true;
renderBox(); // This comes after, because it does transparent overlay
}
开发者ID:albertz,项目名称:commandergenius,代码行数:30,代码来源:CTextViewer.cpp
示例16: scrollUp
void Screen::index()
//=IND
{
if (cuY == _bottomMargin)
scrollUp(1);
else if (cuY < lines-1)
cuY += 1;
}
开发者ID:hawaii-desktop,项目名称:hawaii-terminal,代码行数:8,代码来源:Screen.cpp
示例17: scrollUp
bool CPetConversations::MouseWheelMsg(CMouseWheelMsg *msg) {
if (msg->_wheelUp)
scrollUp();
else
scrollDown();
return true;
}
开发者ID:OmerMor,项目名称:scummvm,代码行数:8,代码来源:pet_conversations.cpp
示例18: while
void EditorScreen::moveCursor(int newLineIndex, int newOffset, bool *scrolled)
{
int line = 0;
int col = 0;
bool done = false;
while (newLineIndex < _topLineIndex || (newLineIndex == _topLineIndex && newOffset / 16 < _topLineSubIndex))
if (scrollUp())
done = true;
else
break;
if (done)
{
feedScreen();
emit screenChanged();
if (scrolled)
*scrolled = true;
}
for (int index = _topLineIndex; index < newLineIndex; ++index)
{
const TextLine &textLine = _lines[index];
line += textLine.rowCount();
if (index == _topLineIndex)
line -= _topLineSubIndex;
}
line += newOffset / 16;
if (newLineIndex == _topLineIndex)
line -= _topLineSubIndex;
col = newOffset % 16;
// Must scroll down?
done = false;
for (int i = 0; i < line - 7; i++)
if (scrollDown())
done = true;
else
break;
if (done)
{
line = 7;
if (scrolled)
*scrolled = true;
feedScreen();
emit screenChanged();
}
TextScreen::moveCursor(col, line);
_cursorLineIndex = newLineIndex;
_cursorOffset = newOffset;
}
开发者ID:JensGrabner,项目名称:fx7500g,代码行数:57,代码来源:editor_screen.cpp
示例19: UNUSED
void WidgetListBox::mouseWheel(uint8 UNUSED(state), int UNUSED(x), int y) {
if (isDisabled())
return;
if (y > 0)
scrollUp(1);
else if (y < 0)
scrollDown(1);
}
开发者ID:clone2727,项目名称:xoreos,代码行数:9,代码来源:listbox.cpp
示例20: scrollUp
void IncSearchWidget::keyPressEvent( QKeyEvent *event )
{
if ( event->key() == Qt::Key_Up ) {
event->accept();
emit scrollUp();
} else if ( event->key() == Qt::Key_Down ) {
event->accept();
emit scrollDown();
}
}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:10,代码来源:incsearchwidget.cpp
注:本文中的scrollUp函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论