本文整理汇总了C++中TDrawBuffer::moveBuf方法的典型用法代码示例。如果您正苦于以下问题:C++ TDrawBuffer::moveBuf方法的具体用法?C++ TDrawBuffer::moveBuf怎么用?C++ TDrawBuffer::moveBuf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDrawBuffer
的用法示例。
在下文中一共展示了TDrawBuffer::moveBuf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void TFrame::draw()
{
ushort cFrame, cTitle;
short f, i, l, width;
TDrawBuffer b;
if( (state & sfActive) == 0 )
{
cFrame = 0x0101;
cTitle = 0x0002;
f = 0;
}
else
if( (state & sfDragging) != 0 )
{
cFrame = 0x0505;
cTitle = 0x0005;
f = 0;
}
else
{
cFrame = 0x0503;
cTitle = 0x0004;
f = 9;
}
cFrame = getColor(cFrame);
cTitle = getColor(cTitle);
width = size.x;
l = width - 10;
if( ( ((TWindow *)owner)->flags & (wfClose | wfZoom) ) != 0 )
l -= 6;
frameLine( b, 0, f, uchar(cFrame) );
if( ((TWindow *)owner)->number != wnNoNumber &&
((TWindow *)owner)->number < 10
)
{
l -= 4;
if( ( ((TWindow *)owner)->flags & wfZoom ) != 0 )
i = 7;
else
i = 3;
b.putChar( width-i, ((TWindow *)owner)->number + '0' );
}
if( owner != 0 )
{
const char *title = ((TWindow *)owner)->getTitle(l);
if( title != 0 )
{
l = min( cstrlen(title), width - 10 );
l = max( l, 0 );
i = (width - l) >> 1;
b.putChar( i-1, ' ' );
b.moveBuf( i, title, cTitle, l );
b.putChar( i+l, ' ' );
}
}
示例2: draw
void TStaticText::draw()
{
uchar color;
Boolean center;
int i, j, l, p, y;
TDrawBuffer b;
char s[256];
color = getColor(1);
getText(s);
l = strlen(s);
p = 0;
y = 0;
center = False;
while (y < size.y)
{
b.moveChar(0, ' ', color, size.x);
if (p < l)
{
if (s[p] == 3)
{
center = True;
++p;
}
i = p;
do {
j = p;
while ((p < l) && (s[p] == ' '))
++p;
while ((p < l) && (s[p] != ' ') && (s[p] != '\n'))
++p;
} while ((p < l) && (p < i + size.x) && (s[p] != '\n'));
if (p > i + size.x)
if (j > i)
p = j;
else
p = i + size.x;
if (center == True)
j = (size.x - p + i) / 2 ;
else
j = 0;
b.moveBuf(j, &s[i], color, (p - i));
while ((p < l) && (s[p] == ' '))
p++;
if ((p < l) && (s[p] == '\n'))
{
center = False;
p++;
if ((p < l) && (s[p] == 10))
p++;
}
}
writeLine(0, y++, size.x, 1, b);
}
}