コード例 #1
0
ファイル: imageview.cpp プロジェクト: lanterrt/QAView
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();
}
コード例 #2
0
ファイル: moc_mapcontrol.cpp プロジェクト: s0lstice/carto-qt
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;
}
コード例 #3
0
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;
		}
	}
}
コード例 #4
0
/**************************************************************************//**
 * @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 - ' ';
}
コード例 #5
0
ファイル: dragtarget.cpp プロジェクト: alediaferia/aku
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();
  }
}
コード例 #6
0
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();

}
コード例 #7
0
void KoHelpWidget::timerEvent( QTimerEvent* )
{
	if ( m_scrollDown )
		scrollDown();
	else
		scrollUp();
} // KoHelpWidget::timerEvent
コード例 #8
0
ファイル: Terminal.cpp プロジェクト: TheoVerhelst/TheOS
void Terminal::newLine(void)
{
	_column = 0;
	++_row;
	if(_row == vga::height)
		scrollUp();
}
コード例 #9
0
ファイル: textscreen.c プロジェクト: cxleb/cx
void newLineCheck()
{
        if(cursorY >=sh-1)
        {
                scrollUp(1);
        }
}
コード例 #10
0
ファイル: listbox.cpp プロジェクト: clone2727/xoreos
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);
		}
	}

}
コード例 #11
0
ファイル: CMap.cpp プロジェクト: Shayster/Commander-Genius
////
// 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;
}
コード例 #12
0
ファイル: EditboxView.cpp プロジェクト: ZoriaRPG/ZeldaClassic
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);
    }
}
コード例 #13
0
ファイル: mainwindow.cpp プロジェクト: aruggles/BaroboLabHack
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;
}
コード例 #14
0
// 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;	 
}
コード例 #15
0
void GsScrollbar::processLogic()
{
    // Here we check if the mouse-cursor/Touch entry clicked on something!!
    const float fx = mRect.x;
    const float fw = mRect.w;
    const float fy = mRect.y;
    const float fh = mRect.h;

    const float y_innerbound_max = fy+fh;

    //const float x_innerbound_min = fx + static_cast<float>(TEXT_HEIGHT)/bw;

    GsRect<float> rRect(fx, fy, fw, fh);
    GsRect<float> parRect(mpParent->mRect);

    rRect.transform(parRect);

    GsPointingState &pointingState = gPointDevice.mPointingState;

    processPointingState(rRect);

    Vector2D<float> MousePos = pointingState.mPos;

    const bool scrollAction = mReleased || mPressed;

    if( rRect.HasPoint(MousePos) )
    {
        if( MousePos.y > fy && MousePos.y < y_innerbound_max )
        {
            if(scrollAction) // If clicked or pressed on scroll bar
            {
                float relPos = float(mScrollPos) / float(mMaxScrollAmt);

                const float scrollAreaY1 = rRect.y + mArrowHeight + mSliderHeight*0.5f;
                const float scrollAreaY2 = rRect.y + rRect.h - mArrowHeight - mSliderHeight*0.5f;
                const float scrollHeight = scrollAreaY2-scrollAreaY1;

                const float midPart_y = scrollAreaY1+(scrollHeight*relPos);

                if(mPressed)
                {
                   if(MousePos.y < scrollAreaY1 || MousePos.y > scrollAreaY2)
                       return;
                }

                // The tolerance will remove the jitter effect in scrolling
                const float tolerance = scrollHeight/float(mMaxScrollAmt);

                if(MousePos.y < midPart_y-tolerance) // Go up!
                {
                    scrollUp();
                }
                else if(MousePos.y > midPart_y+tolerance) // Go down!
                {
                    scrollDown();
                }
            }
        }
    }
}
コード例 #16
0
// 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
}
コード例 #17
0
void CMap::renderShaking()
{
    if(mMaxShakeCounter == 0)
        return;

    if(mShakeCounter < mMaxShakeCounter)
    {
        // shake by changing the relative position
        if(mShakeDir > 0)
        { // Shake downwards
            for(int i=0 ; i<mMaxShakeVAmt ; i++)
                scrollDown();

            mShakeDir = -1;
        }
        else
        { // Shake upwards
            for(int i=0 ; i<mMaxShakeVAmt ; i++)
                scrollUp();

            mShakeDir = 1;
        }
        mShakeCounter++;
    }
    else
    {
        // Stop the shaking
        mMaxShakeCounter = 0;
        mShakeDir = 0;
        mShakeCounter = 0;
    }
}
コード例 #18
0
void Screen::index()
    //=IND
{
    if (cuY == _bottomMargin)
        scrollUp(1);
    else if (cuY < lines-1)
        cuY += 1;
}
コード例 #19
0
ファイル: pet_conversations.cpp プロジェクト: OmerMor/scummvm
bool CPetConversations::MouseWheelMsg(CMouseWheelMsg *msg) {
	if (msg->_wheelUp)
		scrollUp();
	else
		scrollDown();

	return true;
}
コード例 #20
0
ファイル: editor_screen.cpp プロジェクト: JensGrabner/fx7500g
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;
}
コード例 #21
0
void Cursor::reverseLineFeed()
{
    if (new_y() == top()) {
        scrollUp(1);
    } else {
        new_ry()--;
        notifyChanged();
    }
}
コード例 #22
0
ファイル: listbox.cpp プロジェクト: clone2727/xoreos
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);
}
コード例 #23
0
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();
  }
}
コード例 #24
0
ファイル: Screen.cpp プロジェクト: arthurmde/gnuoctave
void Screen::index()
//=IND
{
  if (cuY == bmargin)
  {
    scrollUp(1);
  }
  else if (cuY < lines-1)
    cuY += 1;
}
コード例 #25
0
void Screen::clearEntireScreen()
{
    // Add entire screen to history
    for (int i = 0; i < (lines-1); i++)
    {
        addHistLine(); scrollUp(0,1);
    }

    clearImage(loc(0,0),loc(columns-1,lines-1),' ');
}
コード例 #26
0
ファイル: ktinytabbar.cpp プロジェクト: azat-archive/kate
void KTinyTabBar::wheelEvent( QWheelEvent* event )
{
    event->accept();
    
    if (event->delta() < 0) {
        scrollDown();
    } else {
        scrollUp();
    }
}
コード例 #27
0
// FIXME: This does not currently update the surfaces
void Display::printChar(char c) {
	if (c == APPLECHAR('\r'))
		_cursorPos = (_cursorPos / TEXT_WIDTH + 1) * TEXT_WIDTH;
	else if ((byte)c < 0x80 || (byte)c >= 0xa0) {
		setCharAtCursor(c);
		++_cursorPos;
	}

	if (_cursorPos == TEXT_BUF_SIZE)
		scrollUp();
}
コード例 #28
0
ファイル: TextEdit.cpp プロジェクト: tokar1/mech-math
void TextEdit::scrollToCursor() {
    if (cursorX < windowX) {
        scrollLeft(windowX - cursorX);
    } else if (cursorX > windowX + windowWidth - 1) {
        scrollRight(cursorX - (windowX + windowWidth - 1));
    }

    if (cursorY < windowY) {
        scrollUp(windowY - cursorY);
    } else if (cursorY > windowY + windowHeight - 1) {
        scrollDown(cursorY - (windowY + windowHeight - 1));
    }
}
コード例 #29
0
ファイル: cursor.cpp プロジェクト: siyuano/yat
void Cursor::reverseLineFeed()
{
    int top = m_scroll_margins_set ? m_top_margin : 0;
    if (new_y() == top) {
        //m_selection_start.new_ry()++;
        //m_selection_end.new_ry()++;
        //m_selection_moved = true;
        scrollUp(1);
    } else {
        new_ry()--;
        notifyChanged();
    }
}
コード例 #30
0
ファイル: pet_conversations.cpp プロジェクト: OmerMor/scummvm
bool CPetConversations::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
	if (_scrollDown.MouseButtonDownMsg(msg->_mousePos)) {
		scrollDown();
		return true;
	} else if (_scrollUp.MouseButtonDownMsg(msg->_mousePos)) {
		scrollUp();
		return true;
	}

	return
		_doorBot.MouseButtonDownMsg(msg->_mousePos) ||
		_bellBot.MouseButtonDownMsg(msg->_mousePos);
}