menu.h

来自「通过类型姓名年龄类别来显示动物」· C头文件 代码 · 共 51 行

H
51 行
字号



//***************************************
// Menu.h: interface for the Menu class.*
//***************************************

#if !defined(_MENU_DEF__)
#define _MENU_DEF__

#ifndef BORLANDC
#include <stdlib.h>
#include <string.h>
inline void   clrscr()                   // Clear screan function

{
	system ( "cls" );
}

#else
#include <conio.h>
#endif
#define MAX_MENU_NUMBER 20               // The max Menu number is 20

class Menu 
 
{

private:

	char mTitle[100];                    // Menu Title
	int mItemNumber;                     // Menu Items number
	char * mMenuItems[MAX_MENU_NUMBER];  // Pointrer to array

public:

	int MakeChoice();                    // Get the choice from user
	void Display();                      // Display the choice
	Menu();                              // Default constructor
	Menu( char * Title, char * CharItems[], int NoOfItems ); // Normal constructor
	~Menu();                             // Destructor
	void SetTitle ( char * Title )       // Set the Title for the Menu
	{ strcpy ( mTitle, Title ); }

};

    void EatKeys();                      // To clean the input stream

#endif 

//***********************************************************************

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?