• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GotoXY函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了GotoXY函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,代码来源:ext_glcd.c


示例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,代码来源:CScreen.cpp


示例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,代码来源:lcd1200.cpp


示例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,代码来源:main.c


示例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,代码来源:CUI.cpp


示例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,代码来源:interf.cpp


示例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,代码来源:CUI.cpp


示例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,代码来源:panel.cpp


示例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,代码来源:cmdline.cpp


示例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,代码来源:menubar.cpp


示例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,代码来源:guicomp.cpp


示例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,代码来源:数独.cpp


示例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,代码来源:Log.cpp


示例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,代码来源:数独.cpp


示例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,代码来源:ext_glcd.c


示例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,代码来源:guicomp.cpp


示例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,代码来源:ext_glcd.c


示例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,代码来源:Snake.c


示例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,代码来源:数独.cpp


示例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,代码来源:guicomp.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GpioInit函数代码示例发布时间:2022-05-30
下一篇:
C++ GotoDlgCtrl函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap