• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ scrollDown函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中scrollDown函数的典型用法代码示例。如果您正苦于以下问题:C++ scrollDown函数的具体用法?C++ scrollDown怎么用?C++ scrollDown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了scrollDown函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: 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


示例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: switch

void IbmPcVgaTerminal::syphon(const utf8Char *str, uarch_t len)
{
	// FIXME: Remember to do utf-8 expansion here.

	if (buff == NULL || str == NULL) {
		return;
	};

	for (; len != 0; len--, str++)
	{
		switch(*str)
		{
		case '\n':
			if (row >= maxRow-1)
			{
				scrollDown();
				row = maxRow-1;
				col = 0;
				break;
			}
			row++;
			col = 0;
			break;

		case '\r':
			col = 0;
			break;

		case '\t':
			col += 8;
			col &= ~0x7;
			break;

		default:
			if (*str < 0x20) {
				break;
			};
			if (col >= maxCol)
			{
				row++;
				if (row >= maxRow-1)
				{
					scrollDown();
					row = maxRow-1;
				};
				col = 0;
			};
			// For now we truncate all codepoints.
			buff[row * maxCol + col].ch = (ubit8)*str;
			buff[row * maxCol + col].attr = 0x07;
			col++;
			break;
		};
	};
}
开发者ID:latentPrion,项目名称:zambesii,代码行数:55,代码来源:vgaTerminal.cpp


示例4: disconnect

void dragTarget::scrollDown()
{
  disconnect(scrollDownTimer, SIGNAL(timeout()), this, SLOT(scrollDown()));
  puts("scrollDown chiamato");
  this -> scrollToItem(tempScroll);
  tempScroll = itemBelow(tempScroll);
  connect(scrollDownTimer, SIGNAL(timeout()), this, SLOT(scrollDown()));
  if(tempScroll == NULL)
  {
    disconnect(scrollDownTimer, SIGNAL(timeout()), this, SLOT(scrollDown()));
    scrollDownTimer -> stop();
  }
}
开发者ID:alediaferia,项目名称:aku,代码行数:13,代码来源:dragtarget.cpp


示例5: 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


示例6: 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


示例7: RK_TRACE

void RKProgressControlDialog::addOutput (const ROutput *output) {
	RK_TRACE (MISC);

	// scrolled all the way to the bottom?
	bool at_end = true;
	QScrollBar *bar = output_text->verticalScrollBar ();
	if (bar && (bar->value () < bar->maximum ())) at_end = false;

	if (output->type != last_output_type) {
		last_output_type = output->type;
		output_text->insertPlainText ("\n");

		if (output->type == ROutput::Output) {
			output_text->setTextColor (Qt::black);
		} else {
			output_text->setTextColor (Qt::red);
			if (!isDetailsWidgetVisible ()) setDetailsWidgetVisible (true);
			error_indicator->show ();
		}
	}

	output_text->insertPlainText (output->output);

	// if previously at end, auto-scroll
	if (at_end && output_text->isVisible ()) scrollDown ();
}
开发者ID:KDE,项目名称:rkward,代码行数:26,代码来源:rkprogresscontrol.cpp


示例8: 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


示例9: scrollDown

void ScriptConsoleView::printOutput(const QString &output)
{
    if (!output.isEmpty())
        m_ui->commandsList->insertPlainText(output + "\n");

    scrollDown();
}
开发者ID:yudjin87,项目名称:tour_du_monde,代码行数:7,代码来源:ScriptConsoleView.cpp


示例10: textCursor

void Console::insertPrompt() {
    textCursor().insertText(prompt);

    scrollDown();

    locked = false;
}
开发者ID:ArthurGoodman,项目名称:raygl,代码行数:7,代码来源:console.cpp


示例11: 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


示例12: 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


示例13: 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


示例14: SignalChainTabButton

void SignalChainManager::createNewTab(GenericEditor* editor)
{

    int index = signalChainArray.size();

    SignalChainTabButton* t = new SignalChainTabButton();
    t->setManager(this);
    t->setEditor(editor);

    ev->addChildComponent(t);
    signalChainArray.add(t);

    editor->tabNumber(signalChainArray.size()-1);
    t->setToggleState(true,false);
    t->setNumber(index);

    index -= topTab;
    ev->leftmostEditor = 0;

    if (signalChainArray.size()-topTab > 4)
    {
        scrollDown();
    }

    refreshTabs();

}
开发者ID:ElegantCodeFTW,项目名称:GUI,代码行数:27,代码来源:SignalChainManager.cpp


