void
end_screen(char *message, int exit_val)
{
    int footer_rows_was_one = 0;

    if(panicking())
      return;

    if(FOOTER_ROWS(ps_global) == 1){
	footer_rows_was_one++;
	FOOTER_ROWS(ps_global) = 3;
	mark_status_unknown();
    }

    flush_status_messages(exit_val ? 0 : 1);

    blank_keymenu(_lines - 2, 0);

    if(message){
	StartInverse();
	PutLine0(_lines - 2, 0, message);
    }
    
    EndInverse();

    MoveCursor(_lines - 1, 0);

    mswin_showcaret(F_ON(F_SHOW_CURSOR, ps_global));

    if(footer_rows_was_one){
	FOOTER_ROWS(ps_global) = 1;
	mark_status_unknown();
    }
}
Exemple #2
0
bool FullDisassemblyView::MoveSelection(s32 xOffset, s32 yOffset, bool& rInvalidateView)
{
  if (!MoveCursor(xOffset, yOffset, rInvalidateView))
    return false;
  m_SelectionEnd = m_Cursor;
  return true;
}
Exemple #3
0
void SimpleConsole::OutputChar( int ch )
{
	outbyte(0xE9,ch);	//for bochs
	if(ch=='\t')
	{
		do{
			OutputChar(' ');
		}while( (cursorX-1)%4 );
		return;
	}
	if(ch=='\n')
	{
		NextLine();
	}
	else if( ch == 8 )
	{
		OutputChar( charStyle, cursorY, --cursorX );
	}
	else if ( isprint((unsigned char)ch) )
	{
		OutputChar( charStyle | ch, cursorY, cursorX++ );
	}
	if(cursorX >= width )
	{
		NextLine();
	}
	MoveCursor();
}
void CGUIDialogKeyboardGeneric::OnPasteClipboard(void)
{
  CStdStringW unicode_text;
  CStdStringA utf8_text;

// Get text from the clipboard
  utf8_text = g_Windowing.GetClipboardText();

  // Insert the pasted text at the current cursor position.
  if (utf8_text.length() > 0)
  {
    g_charsetConverter.utf8ToW(utf8_text, unicode_text);

    size_t i = GetCursorPos();
    if (i > m_strEdit.size())
      i = m_strEdit.size();
    CStdStringW left_end = m_strEdit.substr(0, i);
    CStdStringW right_end = m_strEdit.substr(i);

    m_strEdit = left_end;
    m_strEdit.append(unicode_text);
    m_strEdit.append(right_end);
    UpdateLabel();
    MoveCursor(unicode_text.length());
  }
}
Exemple #5
0
static void
dlgTextEntryHighscoreType(TCHAR *text, size_t width,
                          const TCHAR* caption)
{
    wf = NULL;
    wGrid = NULL;

    if (width == 0)
        width = MAX_TEXTENTRY;

    max_width = std::min(MAX_TEXTENTRY, width);

    wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
                    _T("IDR_XML_TEXTENTRY"));
    assert(wf != nullptr);

    if (caption)
        wf->SetCaption(caption);

    wGrid = (WndOwnerDrawFrame*)wf->FindByName(_T("frmGrid"));

    cursor = 0;
    CopyString(edittext, text, max_width);
    MoveCursor();

    wf->SetKeyDownFunction(FormKeyDown);

    if (wf->ShowModal() == mrOK) {
        TrimRight(edittext);
        CopyString(text, edittext, max_width);
    }

    delete wf;
}
Exemple #6
0
BOOL COledbRecordset::MoveBottom()
{
   _ASSERTE(IsOpen());
   // Restart and then move backwards...
   m_spRowset->RestartPosition(DB_NULL_HCHAPTER);
   return MoveCursor(-1, 1);
}
Exemple #7
0
static void do_PutLine(int x, int y, const char *line)
{
    if (x >= 0 && y >= 0)
	MoveCursor(x, y);
    while (*line)
	WriteChar(*line++);
}
Exemple #8
0
/*
 * Move the cursor to the lower-left of the screen, where it won't be annoying
 */
