本文整理汇总了C++中GotoXY函数的典型用法代码示例。如果您正苦于以下问题:C++ GotoXY函数的具体用法?C++ GotoXY怎么用?C++ GotoXY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GotoXY函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WrapWrite_GLCD
void WrapWrite_GLCD( unsigned char* message){
unsigned char i, x, mx;
x = 0;
mx = 160-curX-curY*20;
for( i=0; i<mx; i++ ){
if ((curX+x) == 10){
GotoXY(10, curY);
x = 0;
} else if ((curX+x) == 20){
GotoXY(0, curY+1);
x = 0;
}
if( !message[i] ) break;
PutChar(message[i]);
x++;
}
}
示例2: GotoXY
//*****************************************************************************
float CScreen::GetVal(int iX, int iY)
{
float val;
if (iX != -1 && iY != -1)
GotoXY(iX, iY);
scanf_s("%f", &val);
return val;
}
示例3: GotoXY
void Lcd_t::Cls() {
#if LCD_DMA_BASED
for(uint32_t i=0; i < LCD_VIDEOBUF_SIZE; i++) IBuf[i] = 0x0001;
#else
GotoXY(0, 0);
for(uint32_t i=0; i < 864; i++) IWriteData(0);
#endif
}
示例4: DrawDemo
void DrawDemo( void ) {
char xx;
int i;
//char carRX = 0;
/*u8 fontWidth;
if ( Blink == 0 ) {
Blink = 30000;
fontWidth = DrawChar5x5(curX, curY, '_', LCD_PIXEL_INV);
// Blink Debug LED
GPIO_WriteReverse(GPIOD, GPIO_PIN_0);
} else {
Blink--;
}
if (UART2_GetFlagStatus(UART2_FLAG_RXNE) != RESET) {
carRX = UART2_ReceiveData8();
}
if ( carRX != 0 ) {
fontWidth = DrawChar5x5(curX, curY, '_', LCD_PIXEL_OFF);
if ( carRX == 13 ) {
curX = 2;
curY += FONT_HEIGHT + 1;
if ( curY > DISPLAY_HEIGHT ) {
DrawScreen();
}
} else if ( carRX == 10 ) {
} else {
fontWidth = DrawChar5x5(curX, curY, carRX, LCD_PIXEL_ON);
curX += fontWidth + 1;
if ( curX > DISPLAY_WIDTH ) {
curX = 2;
curY += FONT_HEIGHT + 1;
if ( curY + FONT_HEIGHT > DISPLAY_HEIGHT ) {
DrawScreen();
}
}
}
}*/
Blink = 0;
DrawScreen();
GotoXY(2,10);
PutText(text,LCD_PIXEL_ON);
UpdateLCD();
if ( strlen(text) > 0 ) {
xx = text[0];
for(i=1; i < strlen(text)-1; i++) {
text[i - 1] = text[i];
}
text[strlen(text)-2] = xx;
}
}
示例5: switch
void CUI::RemShipState(bool who, units shiplen, units s)
{
units shift = 2;
switch (who)
{
case (PLAYER) :
switch (shiplen)
{
case (4) : //*** 4-Ship count. ***
GotoXY(s + *l4 + 5, 4);
PrintCol("\xDB");
break;
case (3) : //*** 3-Ship count. ***
*l3 += 2;
GotoXY(s + *l3 + 2, 4);
PrintCol("\xDB");
break;
case (2) : //*** 2-Ship count. ***
*l2 += 2;
GotoXY(s + *l2 + 1, 4);
PrintCol("\xDB");
break;
case (1) : //*** 1-Ship count. ***
*l1 += 2;
GotoXY(s + *l1, 4);
PrintCol("\xDB");
break;
}
break;
case (COMP) :
switch (shiplen)
{
case (4) : //*** 4-Ship count. ***
GotoXY(s + *k4 + 5, 4 + shift);
PrintCol("\xDB");
break;
case (3) : //*** 3-Ship count. ***
*k3 += 2;
GotoXY(s + *k3 + 2, 4 + shift);
PrintCol("\xDB");
break;
case (2) : //*** 2-Ship count. ***
*k2 += 2;
GotoXY(s + *k2 + 1, 4 + shift);
PrintCol("\xDB");
break;
case (1) : //*** 1-Ship count. ***
*k1 += 2;
GotoXY(s + *k1, 4 + shift);
PrintCol("\xDB");
break;
}
break;
}
}
示例6: ScrollBarEx3
bool ScrollBarEx3(UINT X1,UINT Y1,UINT Length, UINT64 Start,UINT64 End,UINT64 Size)
{
WCHAR StackBuffer[4000/sizeof(WCHAR)], *Buffer = StackBuffer;
if ( Length <= 2 || End < Start )
return false;
if ( Length >= ARRAYSIZE(StackBuffer) )
Buffer = new WCHAR[Length + 1];
Buffer[0] = Oem2Unicode[0x1E];
Buffer[Length--] = L'\0';
Buffer[Length--] = Oem2Unicode[0x1F];
WCHAR b0 = BoxSymbols[BS_X_B0], b2 = BoxSymbols[BS_X_B2];
UINT i, i1, i2;
if ( End > Size )
End = Size;
if ( !Size || Start >= End )
{
i1 = Length+1;
i2 = 0;
}
else
{
UINT thickness = static_cast<UINT>(((End - Start) * Length) / Size);
if ( !thickness )
++thickness;
if ( thickness >= Length )
i2 = (i1 = 1) + Length;
else if ( End >= Size )
i1 = (i2 = 1 + Length) - thickness;
else
{
i1 = 1 + static_cast<UINT>((Start*Length + Size/2)/ Size);
if ( i1 == 1 && Start > 0 )
++i1;
i2 = i1 + thickness;
if ( i2 >= Length+1 )
{
i2 = Length + 1;
if ( i1 < i2-1 )
--i2;
}
}
}
for (i = 1; i <= Length; i++)
Buffer[i] = (i >= i1 && i < i2 ? b2 : b0);
GotoXY(X1, Y1);
VText(Buffer);
if ( Buffer != StackBuffer )
delete[] Buffer;
return true;
}
示例7: GotoXY
void CUI::PrintField(Field* f)
{
int xx;
if (f->owner == PLAYER) xx = 1 + x;
else xx = 2 + _w + x;
units fx = 0, fy = 0;
for (int h = y + 1; h != _h + y + 1; h++) for (int w = xx; w != _w + xx; w++)
{
GotoXY(w, h);
fx = w - xx;
fy = h - y - 1;
f->SetPos(fx, fy);
SetColor(clship, clback);
printf("%c", (char)f->GetPosVal());
}
GotoXY(x, y + _h + 3);
SetColor(cldef, clbdef);
}
示例8: SetColor
void Panel::DrawSeparator(int Y) const
{
if (Y<m_Y2)
{
SetColor(COL_PANELBOX);
GotoXY(m_X1,Y);
ShowSeparator(m_X2-m_X1+1,1);
}
}
示例9: GetPrompt
size_t CommandLine::DrawPrompt()
{
const auto PromptList = GetPrompt();
const size_t MaxLength = PromptSize*ObjWidth() / 100;
std::vector<size_t> Sizes;
Sizes.reserve(PromptList.size());
size_t PromptLength = 0;
size_t FixedLength = 0;
size_t CollapsibleCount = 0;
for (const auto& i: PromptList)
{
Sizes.emplace_back(i.Text.size());
PromptLength += i.Text.size();
if (i.Collapsible)
++CollapsibleCount;
else
FixedLength += i.Text.size();
}
size_t CollapsibleItemLength = 0;
bool TryCollapse = false;
if (PromptLength > MaxLength)
{
if (CollapsibleCount)
{
if (FixedLength < MaxLength)
CollapsibleItemLength = (MaxLength - FixedLength) / CollapsibleCount;
TryCollapse = true;
}
}
size_t CurLength = 0;
GotoXY(m_X1, m_Y1);
for (const auto& i: PromptList)
{
auto str = i.Text;
if (TryCollapse && i.Collapsible)
{
TruncPathStr(str, static_cast<int>(CollapsibleItemLength));
}
if (CurLength + str.size() > MaxLength)
TruncPathStr(str, std::max(0, static_cast<int>(MaxLength - CurLength)));
SetColor(i.Colour);
Text(str);
CurLength += str.size();
if (CurLength >= MaxLength)
break;
}
return CurLength;
}
示例10: RemoveHighlights
void MenuBar::DisplayObject()
{
string strSpace=L" ";
string strMsg=strSpace+MSG(MMenuLeftTitle)+strSpace+MSG(MMenuFilesTitle)+strSpace+MSG(MMenuCommandsTitle)+strSpace+MSG(MMenuOptionsTitle)+strSpace+MSG(MMenuRightTitle);
RemoveHighlights(strMsg);
int Length=X2-X1+1;
GotoXY(X1,Y1);
SetColor(COL_HMENUTEXT);
FS << fmt::LeftAlign() << fmt::Width(Length) << fmt::Precision(Length) << strMsg;
}
示例11: BigButtonPressed
void BigButtonPressed(int x, int y, char *str)
{
stdwindow(x,y,x+50,y+10);
HLine(x+1, y+1, 48, darkw);
VLine(x+1, y+1, 8, darkw);
HLine(x+2, y+8, 47, winbg);
VLine(x+48, y+2, 7, winbg);
GotoXY(x+1+(25-(pixels(str)/2)), y+3);
printstring(str);
}
示例12: forceInit
void forceInit()
{
GotoXY(1, 19);
printf(" ");
GotoXY(1, 19);
printf("正在进行第二步处理...");
int x = 0;
isok = false;
for (int i = 1; i < 10; i++)
{
for (int j = 1; j < 10; j++)
{
sz[x++] = SUDOK[i][j].result;
}
}
SetColor(6);
force(0);
SetColor(10);
}
示例13: switch
void Printer::Print(const char* str)
{
int i;
for (;*str;str++)
{
switch (*str) {
case '\n':
for (i=xpos;i<COLUMNS;i++)
{
Putchar(i,ypos,' ');
}
xpos = 0;
ypos++;
break;
case '\b':
if (xpos==0&&ypos==0) ;
else if (xpos==0) {
xpos = COLUMNS-1;
ypos--;
} else {
xpos--;
}
Putchar(xpos,ypos,' ');
break;
default:
Putchar(xpos,ypos,*str);
if (xpos==COLUMNS-1) {
xpos = 0;
ypos++;
} else {
xpos++;
}
break;
}
}
if (ypos<=(LINES-1)) {
GotoXY(xpos,ypos);
} else {
Scrollup(ypos-(LINES-1));
GotoXY(xpos,(LINES-1));
}
}
示例14: comp
void comp(int Row, int Col, int x)
{
if (x == 0) return ;
SUDOK[Row][Col].isok = true;
SUDOK[Row][Col].result = x;
GotoXY(Col*4 - 2, Row*2 - 1);
char s[] = "0";
s[1] += x;
printf(s);
Sleep(50);
}
示例15: TestChars
void TestChars(void){
unsigned char i,j,x;
x = 0;
for (i=0x21;i<0xC1;i++){
if ((curX+x) == 10){
GotoXY(10, curY);
x = 0;
} else if ((curX+x) == 20){
GotoXY(0, curY+1);
x = 0;
}
for (j=0;j<5;j++){
WriteData(tableGLCDChars[i-32][j]);
}
//PutChar(i);
x++;
}
}