示例15: scrollDown

void KoHelpWidget::timerEvent( QTimerEvent* )
{
	if ( m_scrollDown )
		scrollDown();
	else
		scrollUp();
} // KoHelpWidget::timerEvent
开发者ID:KDE,项目名称:calligra-history,代码行数:7,代码来源:KoContextHelp.cpp


示例16: scrollDown

void ConsoleArea::addText(QString text)    
{
    label->setText(label->text() + text);
    label->adjustSize();
    label->setFixedWidth(width() - 20);
    scrollDown();
    widget->adjustSize();
}
开发者ID:frigge,项目名称:MindTree,代码行数:8,代码来源:consolewindow.cpp


示例17: scrollUp

bool CPetConversations::MouseWheelMsg(CMouseWheelMsg *msg) {
	if (msg->_wheelUp)
		scrollUp();
	else
		scrollDown();

	return true;
}
开发者ID:OmerMor,项目名称:scummvm,代码行数:8,代码来源:pet_conversations.cpp


示例18: scrollDown

void Screen::reverseIndex()
    //=RI
{
    if (cuY == _topMargin)
        scrollDown(_topMargin,1);
    else if (cuY > 0)
        cuY -= 1;
}
开发者ID:hawaii-desktop,项目名称:hawaii-terminal,代码行数:8,代码来源:Screen.cpp


示例19: KDialog

RKProgressControlDialog::RKProgressControlDialog (const QString &text, const QString &caption, int mode_flags, bool modal) : KDialog (0) {
	RK_TRACE (MISC);

	setAttribute (Qt::WA_DeleteOnClose, true);
	setModal (modal);
	setCaption (caption);

	KVBox *vbox = new KVBox (this);
	vbox->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
	setMainWidget (vbox);

	QLabel *label = new QLabel (text, vbox);
	label->setWordWrap (true);

	error_indicator = new QLabel (i18n ("<b>There have been errors and / or warnings! See below for a transcript</b>"), vbox);
	QPalette palette = error_indicator->palette ();
	palette.setColor (error_indicator->foregroundRole (), QColor (255, 0, 0));
	error_indicator->setPalette (palette);
	error_indicator->hide ();

	KVBox* output_box = new KVBox ();
	if (mode_flags & (RKProgressControl::IncludeErrorOutput | RKProgressControl::IncludeRegularOutput)) {
		QString ocaption;
		if (mode_flags & RKProgressControl::IncludeRegularOutput) {
			output_button_text = i18n ("Output");
			ocaption = i18n ("Output:");
		} else {
			output_button_text = i18n ("Errors / Warnings");
			ocaption = i18n ("Errors / Warnings:");
		}
		new QLabel (ocaption, output_box);

		output_text = new QTextEdit (output_box);
		output_text->setReadOnly (true);
		output_text->setPlainText (QString ());
		output_text->setUndoRedoEnabled (false);
		output_text->setLineWrapMode (QTextEdit::NoWrap);
		output_text->setMinimumWidth (QFontMetrics (output_text->font ()).averageCharWidth () * RKSettingsModuleR::getDefaultWidth ());
		output_box->setStretchFactor (output_text, 10);
	}
	setDetailsWidget (output_box);
	// it's important to use a queued connection, here. Otherwise, if the details widget gets shown due to error output, scrollDown() would only scroll to the position directly *above* the new output.
	connect (this, SIGNAL(aboutToShowDetails()), this, SLOT(scrollDown()), Qt::QueuedConnection);

	KDialog::ButtonCodes button_codes = KDialog::Cancel;
	if (mode_flags & RKProgressControl::OutputSwitchable) button_codes |= KDialog::Details;
	setButtons (button_codes);
	if (button_codes & KDialog::Details) setButtonText (KDialog::Details, output_button_text);
	if (mode_flags & RKProgressControl::AllowCancel) setButtonText (KDialog::Cancel, i18n ("Cancel"));
	else (setCloseTextToClose ());

	if (mode_flags & RKProgressControl::OutputShownByDefault) setDetailsWidgetVisible (true);

	prevent_close = (mode_flags & RKProgressControl::PreventClose);

	last_output_type = ROutput::Output;
	is_done = false;
}
开发者ID:svn2github,项目名称:rkward-svn-mirror,代码行数:58,代码来源:rkprogresscontrol.cpp


示例20: 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



注:本文中的scrollDown函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ scrollTo函数代码示例发布时间:2022-05-30
下一篇:
C++ scrollAnimator函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap