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


C++ UTFT::printNumI方法代码示例

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


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

示例1: onButtonPressed

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void SoundLevelScreen::onButtonPressed(TFTMenu* menu, int pressedButton)
{
	UTFT* dc = menu->getDC();
	dc->setColor(VGA_WHITE);
	dc->setBackColor(VGA_BLUE);
	int x_sound = 189;
	int y_sound = 102;

	if (pressedButton == backButton)
		menu->switchToScreen("Settings");

	else if (pressedButton == volumeLeftButton)
	{
		if (volumeSoundOff)
		{
			volumeSound -= 1;
			if (volumeSound < 0)
			{
				volumeSound = 0;
			}
			Settings.setVolumeSound(volumeSound);
			if (volumeSound < 10)
			{
				dc->printNumI(0, x_sound, y_sound);
				dc->printNumI(volumeSound, x_sound + 16, y_sound);
			}
			else
			{
				dc->printNumI(volumeSound, x_sound, y_sound);
			}
		}
	}
	else if (pressedButton == volumeInfoButton)
	{
		volumeSoundStr = Settings.getVolumeSound();
		volumeSoundOff = !volumeSoundOff;
		if (!volumeSoundOff)
		{
			screenButtons->deleteButton(volumeInfoButton);
			volumeInfoButton = screenButtons->addButton(165, 80, 80, 60, "m", BUTTON_SYMBOL); // кнопка  
			screenButtons->drawButton(volumeInfoButton);
		}
		else
		{
			screenButtons->deleteButton(volumeInfoButton);
			volumeInfoButton = screenButtons->addButton(165, 80, 80, 60, volumeSoundStr.c_str()); // кнопка  
			screenButtons->drawButton(volumeInfoButton);
		}
	}
	else if (pressedButton == volumeRightButton)
	{
		if (volumeSoundOff)
		{
			volumeSound += 1;
			if (volumeSound > 30)
			{
				volumeSound = 30;
			}
			Settings.setVolumeSound(volumeSound);
			if (volumeSound < 10)
			{
				dc->printNumI(0, x_sound, y_sound);
				dc->printNumI(volumeSound, x_sound + 16, y_sound);
			}
			else
			{
				dc->printNumI(volumeSound, x_sound, y_sound);
			}
		}
	}

}
开发者ID:ArduinoNanoV3,项目名称:ArduinoNanoV3,代码行数:73,代码来源:Screen2.cpp


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