当前位置: 首页>>代码示例>>C++>>正文


C++ TDrawBuffer::moveChar方法代码示例

本文整理汇总了C++中TDrawBuffer::moveChar方法的典型用法代码示例。如果您正苦于以下问题:C++ TDrawBuffer::moveChar方法的具体用法?C++ TDrawBuffer::moveChar怎么用?C++ TDrawBuffer::moveChar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TDrawBuffer的用法示例。


在下文中一共展示了TDrawBuffer::moveChar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: draw

void TInputLine::draw()
{
    int l, r;
    TDrawBuffer b;

    uchar color = (state & sfFocused) ? getColor( 2 ) : getColor( 1 );

    b.moveChar( 0, ' ', color, size.x );
    char buf[256];
    strncpy( buf, data+firstPos, size.x - 2 );
    buf[size.x - 2 ] = EOS;
    b.moveStr( 1, buf, color );

    if( canScroll(1) )
        b.moveChar( size.x-1, rightArrow, getColor(4), 1 );
    if( (state & sfSelected) != 0 )
        {
        if( canScroll(-1) )
            b.moveChar( 0, leftArrow, getColor(4), 1 );
        l = selStart - firstPos;
        r = selEnd - firstPos;
        l = max( 0, l );
        r = min( size.x - 2, r );
        if (l <  r)
            b.moveChar( l+1, 0, getColor(3), r - l );
        }
    writeLine( 0, 0, size.x, size.y, b );
    setCursor( curPos-firstPos+1, 0);
}
开发者ID:WiLLStenico,项目名称:TestesEOutrasBrincadeiras,代码行数:29,代码来源:tinputli.cpp

示例2: drawSelect

void TStatusLine::drawSelect( TStatusItem *selected )
{
    TDrawBuffer b;
    ushort color;
    char hintBuf[256];

    ushort cNormal = getColor(0x0301);
    ushort cSelect = getColor(0x0604);
    ushort cNormDisabled = getColor(0x0202);
    ushort cSelDisabled = getColor(0x0505);
    b.moveChar( 0, ' ', cNormal, size.x );
    TStatusItem *T =  items;
    ushort i = 0;

    while( T != 0 )
        {
        if( T->text != 0 )
            {
            ushort l = cstrlen( T->text );
            if( i + l < size.x )
                {
                if( commandEnabled( T->command) )
                    if( T == selected )
                        color = cSelect;
                    else
                        color = cNormal;
                else
                    if( T == selected )
                        color = cSelDisabled;
                    else
                        color = cNormDisabled;

                b.moveChar( i, ' ', color, 1 );
                b.moveCStr( i+1, T->text, color );
                b.moveChar( i+l+1, ' ', color, 1 );
                }
            i += l+2;
            }
        T = T->next;
        }
    if( i < size.x - 2 )
        {
        strcpy( hintBuf, hint( helpCtx ) );
        if( *hintBuf != EOS )
            {
            b.moveStr( i, hintSeparator, cNormal );
            i += 2;
            if( strlen(hintBuf) + i > size.x )
                hintBuf[size.x-i] = EOS;
            b.moveStr( i, hintBuf, cNormal );
            i += strlen(hintBuf);
            }
        }
    writeLine( 0, 0, size.x, 1, b );
}
开发者ID:LucasvBerkel,项目名称:TweedejaarsProject,代码行数:55,代码来源:TSTATUSL.CPP

示例3: draw

void TCalcDisplay::draw()
{
    char color = getColor(1);
    short i;
    TDrawBuffer buf;

    i = (short)(size.x - strlen(number) - 2);
    buf.moveChar(0, ' ', color, (short)size.x);
    buf.moveChar(i, sign, color, (short)1 );
    buf.moveStr((short)(i+1), number, color);
    writeLine(0, 0, (short)size.x, 1, buf);
}
开发者ID:OS2World,项目名称:DEV-CPLUSPLUS-UTIL-Turbo_Vision_C--,代码行数:12,代码来源:calc.cpp

示例4: draw

void TCalcDisplay::draw()
{
    char color = getColor(1);
    int i;
    TDrawBuffer buf;

    i = size.x - strlen(number) - 2;
    buf.moveChar(0, ' ', color, size.x);
    buf.moveChar(i, sign, color, 1);
    buf.moveStr(i+1, number, color);
    writeLine(0, 0, size.x, 1, buf);
}
开发者ID:WiLLStenico,项目名称:TestesEOutrasBrincadeiras,代码行数:12,代码来源:calc.cpp

示例5: draw

