Beispiel #1
0
void TextVideo::Clear(uint32_t color)
{
	for (int i = 0; i < (TEXT_HEIGHT*TEXT_WIDTH); i++)
	{
		m_video[i] = (uint16_t)(color << 12);
	}
	DisableCursor();
}
Beispiel #2
0
/*-----------------------------------------------------------------*/
void __fastcall CrCursorHandlerImpl::SetCursor (FELD _feld, int _i, int _j, bool _clearselection/*=true*/)
{
    DisableCursor();
    CrFeld* p = GetFeld (_feld);
    if (p) {
        p->SetCursor (_i, _j);
        feld = p;
    }
    frm->kbd_field = feld->feld; //xxx Obsolet?!
    if (_clearselection) frm->ClearSelection();
    EnableCursor();
    CheckLocked();
}
Beispiel #3
0
/*-----------------------------------------------------------------*/
void __fastcall CrCursorHandlerImpl::GotoField (FELD _feld)
{
    dbw3_assert(feld);
    dbw3_assert(frm);
    CrFeld* p = GetFeld (_feld);
    if (!p || !p->IsVisible()) return;
    DisableCursor();
    feld = p;
    frm->kbd_field = _feld;
    feld->SyncSharedCoord();
    EnableCursor();
    frm->ClearSelection();
    CheckLocked();
}
Beispiel #4
0
/*-----------------------------------------------------------------*/
void __fastcall CrFeld::MoveCursorDown (int _step, bool _select)
{
    DisableCursor();

    if (_select) frm->ResizeSelection (fb.kbd.i+fb.ScrollX(), fb.kbd.j+fb.ScrollY(), feld, false);

    fb.kbd.j -= _step;
    if (fb.kbd.j<0) fb.kbd.j = 0;

    UpdateSharedCoord (fb.kbd.i, fb.kbd.j);

    EnableCursor();
    if (_select) frm->ResizeSelection (fb.kbd.i+fb.ScrollX(), fb.kbd.j+fb.ScrollY(), feld, false);
    else frm->ClearSelection();
}
Beispiel #5
0
/*-----------------------------------------------------------------*/
void __fastcall CrCursorHandlerImpl::GotoPrevField()
{
    dbw3_assert(feld);
    dbw3_assert(frm);
    if (feld) {
        DisableCursor();
        // Funktioniert nur wenn mindestens ein
        // Feld sichtbar ist.
        do {
            feld = feld->prev;
            if (frm->ViewSchlagpatrone->Checked && feld->feld==AUFKNUEPFUNG)
                feld = feld->prev;
        } while (!feld->IsVisible());
        frm->kbd_field = feld->feld; //xxx Obsolet?!
        feld->SyncSharedCoord();
        EnableCursor();
        frm->ClearSelection();
        CheckLocked();
    }
    dbw3_assert(feld);
}
Beispiel #6
0
/*-----------------------------------------------------------------*/
void __fastcall CrCursorHandlerImpl::CheckLocked()
{
    if (locked && feld) {
        // Position modulo Rapport
        dbw3_assert(frm);
        DisableCursor();

        if (feld->feld==GEWEBE || feld->feld==EINZUG) {
            int rx = frm->rapport.kr.count();
            if (rx>0) {
                int x0 = frm->rapport.kr.a;
                int i = feld->fb.kbd.i+frm->scroll_x1;
                int ii = i-x0;
                while (ii<0) ii += rx;
                int newi = ii%rx + x0;
                if (newi<frm->scroll_x1) newi = frm->scroll_x1;
                feld->fb.kbd.i = newi-frm->scroll_x1;
            }
        }

        if (feld->feld==GEWEBE || feld->feld==TRITTFOLGE) {
            int ry = frm->rapport.sr.count();
            if (ry>0) {
                int y0 = frm->rapport.sr.a;
                int j = feld->fb.kbd.j+frm->scroll_y2;
                int jj = j-y0;
                while (jj<0) jj += ry;
                int newj = jj%ry + y0;
                if (newj<frm->scroll_y2) newj = frm->scroll_y2;
                feld->fb.kbd.j = newj-frm->scroll_y2;
            }
        }

        EnableCursor();
    }
}
Beispiel #7
0
TextVideo::TextVideo() {
	m_video = (unsigned short*) VIDEO_ADDRESS_TEXT;
	DisableCursor();
}