您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GotoXY函数代码示例

51自学网 2021-06-01 21:19:11
  C++
这篇教程C++ GotoXY函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GotoXY函数的典型用法代码示例。如果您正苦于以下问题:C++ GotoXY函数的具体用法?C++ GotoXY怎么用?C++ GotoXY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GotoXY函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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++;	}}
开发者ID:tarasii,项目名称:BMP085,代码行数:17,


示例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;}
开发者ID:Kevrok,项目名称:CSC-306-Project,代码行数:9,


示例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}
开发者ID:Kreyl,项目名称:Lume,代码行数:8,


示例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;	}}
开发者ID:KNVRK,项目名称:STM8SProjects,代码行数:58,


示例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;	}}	
开发者ID:AleksanderBoldyrev,项目名称:Seaker,代码行数:55,


示例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;}
开发者ID:shmuz,项目名称:Spring,代码行数:57,


示例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);}
开发者ID:AleksanderBoldyrev,项目名称:Seaker,代码行数:18,


示例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);	}}
开发者ID:johnd0e,项目名称:farmanager,代码行数:9,


示例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;}
开发者ID:johnd0e,项目名称:farmanager,代码行数:56,


示例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;}
开发者ID:landswellsong,项目名称:FAR,代码行数:10,


示例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);}
开发者ID:mcgrue,项目名称:maped2w,代码行数:10,


示例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);	}
开发者ID:chenwp,项目名称:shuax,代码行数:19,


示例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));	}}
开发者ID:KKRainbow,项目名称:FreeCROS,代码行数:42,


示例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);	}
开发者ID:chenwp,项目名称:shuax,代码行数:11,


示例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++;	}}
开发者ID:tarasii,项目名称:BMP085,代码行数:20,


示例16: TextField

void TextField(int x, int y, int width, char *str, int blink){  FilledBox(x, y, width, 9, 0);  HLine(x, y, width+1, darkw);  VLine(x, y, 9, darkw);  HLine(x+1, y+8, width-1, brightw);  VLine(x+width, y+1, 8, brightw);  GotoXY(x+2, y+2);  printstring(str);  if (blink) printstring("_");}
开发者ID:mcgrue,项目名称:maped2w,代码行数:11,


示例17: Write_GLCD

void Write_GLCD( unsigned char* message){	unsigned char i, mx;	mx = 20-curX;	for( i=0; i<mx; i++ ){		if ((curX+i) == 10){				GotoXY(10, curY);		} 		if( !message[i] ) break;		PutChar(message[i]);	}}
开发者ID:tarasii,项目名称:BMP085,代码行数:11,


示例18: Boarder

void Boarder(){   system("cls");   int i;   GotoXY(food.x,food.y);   /*displaying food*/       printf("F");   for(i=10;i<71;i++)   {       GotoXY(i,10);           printf("!");       GotoXY(i,30);           printf("!");   }   for(i=10;i<31;i++)   {       GotoXY(10,i);           printf("!");       GotoXY(70,i);       printf("!");   }}
开发者ID:aniesns,项目名称:Snake,代码行数:21,


示例19: showAll

	void showAll()	{		for (int k = 0; k < 81; k++)		{			int Row = k/9+1;			int Col = k%9+1;			if (!SUDOK[Row][Col].isok)			{				GotoXY(Col*4 - 2, Row*2 - 1);				char s[] = "0";				s[1] += sz[k];				printf(sz[k] ? s : " ");				Sleep(50);			}					}		isok = true;		GotoXY(1, 19);		printf("                                  ");		GotoXY(1, 19);	}
开发者ID:chenwp,项目名称:shuax,代码行数:21,


示例20: ButtonPressed

void ButtonPressed(int x, int y, char *str)/* -- ric: 13/Jun/98 --     *//* Draws a depressed button */{  stdwindow(x,y,x+30,y+10);  HLine(x+1, y+1, 28, darkw);  VLine(x+1, y+1, 8, darkw);  HLine(x+2, y+8, 27, winbg);  VLine(x+28, y+2, 7, winbg);  GotoXY(x+1+(15-(pixels(str)/2)), y+3);  printstring(str);}
开发者ID:mcgrue,项目名称:maped2w,代码行数:12,