void TTable::draw() {
    TDrawBuffer buf;
    char color = getColor(6);

    for (ushort y = 0; y <= size.y - 1; y++) {
        buf.moveChar(0, ' ', color, (short) size.x);
        for (ushort x = 0; x <= size.x - 1; x++)
            buf.moveChar(x, (ushort)(32 * y + x), color, (ushort) 1);
        writeLine(0, y, (short) size.x, (ushort) 1, buf);
    }
    showCursor();
}
开发者ID:idispatch,项目名称:tvtest,代码行数:12,代码来源:main.cpp

示例6: draw

void TCalcDisplay::draw() {
   char color = getColor(1);
   int i;
   TDrawBuffer buf;

   i = size.x - strlen(number) - 2;
   buf.moveChar(0, ' ', color, size.x);
   if (hexmode)
      buf.moveChar(1, 'x', color&0xF0|0xC , 1);
   if (memory)
      buf.moveChar(2, 'm', color&0xF0|0xD , 1);
   buf.moveChar(i, sign, color, 1);
   buf.moveStr(i + 1, number, color);
   writeLine(0, 0, size.x, 1, buf);
}
开发者ID:OS2World,项目名称:SYSTEM-LOADER-QSINIT,代码行数:15,代码来源:calc.cpp

示例7: draw

/*
 * Deseneaza textul pe ecran.
 */
void TInterior::draw()
{
	setLimit(maxLineLength, lineCount);
	ushort color = getColor(0x0301);
	for (int i = 0; i < size.y; i++)
	{
		TDrawBuffer b;
		b.moveChar(0, ' ', color, size.x);	// umplu cu spatii

		int j = delta.y + i;

		if (j < lineCount && lines[j] != 0)
		{
			char s[maxLineLength];
			if (delta.x > strlen(lines[j]))
				s[0] = EOS;
			else
			{
				strncpy(s, lines[j] + delta.x, size.x);
				s[size.x] = EOS;
			}

			b.moveCStr(0, s, color);
		}

		writeLine(0, i, size.x, 1, b);
	}
}
开发者ID:bdumitriu,项目名称:playground,代码行数:31,代码来源:helpwin.cpp

示例8: sysErr

short TSystemError::sysErr( short errorCode, uchar drive )
{
    ushort c = ( (TScreen::screenMode & 0x00FF) != TDisplay::smMono  ) ?
                                        sysColorAttr : sysMonoAttr;
    char s[ 63 ];
    TDrawBuffer b;

//  bug-fix TV2B-31 ---------------------------------------
    /* There are 22 documented device errors, all of which have their
     * own strings in errorString[].  However, just in case we run into
     * something weird this will prevent a crash.
     */
//  end of bug-fix. ---------------------------------------
    if( errorCode < (sizeof(errorString) / sizeof(errorString[0])) )
        sprintf( s, errorString[ errorCode ], drive + 'A' );
    else
        sprintf( s, "Unknown critical error %d on drive %c", errorCode, drive + 'A' );

// modification #TV2N-04 ----------------------------------
    // EFW - Modified to be screen size aware.
    b.moveChar( 0, ' ', c, TScreen::screenWidth);
    b.moveCStr( 1, s, c);
    b.moveCStr( TScreen::screenWidth - cstrlen(sRetryOrCancel) - 1,
        sRetryOrCancel, c);
// end of modification ------------------------------------
    swapStatusLine(b);
    int res = selectKey();
    swapStatusLine(b);
    return res;
}
开发者ID:gdobra,项目名称:tvision,代码行数:30,代码来源:SYSERR.cpp

示例9: draw

void TBackground::draw()
{
    TDrawBuffer b;

    b.moveChar( 0, pattern, getColor(0x01), size.x );
    writeLine( 0, 0, size.x, size.y, b );
}
开发者ID:gdobra,项目名称:tvision,代码行数:7,代码来源:TBKGRND.cpp

示例10: drawBox

void TCluster::drawBox( const char *icon, char marker)
{
    TDrawBuffer b;
    ushort color;

    ushort cNorm = getColor( 0x0301 );
    ushort cSel = getColor( 0x0402 );
    for( int i = 0; i <= size.y; i++ )
        {
        for( int j = 0; j <= (strings->getCount()-1)/size.y + 1; j++ )
            {
            int cur = j * size.y + i;
            if( cur < strings->getCount() )
                {
                int col = column( cur );
                if( (cur == sel) && (state & sfSelected) != 0 )
                    color = cSel;
                else
                    color = cNorm;
                b.moveChar( col, ' ', color, size.x - col );
                b.moveCStr( col, icon, color );
                if( mark(cur) )
                    b.putChar( col+2, marker );
                b.moveCStr( col+5, (char *)(strings->at(cur)), color );
                if( showMarkers && (state & sfSelected) != 0 && cur == sel )
                    {
                    b.putChar( col, specialChars[0] );
                    b.putChar( column(cur+size.y)-1, specialChars[1] );
                    }
                }
            }
        writeBuf( 0, i, size.x, 1, b );
        }
    setCursor( column(sel)+2, row(sel) );
}
开发者ID:WiLLStenico,项目名称:TestesEOutrasBrincadeiras,代码行数:35,代码来源:tcluster.cpp

