订餐c语言课程设计,C语言课程设计案例--菜单设计(国外英文资料).doc

C语言课程设计案例--菜单设计(国外英文资料)

C语言课程设计案例--菜单设计(国外英文资料)

The debugging environment is TC2.0 or 3.0. Running this program requires several header files from the tc. It is recommended to modify the include directory entry in the options menu to the directory under the tc's include (see chapter 1 for details). Or copy the source program to the tc directory.

# include < conio. H >

# include < DOS. H >

# include < graphics. H >

# include < stdio, h >

# include < stdlib. H >

/ * define some constant * /

# define NO 0

1 # define YES

# define NONE - 1

# define MAX_MENU 7 / * according to the situation changes the maximum number of items that can be displayed in the menu

/ * global parameter * /

Int X, Y;

Int Selection;

Int button, x, y;

Void * p;

Size_t area;

/ * menu structure * /

Struct MENU

{

/ * top left * /

Int x;

Int y;

/ * bottom right corner * /

Int the x1;

Int y1.

Unsigned char Active [MAX_MENU]; The / * menu item is active in the symbol * /

Char * head; / * the name of the menu (optional) * /

};

Int MouseOn.

Void the Process ();

Void Xorbar (int sx, int sy, int ex, int ey, int c);

Void the Show ();

Void Hide ();

Void the Status ();

/ * the user can change the position of the button with the following parameters. * /

Struct MENU File = {200, 110,250, 130}

Struct MENU Edit = {295,110,345,130}

The struct MENU Help = {390, 110,440,130}

Struct MENU Close = {600, 10, 620, 30}

Struct MENU Neeraj = {380,300,460,315}

Void main ()

{

Int gd = DETECT, gm;

/ * initialize the graphical interface * /

Initgraph.

Selection = NONE;

/ does the / * activate the menu item, YES indicates activation; NO means unactivation * /

For (gd = 0; gd < MAX_MENU; g + +)

{

File. The Active (gd) = YES;

Edit. Active [gd] = YES;

Help. Active [gd] = YES;

Close the Active (gd) = YES;

}

/ * the name of the menu item that the user can modify to display other names * /

A. head = "[File Menu]"

Edit: Edit. Head = "[Edit Menu]";

I can't Help you.

Close. Head = "[Exit]";

/ * allocate memory to the interface

Area = imagesize (0, 0, 150, 150);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值