示例21: TestScroll

void TestScroll(void){	unsigned char i,j;	unsigned char zz[20]={' ',' ',' ',' ','*',' ',' ',' ',' ','*',' ',' ',' ',' ','*',' ',' ',' ',' ','*'};		GotoXY(0, 0);	for (j=0;j<10;j++){		for (i=0;i<10;i++){			PutChar(zz[i+j]);		}	}}
开发者ID:tarasii,项目名称:BMP085,代码行数:12,


示例22: RemoveHighlights

void MenuBar::DisplayObject(){	FARString strSpace=L"    ";	FARString strMsg=strSpace+MSG(MMenuLeftTitle)+strSpace+MSG(MMenuFilesTitle)+strSpace+MSG(MMenuCommandsTitle)+strSpace+MSG(MMenuOptionsTitle)+strSpace+MSG(MMenuRightTitle);	RemoveHighlights(strMsg);	int Length=X2-X1+1;	FARString strFullMsg;    strFullMsg.Format(L"%-*.*ls", Length,Length, strMsg.CPtr());	GotoXY(X1,Y1);	SetColor(COL_HMENUTEXT);	Text(strFullMsg);}
开发者ID:elfmz,项目名称:far2l,代码行数:12,


示例23: Box

/*   Отрисовка прямоугольника.*/void Box(int x1,int y1,int x2,int y2,const FarColor& Color,int Type){	if (x1>=x2 || y1>=y2)		return;	enum line { LineV, LineH, LineLT, LineRT, LineLB, LineRB, LineCount };	static const BOX_DEF_SYMBOLS BoxInit[2][LineCount] =	{		{ BS_V1, BS_H1, BS_LT_H1V1, BS_RT_H1V1, BS_LB_H1V1, BS_RB_H1V1, },		{ BS_V2, BS_H2, BS_LT_H2V2, BS_RT_H2V2, BS_LB_H2V2, BS_RB_H2V2, },	};	const auto Box = BoxInit[(Type == DOUBLE_BOX || Type == SHORT_DOUBLE_BOX)];	const auto Symbol = [Box](line Line) { return BoxSymbols[Box[Line]]; };	SetColor(Color);	std::vector<wchar_t> Buffer;	Buffer.assign(y2 - y1 - 1, Symbol(LineV));	GotoXY(x1,y1+1);	VText(Buffer.data(), Buffer.size());	GotoXY(x2,y1+1);	VText(Buffer.data(), Buffer.size());	Buffer.assign(x2 - x1 + 1, Symbol(LineH));	Buffer.front() = Symbol(LineLT);	Buffer.back() = Symbol(LineRT);	GotoXY(x1,y1);	Text(Buffer.data(), Buffer.size());	Buffer.front() = Symbol(LineLB);	Buffer.back() = Symbol(LineRB);	GotoXY(x1,y2);	Text(Buffer.data(), Buffer.size());}
开发者ID:chapgaga,项目名称:farmanager,代码行数:43,


示例24: CheckBox

void CheckBox(int x, int y, int checked){  FilledBox(x, y, 7, 6, 0);  HLine(x, y, 8, darkw);  VLine(x, y, 7, darkw);  HLine(x+1, y+6, 7, brightw);  VLine(x+7, y+1, 5, brightw);  if (checked)  {    GotoXY(x+2, y+2);    printstring("*");  }}
开发者ID:mcgrue,项目名称:maped2w,代码行数:13,