示例11: draw

void TPercentageText::draw()
{
	ushort color = getColor(1);

	char *string = new char[size.x + 1];
	itoa( Round( percentage * pow10( precisionDigits ) ), string, 10 );

	if( precisionDigits > 0 )
		{
		memmove( &string[strlen( string ) - precisionDigits + 1],
			    &string[strlen( string ) - precisionDigits],
			    precisionDigits + 1 );
		string[strlen( string ) - 1 - precisionDigits] = point;
		}
	strcat( string, percentageString );
	if( string[0] == point )
		{
		memmove( &string[1], string, strlen( string ) + 1 );
		string[0] = '0';
		}

	TDrawBuffer b;
	b.moveChar( 0, ' ', color, size.x );
	b.moveStr( size.x - 1 - strlen( string ), string, color );
	writeLine( 0, 0, size.x, 1, b );

	delete[] string;
}
开发者ID:jskripsky,项目名称:ancient,代码行数:28,代码来源:PRCNTTXT.CPP

示例12: draw

void TIndicator::draw()
{
    uchar color, frame;
    TDrawBuffer b;
    char s[15];

    if( (state & sfDragging) == 0 )
        {
        color = getColor(1);
        frame = dragFrame;
        }
    else
        {
        color = getColor(2);
        frame = normalFrame;
        }

    b.moveChar( 0, frame, color, size.x );
    if( modified )
        b.putChar( 0, 15 );
    ostrstream os( s, 15 );

    os << ' ' << (location.y+1)
       << ':' << (location.x+1) << ' ' << ends;

    b.moveCStr( 8-int(strchr(s, ':')-s), s, color);
    writeBuf(0, 0, size.x, 1, b);
}
开发者ID:LucasvBerkel,项目名称:TweedejaarsProject,代码行数:28,代码来源:TINDICTR.CPP

示例13: draw

void TInterior::draw()       // modified for scroller
{
    ushort color = getColor(0x0301);
    for( int i = 0; i < size.y; i++ )
        // for each line:
    {
        TDrawBuffer b;
        b.moveChar( 0, ' ', color, size.x );
        // fill line buffer with spaces
        int j = delta.y + i;       // delta is scroller offset
        if( j < lineCount && lines[j] != 0 )
        {
            char s[maxLineLength];
            if( delta.x > strlen(lines[j] ) )
                s[0] = EOS;
            else
            {
                strncpy( s, lines[j]+delta.x, size.x );
                s[size.x] = EOS;
            }
            b.moveCStr( 0, s, color );
        }
        writeLine( 0, i, size.x, 1, b);
    }

}
开发者ID:Mikelle02,项目名称:GameMaker,代码行数:26,代码来源:TVGUID12.CPP

示例14: draw

void TOutlineViewer::draw() {
   ushort nrmColor = getColor(0x0401);

   firstThat(drawTree);
   dBuf.moveChar(0, ' ', nrmColor, size.x);
   writeLine(0, auxPos + 1, size.x, size.y - (auxPos - delta.y), dBuf);
}
开发者ID:OS2World,项目名称:SYSTEM-LOADER-QSINIT,代码行数:7,代码来源:toutline.cpp

示例15: draw

void TFileViewer::draw()
{
    char *p;

    ushort c =  getColor(0x0301);
    for( int i = 0; i < size.y; i++ )
        {
        TDrawBuffer b;
	b.moveChar( 0, ' ', c, size.x );

        if( delta.y + i < fileLines->getCount() )
            {
            char s[maxLineLength+1];
            p = (char *)( fileLines->at(delta.y+i) );
            if( p == 0 || strlen(p) < delta.x )
                s[0] = EOS;
            else
		{
		strncpy( s, p+delta.x, size.x );
		if( strlen( p + delta.x ) > size.x )
                    s[size.x] = EOS;
                }
            b.moveStr( 0, s, c );
            }
        writeBuf( 0, i, size.x, 1, b );
        }
}
开发者ID:WiLLStenico,项目名称:TestesEOutrasBrincadeiras,代码行数:27,代码来源:fileview.cpp


注:本文中的TDrawBuffer::moveChar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。