void
stow_cursor(
	void)
{
	if (!cmd_line)
		MoveCursor(cLINES, 0);
}
Exemple #9
0
/*
   VMenu2:Call() (т.е. функция обработки меню)
   должна возвращать true если она обработала событие и дальше ничего делать не надо
   (вне зависимости что говорит енц. о кодах возврата различных DN_*).
*/
int VMenu2::Call(int Msg, void *param)
{
	if(!mfn)
		return 0;

	SendMessage(DM_ENABLEREDRAW, 0, nullptr);
	int r=mfn(Msg, param);

	bool Visible;
	DWORD Size;
	SHORT X, Y;
	GetCursorType(Visible, Size);
	GetCursorPos(X, Y);

	if(SendMessage(DM_ENABLEREDRAW, -1, nullptr)<0)
		SendMessage(DM_ENABLEREDRAW, 1, nullptr);

	if(NeedResize)
		Resize();

	SetCursorType(Visible, Size);
	MoveCursor(X, Y);

	if(closing)
	{
		closing=false;
		if(Msg==DN_CLOSE)
			return false;
		SendMessage(DM_CLOSE, -1, nullptr);
	}

	return r;
}
void CGUIDialogKeyboardGeneric::SetText(const CStdString& aTextString)
{
  m_strEdit.Empty();
  g_charsetConverter.utf8ToW(aTextString, m_strEdit);
  UpdateLabel();
  MoveCursor(m_strEdit.size());
}
Exemple #11
0
bool MythUITextEdit::InsertCharacter(const QString &character)
{
    if (m_maxLength != 0 && m_Message.length() == m_maxLength)
        return false;

    QString newmessage = m_Message;

    const QChar *unichar = character.unicode();
    // Filter all non printable characters
    if (!unichar->isPrint())
        return false;

    if ((m_Filter & FilterAlpha) && unichar->isLetter())
        return false;
    if ((m_Filter & FilterNumeric) && unichar->isNumber())
        return false;
    if ((m_Filter & FilterSymbols) && unichar->isSymbol())
        return false;
    if ((m_Filter & FilterPunct) && unichar->isPunct())
        return false;

    newmessage.insert(m_Position+1, character);
    SetText(newmessage, false);
    MoveCursor(MoveRight);

    return true;
}
Exemple #12
0
extern bool DlgHistoryKey( gui_window *gui, void *param, int edit, int list )
{
    gui_ctl_id  id;
    gui_key     key;

    GUI_GET_KEY_CONTROL( param, id, key );
    switch( key ) {
    case GUI_KEY_UP:
        MoveCursor( gui, edit, list, -1 );
        return( true );
    case GUI_KEY_DOWN:
        MoveCursor( gui, edit, list, 1 );
        return( true );
    default:
        return( false );
    }
}
Exemple #13
0
  bool MoveCursorLeft() {
    if (cursor < 1)
      return false;

    --cursor;
    MoveCursor();
    return true;
  }
Exemple #14
0
void SimpleConsole::ClearScreen()
{
	memsetw( buffer, charStyle, width * height );
	RefreshBuffer();
	cursorX = 0;
	cursorY = 0;
	MoveCursor();
}
void CGUIDialogKeyboardGeneric::Character(WCHAR ch)
{
  if (!ch) return;
  // TODO: May have to make this routine take a WCHAR for the symbols?
  m_strEdit.Insert(GetCursorPos(), ch);
  UpdateLabel();
  MoveCursor(1);
}
Exemple #16
0
  bool MoveCursorRight() {
    if (cursor + 2 >= max_width)
      return false; // max width

    ++cursor;
    MoveCursor();
    return true;
  }
Exemple #17
0
void DrawBox( int up_left_row, int up_left_col,
              int num_rows,    int num_cols ) {

  MoveCursor( up_left_row, up_left_col) ;
  UpLeftCorner() ;
  DrawHorizontal (num_cols - 2) ;
  UpRightCorner() ;
  CursorToLeft(1) ;
  CursorDown(1) ;
  DrawVertical (num_rows - 2) ;
  MoveCursor (up_left_row, up_left_col ) ;
  CursorDown(1) ;
  DrawVertical( num_rows - 2 ) ;
  LowerLeftCorner() ;
  DrawHorizontal( num_cols - 2 ) ;
  LowerRightCorner() ;
}
Exemple #18
0
/*----------------------------------------------------------------------
     Clear specified line on the screen

 Result: The line is blanked and the cursor is left at column 0.

  ----*/
