Пример #1
0
void StringBrowser::Init (
    ButtonState* bs, int r, int c, boolean u, int h, const char* d
) {
    const int defaultSize = 256;

    SetClassName("StringBrowser");
    input = new Sensor;
    input->Catch(DownEvent);
    input->Catch(KeyEvent);

    strbufsize = selbufsize = defaultSize;
    strbuf = new char*[strbufsize];
    selbuf = new char*[selbufsize];
    strcount = selcount = 0;

    display = nil;
    lineheight = 0;
    rows = r;
    columns = c;
    uniqueSel = u;
    singleClick = false;
    highlight = h;
    lastx = lasty = -1;
    subject = bs;
    Resource::ref(subject);
    done = d;
    perspective = new Perspective;
    InitTextDisplay();
}
Пример #2
0
void StringBrowser::Clear () {
    for (int i = 0; i < strcount; ++i) {
        delete strbuf[i];
    }
    strcount = selcount = 0;
    InitTextDisplay();

    Perspective np;
    *perspective = np;
    Resize();
}
Пример #3
0
void ClearTextDisplay(void) {
	int x;
	int y;
	GL_SetBackColor(LCD_COLOR_BLACK);
	for (row = FIRSTROW; row < LASTROW+1; row++)
	{
		y = OFFSETY_ONAIR + (row-1)*dy;

		for (col = FIRSTCOL; col <= LASTCOL; col++) {
			x = OFFSETX_ONAIR + (col-1)*dx;
			GL_PrintChar(x,y,BLANK,0);
		}
	}
	GL_SetBackColor(LCD_COLOR_WHITE);
	InitTextDisplay ();
}
Пример #4
0
void TextManip::Init (
    Viewer* v, Painter* p, Coord h, Coord tab, Tool* t, boolean multiline,
    const char* sample, int samplen
) {
    _bufsize = (CHARBUFSIZE > samplen) ? CHARBUFSIZE : samplen*2;
    _buf = new char[_bufsize];
    if (samplen > 0) {
        strncpy(_buf, sample, samplen);
    }
    _text = new TextBuffer(_buf, samplen, _bufsize);

    _viewer = v;
    _painter = p;
    Ref(_painter);
    _lineHt = h;
    _tabWidth = tab;
    _multiline = multiline;
    _tool = t;
    _dot = _mark = 0;
    InitTextDisplay(sample, samplen);
}