示例25: show

	void show()	{		system("CLS");		consolehwnd = GetStdHandle(STD_OUTPUT_HANDLE);		SetColor(15);		GotoXY(0, 0);		printf("┏━┯━┯━┳━┯━┯━┳━┯━┯━┓/n");		printf("┃ │ │ ┃ │ │ ┃ │ │ ┃/n");		printf("┠─┼─┼─╂─┼─┼─╂─┼─┼─┨/n");		printf("┃ │ │ ┃ │ │ ┃ │ │ ┃/n");		printf("┠─┼─┼─╂─┼─┼─╂─┼─┼─┨/n");		printf("┃ │ │ ┃ │ │ ┃ │ │ ┃/n");		printf("┣━┿━┿━╋━┿━┿━╋━┿━┿━┫/n");		printf("┃ │ │ ┃ │ │ ┃ │ │ ┃/n");		printf("┠─┼─┼─╂─┼─┼─╂─┼─┼─┨/n");		printf("┃ │ │ ┃ │ │ ┃ │ │ ┃/n");		printf("┠─┼─┼─╂─┼─┼─╂─┼─┼─┨/n");		printf("┃ │ │ ┃ │ │ ┃ │ │ ┃/n");		printf("┣━┿━┿━╋━┿━┿━╋━┿━┿━┫/n");		printf("┃ │ │ ┃ │ │ ┃ │ │ ┃/n");		printf("┠─┼─┼─╂─┼─┼─╂─┼─┼─┨/n");		printf("┃ │ │ ┃ │ │ ┃ │ │ ┃/n");		printf("┠─┼─┼─╂─┼─┼─╂─┼─┼─┨/n");		printf("┃ │ │ ┃ │ │ ┃ │ │ ┃/n");		printf("┗━┷━┻━┻━┷━┷━┻━┷━┷━┛/n");		SetColor(6);		for (int j = 1; j < 10; j++)			for (int i = 1; i < 9; i++)			{				GotoXY(4*j - 2, 2*i);				if (i % 3 != 0)printf("─");				GotoXY(4*i, 2*j - 1);				if (i % 3 != 0)printf("│");				GotoXY(4*i, 2*j);				if (i % 3 != 0 && j % 3 != 0)printf("┼");			}		GotoXY(1, 19);	}
开发者ID:chenwp,项目名称:shuax,代码行数:38,


示例26: Deal_key

/***************************************函数名称:Deal_key功能描述:按键检测***************************************/void Deal_key( void){	if (sine == 0)	{		mode = 0;		GotoXY( 0, 1);		Print("sine");	}	if (tria == 0)	{		mode = 1;		GotoXY( 0, 1);		Print("tria");	}	if (squa == 0)	{		mode = 2;		GotoXY( 0, 1);		Print("squa");	}	if (Freq_de == 0)	{		while (Freq_de == 0);		Frequency -= 1;				IntToStr(Frequency, TempBuffer,3);		GotoXY( 9, 0);		Print(&TempBuffer[0]);	}	if (Freq_ad == 0)	{		while (Freq_ad == 0);		Frequency += 1;		IntToStr(Frequency, TempBuffer,3);		GotoXY( 9, 0);		Print(&TempBuffer[0]);	}}
开发者ID:sky1993,项目名称:git_1,代码行数:42,


示例27: ClearSelectAreea

void ClearSelectAreea(){    ////fn void ClearSelectAreea()    ////brief Sterge suprafata de sugestii.    ///    ///Implementarea stergerii DOAR a suprafetei rezervata sugestiilor pentru cuvintele gresite.    int i;    for(i=0;i<8;i++){        GotoXY(0,i);        printf("                                                                         ");    }}
开发者ID:dumitrubogdanmihai,项目名称:levenshtein-project,代码行数:14,


示例28: GotoXY

// ================================ Graphics ===================================void Lcd_t::DrawImage(const uint8_t x, const uint8_t y, const uint8_t* Img) {    uint8_t *p = (uint8_t*)Img;    uint16_t w;    uint8_t Width = *p++, Height = *p++;    for(uint8_t fy=y; fy < y+Height; fy++) {        GotoXY(x, fy);        for(uint8_t fx=x; fx < x+Width; fx++) {            w = *p++;            w = (w << 1) | 0x0001;            IBuf[CurrentPosition++] = w;            if(CurrentPosition >= LCD_VIDEOBUF_SIZE) continue;        } // fx    } // fy}
开发者ID:Kreyl,项目名称:nute,代码行数:15,



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


C++ GpioInit函数代码示例
C++ GotoDlgCtrl函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。