void
ClearLine(int n)
{
    if(ps_global->in_init_seq)
      return;

    MoveCursor(n, 0);
    CleartoEOLN();
}
Exemple #19
0
//------------------------------- SetGame -------------------------------------
// 게임을 처음 시작했을때 스테이지를 고를 수 있도록 해준다.
//-----------------------------------------------------------------------------
void Snake_Game::SetGame()
{
    while(true)
    {
        this->InitGame();

        //UI를 위해서
        MoveCursor(Position(14,21));
        puts("N = 다음 스테이지 / P = 이전 스테이지 / S = 시작");

        int ch=getch();

        //키값을 받고, N이면 다음스테이지 P면 이전스테이지 S를 누르면 루프를빠져간다.
        if (ch == 0xE0)
        {
            getch();
        }
        else
        {
            if (tolower(ch) == 'n')
            {
                if(current_stage_ < STAGE_FOUR)
                {
                    current_stage_++;
                }
            }
            if (tolower(ch) == 'p')
            {
                if(current_stage_ > STAGE_ONE)
                {
                    current_stage_--;
                }
            }
            if (tolower(ch) == 's')
            {
                break;
            }
        }
    }

    //UI를 지우기위해,/
    MoveCursor(Position(14,21));
    puts("                                                 ");
}
void CGUIDialogKeyboardGeneric::Backspace()
{
  int iPos = GetCursorPos();
  if (iPos > 0)
  {
    m_strEdit.erase(iPos - 1, 1);
    MoveCursor(-1);
    UpdateLabel();
  }
}
void main ()
{
	/* Variable Declarations */
	int Row, Col;
	int BoardNum = 0;
	int ULStat = 0;
	int Chan;
	double frequency;
	float    RevLevel = (float)CURRENTREVNUM;

	/* Declare UL Revision Level */
	ULStat = cbDeclareRevision(&RevLevel);

	/* Initiate error handling
	Parameters:
	PRINTALL :all warnings and errors encountered will be printed
	DONTSTOP :program will continue even if error occurs.
						Note that STOPALL and STOPFATAL are only effective in 
						Windows applications, not Console applications. 
	*/
	cbErrHandling (PRINTALL, DONTSTOP);

	/* set up the display screen */
	ClearScreen();
	printf ("Demonstration of cbTimerStart() and cbTimerStop()\n\n");
	GetTextCursor (&Col, &Row);

	Chan = 0;
	MoveCursor (0, 7);
	printf ("Enter a frequency between 16 and 1000000 Hz: ");
	MoveCursor (50, 7);
	scanf ("%lf", &frequency);
	ULStat = cbTimerOutStart (BoardNum, Chan, &frequency);
	if(ULStat == NOERRORS)
	{
		printf ("\n  Timer 0 was set to output %.2lf Hz.\n\n", frequency);
		printf ("Press any key to stop the timer:\n ");
		while (!kbhit()){}
		cbTimerOutStop(BoardNum, Chan);
	}
	MoveCursor (1, 20);
	printf ("\n");
}
Exemple #22
0
/*------------------------------------------------------------------------------
-- FUNCTION:    MakeColumns
--
-- DATE:        Nov 6, 2010
--
-- REVISIONS:   (Date and Description)
--
-- DESIGNER:    Ian Lee
--
-- PROGRAMMER:  Ian Lee
--
-- INTERFACE:   VOID MakeColumns(HWND hWnd)
--                              hWnd - handle to the window
--
-- REVISIONS:	Daniel Wright - Dec 2, 2010
--					Modified to display columns for wireless protocol.
-- RETURNS:     VOID.
--
-- NOTES:
--              Prints Column Headers "Token" and "Value"
--
------------------------------------------------------------------------------*/
VOID MakeColumns(HWND hWnd){
    CHAR temp1[10]= "Frame";
    CHAR temp2[15]= "Frame Length";
    CHAR temp3[5]= "CRC";
    DWORD i;

    MoveCursor( hWnd, 1, 1, FALSE);
    for(i=0;i<10;i++){
        UpdateDisplayBuf(hWnd,temp1[i]);
    }
    MoveCursor( hWnd, 12, 1, FALSE);
    for(i=0;i<15;i++){
        UpdateDisplayBuf(hWnd,temp2[i]);
    }
    MoveCursor(hWnd, 29, 1, FALSE);
    for(i = 0; i<5; i++){
        UpdateDisplayBuf(hWnd,temp3[i]);
    }
}
Exemple #23
0
/*----------------------------------------------------------------------
     Clear specified lines on the screen

 Result: The lines starting at 'x' and ending at 'y' are blanked
	 and the cursor is left at row 'x', column 0

  ----*/
