Пример #1
0
//////////////////
// Key down
int CScrollbar::DoKeyDown(UnicodeChar c, int keysym, const ModifiersState& modstate)
{
	switch (keysym)  {
	case SDLK_UP:
		if (iDirection == scrVertical)
			ScrollUp();
		break;

	case SDLK_DOWN:
		if (iDirection == scrVertical)
			ScrollDown();
		break;

	case SDLK_LEFT:
		if (iDirection == scrHorizontal)
			ScrollUp();
		break;

	case SDLK_RIGHT:
		if (iDirection == scrHorizontal)
			ScrollDown();
		break;
	}

	CWidget::DoKeyDown(c, keysym, modstate);
	return WID_NOT_PROCESSED;
}
Пример #2
0
///////////////////
// Mouse wheel down
int CScrollbar::DoMouseWheelDown(int x, int y, int dx, int dy, const ModifiersState& modstate)
{
	if ((iDirection == scrVertical && !modstate.bShift) || (iDirection == scrHorizontal && modstate.bShift))
		ScrollDown();
	CWidget::DoMouseWheelDown(x, y, dx, dy, modstate);
	return WID_PROCESSED;
}
Пример #3
0
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tAbstractChannelTable::mouseMoveEvent( QMouseEvent* pEvent )
{
    // only move if we started within the table.
    if ( m_MousePressed )
    {
        bool resetStart = false;
        int yChanged = m_MouseStartY - pEvent->pos().y();
        if ( -yChanged >= m_RowHeight )
        {
            // the user moved their finger towards the bottom enough to scroll the list.
            ScrollUp();
            
            resetStart = true;
        }
        else
        {
            if ( yChanged >= m_RowHeight )
            {
                // the user moved their finger towards the top enough to scroll the list.
                ScrollDown();

                resetStart = true;
            }   
        }

        if ( resetStart )
        {
            m_MouseStartY = pEvent->pos().y();
        }
    }
}
Пример #4
0
/*------------------------------------------------------------------------------
-- FUNCTION:    UpdateDisplayBuf
--
-- DATE:        Oct 19, 2010
--
-- REVISIONS:   (Date and Description)
--
-- DESIGNER:    Dean Morin
--
-- PROGRAMMER:  Dean Morin
--
-- INTERFACE:   VOID UpdateDisplayBuf(HWND hWnd, CHAR cCharacter)
--                          hWnd        - the handle to the window
--                          cCharacter  - the character to add to the buffer
--
-- RETURNS:     VOID.
--
-- NOTES:
--              Adds cCharacter to the display buffer.
------------------------------------------------------------------------------*/
VOID UpdateDisplayBuf(HWND hWnd, CHAR cCharacter) {
    
    PWNDDATA    pwd     = NULL;
    CHAR        a[2]    = {0};    
    HDC         hdc     = {0};
    CHARINFO    ci      = {0};
    pwd = (PWNDDATA) GetWindowLongPtr(hWnd, 0);

    a[0] = cCharacter;
     
    CHARACTER(X, Y).character   = cCharacter;
    CHARACTER(X, Y).fgColor     = CUR_FG_COLOR;
    CHARACTER(X, Y).bgColor     = CUR_BG_COLOR;
    CHARACTER(X, Y).style	    = CUR_STYLE;
    
    if (X >= CHARS_PER_LINE - 1) { 
        if (pwd->wordWrap == FALSE) {
            return;
        }
        X = 0;
        if (Y < LINES_PER_SCRN - 1) { 
            Y++;
        } else {
            ScrollDown(hWnd);
        }
    } else {
        X++;
    }
}
bool pawsScrollBar::OnMouseDown(int button, int /*modifiers*/, int x, int y)
{
    if(button == csmbWheelUp || button == csmbHWheelLeft)
    {
        ScrollUp();
        // Always return true, we don't want the scroll to go to the parent widget(s)
        return true;
    }
    else if(button == csmbWheelDown || button == csmbHWheelRight)
    {
        ScrollDown();
        return true;
    }
    else if(WidgetAt(x, y) == thumb)
    {
        if(horizontal)
            thumbDragPoint = x - thumb->GetScreenFrame().xmin;
        else
            thumbDragPoint = y - thumb->GetScreenFrame().ymin;

        mouseIsDraggingThumb = true;
        thumb->SetBackground(thumbMoving);
    }
    else
    {
        MoveThumbToMouse();
    }

    return true;
}
Пример #6
0
void CSkinVerticleScrollbar::OnTimer(UINT nIDEvent) 
{
	if(nIDEvent == 1)
	{
		if(bMouseDownArrowDown)
		{
			ScrollDown();
		}
		
		if(bMouseDownArrowUp)
		{
			ScrollUp();
		}
	}
	else if(nIDEvent == 2)
	{
		if(bMouseDownArrowDown)
		{
			KillTimer(2);
			SetTimer(1, 50, NULL);
		}
		
		if(bMouseDownArrowUp)
		{
			KillTimer(2);
			SetTimer(1, 50, NULL);
		}
	}
	CStatic::OnTimer(nIDEvent);
}
Пример #7
0
/* This callback is called when some action is performed on the
   scrollbar.
   -> action : type of action that call the event.
   -> x,y    : scrollbar thumb positions, value between 0 and 1
*/
int iupMatrixScrollCB(Ihandle* ih, int action, float x, float y)
{
  int err;

  x = IupGetFloat(ih, "POSX");
  y = IupGetFloat(ih, "POSY");

  IsCanvasSet(ih, err);
  if(err == CD_OK)
  {
    switch(action)
    {
      case IUP_SBUP      : ScrollUp(ih);       break;
      case IUP_SBDN      : ScrollDown(ih);     break;
      case IUP_SBPGUP    : ScrollPgUp(ih);     break;
      case IUP_SBPGDN    : ScrollPgDown(ih);   break;
      case IUP_SBRIGHT   : ScrollRight(ih);    break;
      case IUP_SBLEFT    : ScrollLeft(ih);     break;
      case IUP_SBPGRIGHT : ScrollPgRight(ih);  break;
      case IUP_SBPGLEFT  : ScrollPgLeft(ih);   break;
      case IUP_SBPOSV    : ScrollPosVer(ih,y); break;
      case IUP_SBPOSH    : ScrollPosHor(ih,x); break;
      case IUP_SBDRAGV   : ScrollPosVer(ih,y); break;
      case IUP_SBDRAGH   : ScrollPosHor(ih,x); break;
    }
  }

  {
    cdCanvasFlush(ih->data->cddbuffer);
    ih->data->redraw = 0;
  } /* always update */

  return IUP_DEFAULT;
}
Пример #8
0
VOID CDXCtrlTreeview::AddItem(PSZ pszText, BOOL bGroup, DWORD dwPos)
{
	PLISTITEM* Insert = &m_pList;

	PLISTITEM NewItem = new LISTITEM;
	strncpy(NewItem->szText, pszText, 100);
	NewItem->szText[100] = '\0';
	NewItem->bGroup = bGroup;
	NewItem->bVisible = TRUE;
	NewItem->link = m_pList;

	if(dwPos > m_dwListCount)
		dwPos = m_dwListCount;
	m_dwListCount++;

	for(DWORD x = 0; x < dwPos; x++)
	{
		if(NewItem->bGroup == FALSE && NewItem->link && NewItem->link->bGroup)
			NewItem->bVisible = NewItem->link->bVisible;
		Insert = &NewItem->link->link;
		NewItem->link = *Insert;
	}
	*Insert = NewItem;
	
	if(NewItem->bGroup)
	{
		Insert = &NewItem->link;
		while(*Insert && (*Insert)->bGroup == FALSE)
		{
			(*Insert)->bVisible = TRUE;
			Insert = &(*Insert)->link;
		}
	}
	ScrollDown(0);
}
void CXTPDatePickerList::OnTimer(UINT_PTR /*nIDEvent*/)
{
	// determine cursor position
	DWORD dwPos = ::GetMessagePos();
	POINTS ptsPos = MAKEPOINTS(dwPos);
	CPoint ptPos;
	ptPos.x = ptsPos.x;
	ptPos.y = ptsPos.y;

	CRect rcClient;
	GetClientRect(rcClient);
	ClientToScreen(rcClient);

	if (ptPos.y < rcClient.top)
	{
		int nDiff = rcClient.top - ptPos.y;
		int nScroll = nDiff / rcClient.Height() + 1;
		ScrollUp(nScroll);

		Invalidate();
	}
	else if (ptPos.y > rcClient.bottom)
	{
		int nDiff = ptPos.y - rcClient.bottom;
		int nScroll = nDiff / rcClient.Height() + 1;
		ScrollDown(nScroll);

		Invalidate();
	}
}
BOOL CXTPDatePickerList::Create(CRect rcList)
{
	// create list control
	DWORD dwStyle = WS_POPUP | WS_EX_TOPMOST | WS_EX_WINDOWEDGE | WS_BORDER;

	m_pControl->ClientToScreen(rcList);

	if (!CreateEx(0, AfxRegisterWndClass(0, AfxGetApp()->LoadStandardCursor(IDC_ARROW)),
		NULL, dwStyle, rcList, m_pControl, 0, 0))
		return FALSE;

	CSize szCalendar = GetListSize();

	m_rcListControl = rcList;
	m_rcListControl.left = m_rcListControl.CenterPoint().x - szCalendar.cx / 2 - 1;
	m_rcListControl.right = m_rcListControl.left + szCalendar.cx;
	m_rcListControl.top = m_rcListControl.CenterPoint().y - szCalendar.cy / 2 + 1;
	m_rcListControl.bottom = m_rcListControl.top + szCalendar.cy;

	SetWindowPos(NULL, m_rcListControl.left, m_rcListControl.top, m_rcListControl.Width(), m_rcListControl.Height(), SWP_NOZORDER | SWP_NOACTIVATE | SWP_SHOWWINDOW);
	ScrollDown(0);
	RedrawWindow();

	return TRUE;
}
Пример #11
0
void MainWindow::write_to_solution(QString string)
{
    if (ui->soldock->isEnabled() == true) {
            ui->solutionbx->insertPlainText(string);
            ScrollDown(ui->solutionbx);
    }
}
Пример #12
0
/*------------------------------------------------------------------------------
-- FUNCTION:    MoveCursor
--
-- DATE:        Oct 19, 2010
--
-- REVISIONS:   (Date and Description)
--
-- DESIGNER:    Dean Morin
--
-- PROGRAMMER:  Dean Morin
--
-- INTERFACE:   VOID MoveCursor(HWND hWnd, UINT cxCoord, UINT cyCoord, 
--                              BOOL bScroll)
--                          hWnd        - the handle to the window
--                          cxCoord     - the x coordinate to move the cursor to
--                                        (1,1) origin
--                          cyCoord     - the y coordinate to move the cursor to
--                                        (1,1) origin
--                          bScroll     - whether or not to scroll when the
--                                        y coordinate is beyond the bounds of
--                                        screen
--
-- RETURNS:     VOID.
--
-- NOTES:
--              Moves the cursor to the specified position. The position passed 
--              in the arguments is based screen coordinates(1,1) origin).
--              If bScroll is true, then the screen will scroll when the top
--              of bottom lines of the window are reached.
------------------------------------------------------------------------------*/
VOID MoveCursor(HWND hWnd, INT cxCoord, INT cyCoord, BOOL bScroll) {
    PWNDDATA pwd = NULL;
    pwd = (PWNDDATA) GetWindowLongPtr(hWnd, 0);
    
    if (cxCoord < 1) {
        X = 0;
    } else if (cxCoord > CHARS_PER_LINE) {
        X = CHARS_PER_LINE - 1;
    } else {
        X = --cxCoord;
    }

    if (cyCoord < WINDOW_TOP + 1) {
        Y = WINDOW_TOP;
        if (bScroll) {
            ScrollUp(hWnd);
        }
    } else if (cyCoord > WINDOW_BOTTOM + 1) {
        Y = WINDOW_BOTTOM;
        if (bScroll) {
            ScrollDown(hWnd);
        }
    } else {
        Y = --cyCoord;
    }
}
Пример #13
0
VOID CDXCtrlTreeview::RemoveItem(DWORD dwPos)
{
	PLISTITEM* pDelete = &m_pList;
	PLISTITEM Delete;

	if(m_dwListCount == 0)
		return;

	if(dwPos > m_dwListCount--)
		dwPos = m_dwListCount;

	for(DWORD x = 0; x < dwPos; x++)
		pDelete = &(*pDelete)->link;

	Delete = *pDelete;
	*pDelete = (*pDelete)->link;

	if(Delete->bGroup)
	{
		pDelete = &Delete->link;
		while(*pDelete && (*pDelete)->bGroup == FALSE)
		{
			(*pDelete)->bVisible = Delete->bVisible;
			pDelete = &(*pDelete)->link;
		}
	}

	delete Delete;
	ScrollDown(0);
}
Пример #14
0
static void ShowConsole(int show)
{
	HWND hwnd = NULL;

	if (!hwndConsole || !pActive) return;

	gVisible = show;

	if (show) {
		hwnd = GetForegroundWindow();
		if ( InMsgs == OutMsgs )
			ScrollDown( pActive );
	}
	ShowWindow(hwndConsole, (show)?SW_SHOW:SW_HIDE);
	db_set_b(NULL,"Console","Show",(BYTE)((show)?1:0));

	if (hwnd)
		SetForegroundWindow(hwnd);

	if (show)
		RedrawWindow(pActive->hList, NULL, NULL, RDW_INVALIDATE | RDW_FRAME |RDW_UPDATENOW | RDW_ERASE);

	if (hMenu) {
		CLISTMENUITEM mi = { sizeof(mi) };
		mi.ptszName = (show) ? LPGENT("Hide Console") : LPGENT("Show Console");
		mi.flags = CMIM_NAME | CMIF_TCHAR;
		Menu_ModifyItem(hMenu, &mi);
	}

	if (hTTBButt)
		CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTBButt, (show)?TTBST_PUSHED:0);
}
Пример #15
0
/*******************************************************************************
* Function ScrollDown(unsigned int Apos, char Adir)
* ------------------------------------------------------------------------------
* Overview:  Function should be called to perform Scroll in desired direction
* Input: Scroll direction, number of lines to scroll
* Output: Nothing
*******************************************************************************/
void Scroll_Disp(unsigned int Apos, char Adir) {
  if (Adir == _Up) {
    ScrollUP(Apos);
  }
  else {
    ScrollDown(Apos);
  }
}
Пример #16
0
///////////////////////////////////////////////////////////////////////////////
// OnTimer
void CXScrollBar::OnTimer(UINT nIDEvent)
{
	if (nIDEvent == TIMER_MOUSE_OVER_BUTTON)	// mouse is in an arrow button,
												// and left button is down
	{
		if (m_bMouseDownArrowLeft)
		{
			ScrollLeft();
		}

		if (m_bMouseDownArrowRight)
		{
			ScrollRight();
		}

		if (m_bMouseDownArrowUp)
		{
			ScrollUp();
		}

		if (m_bMouseDownArrowDown)
		{
			ScrollDown();
		}
	}
	else if (nIDEvent == TIMER_LBUTTON_PRESSED)	// mouse is in an arrow button,
												// and left button has just been pressed
	{
		KillTimer(nIDEvent);

		if (m_bMouseDownArrowLeft || 
			m_bMouseDownArrowRight || 
			m_bMouseDownArrowUp || 
			m_bMouseDownArrowDown)
		{
			// debounce left click
			SetTimer(TIMER_MOUSE_OVER_BUTTON, 100, NULL);
		}
	}
	else if (nIDEvent == TIMER_MOUSE_OVER_THUMB)	// mouse is over thumb
	{
		CPoint point;
		::GetCursorPos(&point);
		ScreenToClient(&point);

		if (!m_rectThumb.PtInRect(point))
		{
			// no longer over thumb, restore thumb color
			m_bThumbHover = FALSE;
			KillTimer(nIDEvent);
			::SetCursor(::LoadCursor(NULL, IDC_ARROW));
			Invalidate();
		}
	}

	CStatic::OnTimer(nIDEvent);
}
Пример #17
0
void
cyg_hal_plf_screen_putc(void *__ch_data, char ch)
{
    CYGARC_HAL_SAVE_GP();

	switch( ch )
	{
	case '\n':
		NewLine();
		return;

	case '\r':
		XPos = 0;
		MoveCursor();
		return;

	case '\b':
		if( XPos == 0 ) return;
		XPos--;
		MoveCursor();
		return;

	case '\t':
		do
		{
			DisplayChar(' ');
		} while( (XPos % 8) != 0 );
		return;

	case 0x0c:
		ClearScreen();
		XPos = YPos = 0;
		MoveCursor();
		return;		

	case 1:
		ScrollUp(1);
		XPos = 0;
		YPos = ScreenLength-1;
		return;

	case 2:
		ScrollDown(1);
		XPos = 0;
		YPos = 0;
		return;
	
		
	default:
		DisplayChar(ch);
		return;
	}

    CYGARC_HAL_RESTORE_GP();
}
Пример #18
0
void MainWindow::encoder()
{
    int initcunt = ui->Input->toPlainText().size();
    QString text(ui->Input->toPlainText());
    ui->Output->clear();
    solbox_clear();
    write_to_solution("Coding equation: y = " +
                           QString::number(modmul) +
                           " \u2299 x \u2295 " + QString::number(modadd) + '\n');
    for (int initcont = 0; initcont != initcunt; initcont++)
    {
        char character = text.at(initcont).toUpper().unicode();
        char encrypted = character;
        char first_step;
        char second_step;
        if (character >= 'A' && character <= 'Z')
        {
            bool isLower = (bool)(text.at(initcont).unicode() / 91);
            if (character == 'Z')
                character = (char) 0;
            else
                character -= '@' ;
            first_step = (char)  ((modmul * character) % 26);
            encrypted = second_step = (char) (( first_step + modadd) % 26);
            if (encrypted == 0)
                encrypted = 'Z';
            else
                encrypted += '@';

            encrypted += (isLower * 32);
            write_to_solution(QString(encrypted) + "    =    " +
                              QString::number(second_step) + "    =    " +
                              QString::number(first_step) + " ⊕ " +
                              QString::number(modadd) + "    =    " +
                              QString::number(modmul) + " ⊙ " +
                              QString::number(character) + " ⊕ " +
                              QString::number(modadd) + '\n');
        }
        else
        {
            if (encrypted == ' ')
                ;
            else if(encrypted == '\n')
                write_to_solution("--------------------LINE END-------------------- \n\n");
            else if (ui->actionIgnore_Punctuation->isChecked() == true)
                continue;
            else
            write_to_solution(QString(encrypted) + "    =    copied, nothing done\n");
        }
        ui->Output->moveCursor (QTextCursor::End);
        ui->Output->insertPlainText (QChar(encrypted));
    }
    ScrollDown(ui->Output);
    return;
}
Пример #19
0
void Socket::ShowMessage(char *text, int size_text, char *nick, int size_nick)
{
	char t_text[MAX_TEXT];
	char t_nick[MAX_NICK];
	bool my_nick = true;

	cf.crTextColor = RGB(0, 0,0);	//color
	SendMessage(EditBox, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);	//set
	//show time
	Time_set();

	//nick
	for(int x = 0; x < size_nick; x++)	//copy nick
	{
		t_nick[x] = nick[x];	//copy nick

		if(t_nick[x] != MyNick.nick[x])
		{my_nick = false;}
	}
	t_nick[size_nick] = 0;	//set to 0

	if(my_nick)
	{
		cf.crTextColor = RGB(150,50,50);	//set to my nick color
		SendMessage(EditBox, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);	//set

		SendMessage(EditBox, EM_REPLACESEL, false, (LPARAM)t_nick);//nick

		cf.crTextColor = RGB(0,0,0);
		SendMessage(EditBox, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);	//set
	}
	else
	{
		cf.crTextColor = RGB(90,90,90);	//set to my nick color
		SendMessage(EditBox, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);	//set

		SendMessage(EditBox, EM_REPLACESEL, false, (LPARAM)t_nick);//nick

		cf.crTextColor = RGB(0,0,0);	//set to my nick color
		SendMessage(EditBox, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);	//set
	}
	SendMessage(EditBox, EM_REPLACESEL, FALSE, (LPARAM)": "); //we need to separate nick from text

	//message
	for(int x = 0; x < size_text; x++)
	{
		t_text[x] = text[x];
	}
	t_text[size_text] = 0;

	SendMessage(EditBox, EM_REPLACESEL, FALSE, (LPARAM)t_text);
	SendMessage(EditBox, EM_REPLACESEL, FALSE, (LPARAM)"\r\n");
	ScrollDown(this->EditBox);
	UpdateWindow(EditBox);
}
Пример #20
0
/** Mouse Button Down */
void ScrollBar::OnMouseDown(unsigned short /*x*/, unsigned short y,
							unsigned short Button, unsigned short /*Mod*/)
{
	//removing the double click flag, use a more sophisticated method
	//if it is needed later
	Button&=GEM_MB_NORMAL;
	if (Button==GEM_MB_SCRLUP) {
		ScrollUp();
		return;
	}
	if (Button==GEM_MB_SCRLDOWN) {
		ScrollDown();
		return;
	}
	
	if (y <= GetFrameHeight(IE_GUI_SCROLLBAR_UP_UNPRESSED) ) {
		State |= UP_PRESS;
		ScrollUp();
		return;
	}
	if (y >= Height - GetFrameHeight(IE_GUI_SCROLLBAR_DOWN_UNPRESSED)) {
		State |= DOWN_PRESS;
		ScrollDown();
		return;
	}
	// check that stepPx is set if value is set
	if (Value && !stepPx) {
		SetMax(Value);
	}
	if (y >= SliderYPos && y < SliderYPos + GetFrameHeight(IE_GUI_SCROLLBAR_SLIDER)) {
		/*
		 TODO: factor in where we grab the slider and offset it when dragging.
		 */
		State |= SLIDER_GRAB;
		return;
	}
	// if we made it this far we will jump the nib y and "grab" it
	// this way we only need to click once to jump+scroll
	State |= SLIDER_GRAB;
	SetPosForY(y - GetFrameHeight(IE_GUI_SCROLLBAR_UP_UNPRESSED));
}
Пример #21
0
void CSkinVerticleScrollbar::OnLButtonUp(UINT nFlags, CPoint point) 
{
	UpdateThumbPosition();
	KillTimer(1);
	ReleaseCapture();
	
	bool bInChannel = true;

	CRect clientRect;
	GetClientRect(&clientRect);
	int nHeight = clientRect.Height() - 37;
	CRect rectUpArrow(0,11,20,37);
	CRect rectDownArrow(0,nHeight,20,nHeight+26);
	CRect rectThumb(0,nThumbTop,20,nThumbTop+26);



	if(rectUpArrow.PtInRect(point) && bMouseDownArrowUp)
	{
		ScrollUp();	
		bInChannel = false;
	}

	if(rectDownArrow.PtInRect(point) && bMouseDownArrowDown)
	{
		ScrollDown();
		bInChannel = false;
	}

	if(rectThumb.PtInRect(point))
	{
		bInChannel = false;
	}

	if(bInChannel == true && !bMouseDown)
	{
		if(point.y > nThumbTop)
		{
			PageDown();
		}
		else
		{
			PageUp();
		}
	}

	bMouseDown = false;
	bDragging = false;
	bMouseDownArrowUp = false;
	bMouseDownArrowDown = false;
	
	CStatic::OnLButtonUp(nFlags, point);
}
Пример #22
0
//****************************************************************************************
void CBCGPropSheetBar::EnsureVisible (int iButton)
{
	ASSERT_VALID (this);

	CBCGToolbarButton* pButton = GetButton (iButton);
	ASSERT_VALID (pButton);

	CRect rectButton = pButton->Rect ();

	CRect rectWork;
	GetWorkArea (rectWork);

	if (rectButton.Height () >= rectWork.Height ())
	{
		// Work area is too small, nothing to do
		return;
	}

	if (rectButton.top >= rectWork.top && rectButton.bottom <= rectWork.bottom)
	{
		// Already visible
		return;
	}

	if (rectButton.top < rectWork.top)
	{
		while (pButton->Rect ().top < rectWork.top)
		{
			int iScrollOffset = m_iScrollOffset;

			ScrollUp ();

			if (iScrollOffset == m_iScrollOffset)
			{
				break;
			}
		}
	}
	else
	{
		while (pButton->Rect ().bottom > rectWork.bottom)
		{
			int iScrollOffset = m_iScrollOffset;

			ScrollDown ();

			if (iScrollOffset == m_iScrollOffset)
			{
				break;
			}
		}
	}
}
Пример #23
0
void tAllChannelStatus::keyPressEvent(QKeyEvent *pEvent)
{
    int key = pEvent->key();

    switch(key)
    {
    case Key::Exit:
        if( pEvent->isAutoRepeat() == false)
        {
            pEvent->accept();
            emit Cancel();
        }
        break;

    case Key::Up:
        ScrollUp();
        pEvent->accept();
        break;

    case Key::Down:
        ScrollDown();
        pEvent->accept();
        break;

    case Key::Right:
    case Key::Left:
        if( pEvent->isAutoRepeat() == false )
        {
            ToggleFavorite();
            pEvent->accept();
        }
        break;

    case Key::Enter:
    case Key::Rotary:
        if( pEvent->isAutoRepeat() == false)
        {
            tAbstractChannelTable::keyPressEvent(pEvent);
            pEvent->accept();
        }
        break;

    case Key::Menu:
        pEvent->ignore();   //this makes it so the parent gets the event
        break;

    default:
        tAbstractChannelTable::keyPressEvent(pEvent);
        break;
    };
}
Пример #24
0
void terminal_putchar(const char c) { 
	if (c == '\n') { 
		terminal_row++; 
		if (terminal_row == VGA_HEIGHT) { 
			ScrollDown(1); 
			terminal_row = 23; 
		}; 	
		terminal_column = 0; 
		return; 
	}; 
	if (terminal_column++ == VGA_WIDTH) { 
		terminal_putchar('\n'); 
		
	}; 
	terminal_putentryat(c, terminal_color, terminal_column, terminal_row); 
}; 
Пример #25
0
BOOL CDXCtrlTreeview::OnMouseWheel(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	POINT p;
	p.x = LOWORD(lParam);
	p.y = HIWORD(lParam);
	ScreenToClient(hwnd, &p);
	if(IsVisible() && HitTest(p.x, p.y))
	{
		if(HIWORD(wParam) == 120)
			ScrollUp(3);
		else
			ScrollDown(3);
		return TRUE;
	}
	return FALSE;
}
Пример #26
0
Void GUIListModel::OnScroll( const Point2 & /*ptLocalPos*/, Int iWheelDelta, GUIEventFlag iFlags )
{
    if ( m_iDisplayCount >= m_arrNodes.Count() ) {
        if ( m_iDisplayTop != 0 )
            SetScroll( 0 );
        return;
    }

    // Flags
    Bool bCtrl = ( (iFlags & GUIEVENT_FLAG_CTRL) != 0 );

    // Deal event
    if ( iWheelDelta > 0 )
        ScrollUp( bCtrl ? 3 : 1 );
    else if ( iWheelDelta < 0 )
        ScrollDown( bCtrl ? 3 : 1 );
}
Пример #27
0
void Chat::AddLines(const std::string& str)
{
    QString loc = QString::fromStdString(str).toHtmlEscaped();
    tb_->append(loc);
    int pos = 0;
    while (true)
    {
        int length = CalculateAmount(str, pos);

        Line newline;
        newline.text = str.substr(pos, length);
        lines_.push_back(newline);
        ScrollDown();

        pos += length;
        if (pos == str.size() || length == 0)
            break;
    }
}
Пример #28
0
BOOL CDXCtrlTreeview::OnCommand(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	WORD wId, wCode;
	wId = LOWORD(wParam);
	wCode = HIWORD(wParam);
	if(wCode == BN_CLICKED)
	{
		if(wId == IDC_SCROLLUP && (PCDXCtrlBase)lParam == m_pChild->FindControl(IDC_SCROLLUP))
		{
			ScrollUp(1);
			return TRUE;
		}
		else if(wId == IDC_SCROLLDOWN && (PCDXCtrlBase)lParam == m_pChild->FindControl(IDC_SCROLLDOWN))
		{
			ScrollDown(1);
			return TRUE;
		}
	}
	return FALSE;
}
Пример #29
0
VOID CDXCtrlTreeview::ToggleGroup(DWORD dwItemIndex)
{
	PLISTITEM pItem, pItem2;
	DWORD dwIndex;

	pItem = m_pList;
	for(dwIndex = 0; dwIndex < dwItemIndex; dwIndex++)
		pItem = pItem->link;

	if(pItem->bGroup)
	{
		pItem->bVisible ^= TRUE;

		for(pItem2 = pItem->link; pItem2 && pItem2->bGroup == FALSE; pItem2 = pItem2->link)
		{
			pItem2->bVisible = pItem->bVisible;
		}
	}
	ScrollDown(0);
}
Пример #30
0
void Game_Map::UpdateScroll() {
	if (scroll_rest > 0) {
		int distance = (1 << scroll_speed) / 2;
		switch (scroll_direction) {
			case 2:
				ScrollDown(distance);
				break;
			case 4:
				ScrollLeft(distance);
				break;
			case 6:
				ScrollRight(distance);
				break;
			case 8:
				ScrollUp(distance);
				break;
		}
		scroll_rest -= distance;
	}
}