本文整理汇总了C++中Functions::Settings方法的典型用法代码示例。如果您正苦于以下问题:C++ Functions::Settings方法的具体用法?C++ Functions::Settings怎么用?C++ Functions::Settings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Functions
的用法示例。
在下文中一共展示了Functions::Settings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DisplayMenu
int Menu::DisplayMenu()
{
Display display;
Configuration config;
Functions func;
string PanelHeaders[8] = {" MENU ", " DISPLAY ", " SERVER LIST ", " SET USERNAME ", " SETTINGS ", " ABOUT ", " QUIT ", " NEWS "};
string MenuList[MaxNo_Menu] = {" Server List ", " Set Username ", " Settings ", " About ", " Quit "};
int ypos[MaxNo_Menu] = { 12, 14, 16, 18, 20};
int xpos = 5;
config.SetColour(MenuTitleColour);
config.SetXYCoord(4, 10); cout << PanelHeaders[0];
config.SetColour(MenuTitleColour);
config.SetXYCoord(42, 10); cout << PanelHeaders[1];
// Show Menu
int i;
config.SetColour(StandardColour);
for (i=0; i< MaxNo_Menu; ++i)
{
config.SetXYCoord(xpos, ypos[i] );
config.SetColour(StandardColour);
cout << MenuList[i];
}
// Enable Menu
i = 0;
while(1)
{
config.SetXYCoord(xpos, ypos[i]);
config.SetColour(HoverColour);
cout << MenuList[i];
switch( _getch() )
{
case 72: if(i>0)
{
config.SetXYCoord(xpos,ypos[i] );
config.SetColour(StandardColour); // Standard Going Down
cout << MenuList[i];
i--;
}
break;
case 80: if(i< MaxNo_Menu-1 )
{
config.SetXYCoord(xpos,ypos[i] );
config.SetColour(StandardColour); // Standard Going Up
cout << MenuList[i];
i++;
}
break;
case 13:
if(i==0)
{
func.ServerBrowser(PanelHeaders);
}
if(i==1)
{
func.SetUsername(PanelHeaders);
}
if(i==2)
{
func.Settings(PanelHeaders);
}
if(i==3)
{
func.DisplayAbout(PanelHeaders);
}
if(i==4)
{ // Exit
display.RemoveText();
config.SetColour(MenuTitleColour), config.SetXYCoord(42, 10), cout << PanelHeaders[6];
config.SetColour(StandardColour);
char Input;
config.SetXYCoord(34,12); cout << "Are you sure you want to exit? [Y/N]: ";
cin >> Input;
if (toupper(Input) == 'N')
{
break;
}
else if (toupper(Input) == 'Y')
{
config.SetXYCoord(34,15); return 0;
}
else if (Input == ' ' || Input != toupper('Y') || Input != toupper('N'))
{
while(Input == ' ' || Input != toupper('Y') || Input != toupper('N'))
{
config.SetColour(ErrorColour);
config.SetXYCoord(34,13),cout << "Error: Please Enter [Y/N]: ";
config.SetColour(StandardColour), cin >> Input;
if (toupper(Input) == 'N')
{
break;
}
else if (toupper(Input) == 'Y')
//.........这里部分代码省略.........