void
ClearLines(int x, int y)
{
    int i;

    for(i = x; i <= y; i++)
      ClearLine(i);

    MoveCursor(x, 0);
}
Exemple #24
0
static void
cyg_hal_plf_screen_init_channel(void* __ch_data)
{
    KeyboardInit();
    
    XPos	= 0;
    YPos	= 0;

    ClearScreen();
    MoveCursor();
}
Exemple #25
0
void Console::Clear()
{
	uchar attribute = (Black << 4) | (White & 0xF);	//Black background, white text

	for(uint i = 0; i < m_ScreenWidth * m_ScreenHeight; i++)				//Remember, 25 rows and 80 columns
	{
		m_pVideoMemory[i] = (ushort)(0x20 | (attribute << 8));
	}

	MoveCursor(0,0);
}
void ReadJoystick()
{
  
  upval = !digitalRead(upPin) ;    
  downval = !digitalRead(downPin);    
  leftval = !digitalRead(leftPin) ;   
  rightval = !digitalRead(rightPin);   

  if (upval) {upIterationCount++;} else {upIterationCount=0;}
  if (downval) {downIterationCount++;}  else {downIterationCount=0;}
  if (leftval) {leftIterationCount++;}  else {leftIterationCount=0;}
  if (rightval) {rightIterationCount++;}  else {rightIterationCount=0;}

  if (upIterationCount > ITERATION_THRESHOLD) {upIterationCount = 0; MoveCursor(DIRECTION_UP); }
  if (downIterationCount > ITERATION_THRESHOLD) {downIterationCount = 0; MoveCursor(DIRECTION_DOWN); }
  if (leftIterationCount > ITERATION_THRESHOLD) {leftIterationCount = 0; MoveCursor(DIRECTION_LEFT); }
  if (rightIterationCount > ITERATION_THRESHOLD) {rightIterationCount = 0; MoveCursor(DIRECTION_RIGHT); }


}
Exemple #27
0
static bool
FormKeyDown(unsigned key_code)
{
    switch (key_code) {
    case KEY_UP:
    case KEY_LEFT:
        if ((key_code == KEY_LEFT) ^ IsAltair()) {
            if (cursor < 1)
                return true; // min width

            cursor--;
            MoveCursor();
            return true;
        } else {
            lettercursor--;
            UpdateCursor();
            return true;
        }

    case KEY_DOWN:
    case KEY_RIGHT:
        if ((key_code == KEY_RIGHT) ^ IsAltair()) {
            if (cursor + 2 >= max_width)
                return true; // max width

            cursor++;
            MoveCursor();
            return true;
        } else {
            lettercursor++;
            UpdateCursor();
            return true;
        }
    case KEY_RETURN:
        wf->SetModalResult(mrOK);
        return true;

    default:
        return false;
    }
}
Exemple #28
0
void
ClearScreen (void)
{
    COORD coordOrg = {0, 0};
    DWORD dwWritten = 0;
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    if (INVALID_HANDLE_VALUE != hConsole)
        FillConsoleOutputCharacter(hConsole, ' ', 80 * 50, coordOrg, &dwWritten);

    MoveCursor(0, 0);
    return;
}
Exemple #29
0
void MythUITextEdit::RemoveCharacter(int position)
{
    if (m_Message.isEmpty() || position < 0 || position >= m_Message.size())
        return;

    QString newmessage = m_Message;

    newmessage.remove(position, 1);
    if (position == m_Position)
        MoveCursor(MoveLeft);
    SetText(newmessage, false);
}
Exemple #30
0
/*----------------------------------------------------------------------

  ----*/
void
radio_help(int line, int column, HelpType help)
{
    char **text;

    /* assumption here is that HelpType is char **  */
    text = help;
    if(text == NULL)
      return;
    
    MoveCursor(line + 1, column);
    CleartoEOLN();
    if(text[0])
      PutLine0(line + 1, column, text[0]);

    MoveCursor(line + 2, column);
    CleartoEOLN();
    if(text[1])
      PutLine0(line + 2, column, text[1]);

    fflush(stdout);
}