Пример #1
0
static void
drawbox(void)
{
	chtype bottom[XLENGTH+1];
	int n;

	if(hascolor)
		attrset(COLOR_PAIR(3));

	mvaddch(YBASE - 1,  XBASE - 1, ACS_ULCORNER);
	hline(ACS_HLINE, XLENGTH);
	mvaddch(YBASE - 1,  XBASE + XLENGTH, ACS_URCORNER);

	mvaddch(YBASE + YDEPTH,  XBASE - 1, ACS_LLCORNER);
	mvinchnstr(YBASE + YDEPTH, XBASE, bottom, XLENGTH);
	for (n = 0; n < XLENGTH; n++)
		bottom[n] = ACS_HLINE | (bottom[n] & (A_ATTRIBUTES | A_COLOR));
	mvaddchnstr(YBASE + YDEPTH, XBASE, bottom, XLENGTH);
	mvaddch(YBASE + YDEPTH,  XBASE + XLENGTH, ACS_LRCORNER);

	move(YBASE,  XBASE - 1);
	vline(ACS_VLINE, YDEPTH);

	move(YBASE,  XBASE + XLENGTH);
	vline(ACS_VLINE, YDEPTH);

	if(hascolor)
		attrset(COLOR_PAIR(2));
}
Пример #2
0
static void
drawbox(bool scrolling)
{
    chtype bottom[XLENGTH + 1];
    int n;

    if (hascolor)
	(void) attrset(COLOR_PAIR(PAIR_FRAMES));

    MvAddCh(YBASE - 1, XBASE - 1, ACS_ULCORNER);
    hline(ACS_HLINE, XLENGTH);
    MvAddCh(YBASE - 1, XBASE + XLENGTH, ACS_URCORNER);

    MvAddCh(YBASE + YDEPTH, XBASE - 1, ACS_LLCORNER);
    if ((mvinchnstr(YBASE + YDEPTH, XBASE, bottom, XLENGTH)) != ERR) {
	for (n = 0; n < XLENGTH; n++) {
	    if (!scrolling)
		bottom[n] &= ~A_COLOR;
	    bottom[n] = ACS_HLINE | (bottom[n] & (A_ATTRIBUTES | A_COLOR));
	}
	(void) mvaddchnstr(YBASE + YDEPTH, XBASE, bottom, XLENGTH);
    }
    MvAddCh(YBASE + YDEPTH, XBASE + XLENGTH, ACS_LRCORNER);

    move(YBASE, XBASE - 1);
    vline(ACS_VLINE, YDEPTH);

    move(YBASE, XBASE + XLENGTH);
    vline(ACS_VLINE, YDEPTH);

    if (hascolor)
	(void) attrset(COLOR_PAIR(PAIR_OTHERS));
}
Пример #3
0
/*!
    \fn swDesktop::_drawControl ( UNode* u )
 */
int swDesktop::_drawControl ( UNode* u )
{
    Debug;
    swUiControl* w = u->Control();
    Dbg << " drawing control : "<< w->NameID();
    Rect r = u->Geometry();
    Dbg << " Abs clipped region: " << r.tostring();
    Rect l = r;
    PStr p;
    Dbg << " Abs control position:" << w->TopLeft(true).tostring();
    l -= w->TopLeft(true); // Local area;

    Dbg << "Local area:" << l.tostring() << "<-> abs area" << r.tostring();DEND;
    swWriter* wr = w->_wr;
    for( int y = 0; y < l.height(); y ++){
        p = wr->Seek( pxy(l.topleft().x(), l.topleft().y() + y) );
        if( !p ){
            Dbg << "Seek(" << pxy(l.topleft().x(), l.topleft().y() + y).tostring() << ") : invalid: writer geometry:" << wr->Geometry().tostring(); DEND;
            return 128;
        }
        mvaddchnstr( r.topleft().y() + y, r.topleft().x(), p, l.width() );
        ///@todo get pinpoints of the current line.
        //for( int x = 0; x < l.width(); x ++){
            ///@todo check pinpoints then draw visible cells

        //}
    }
    // Check z-order dirty controls

    //::refresh();
    return 0;
}