?? tc2.0下寫的dos圖形中文菜單.htm
字號:
<TD width=768 bgColor=#cc6600><FONT
color=#ffffff>>>計算機考試></FONT><FONT
color=#ffffff>C語言專區</FONT><FONT
color=#ffffff> |</FONT><A
href="http://www.ugpr.com/"><FONT color=#ffffff>首頁</FONT></A><FONT
color=#ffffff> </FONT><FONT color=#ffffff>|<A
href="http://www.ugpr.com/jsjks/c/shili/jsjks.htm"> </A></FONT><A
href="http://www.ugpr.com/jsjks/c/shili/jsjks.htm"><FONT
color=#ffffff>計算機考試</FONT></A><FONT color=#ffffff> |<A
href="http://www.ugpr.com/jsjks/c/proe/proe.htm"> </A></FONT><A
href="http://www.ugpr.com/jsjks/c/proe/proe.htm"><FONT
color=#ffffff>Pro/ENGINEER</FONT><FONT color=#ffffff> </FONT></A><FONT
color=#ffffff>| <A
href="http://www.ugpr.com/jsjks/c/ug/ug.htm"></A></FONT><A
href="http://www.ugpr.com/jsjks/c/ug/ug.htm"><FONT
color=#ffffff>Unigraphics</FONT></A><FONT color=#ffffff> | <A
href="http://www.ugpr.com/ansys/ansys.htm"><FONT
color=#ffffff>ANSYS</FONT></A> | </FONT><A
href="http://www.ugpr.com/jsjks/c/shoucang/shoucang.htm"><FONT
color=#ffffff>本站收藏</FONT></A><FONT color=#ffffff> | </FONT><A
href="http://www.ugpr.com/jsjks/c/aboutme/aboutme.htm"><FONT
color=#ffffff>關于站長</FONT></A><FONT color=#ffffff>|</FONT></TD></FORM></TR>
<TR>
<TD width=768 bgColor=#efefef>
<TABLE id=table1 cellSpacing=0 cellPadding=0 width=767 align=center
border=0>
<TBODY>
<TR style="FONT-SIZE: 12px">
<TD style="FONT-SIZE: 12px" vAlign=bottom width=107
bgColor=#008000>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P>
<P><B><A href="http://www.ugpr.com/jsjks/c/shili/c.htm"><FONT
color=#ffffff><回上頁</FONT></A></B></P></TD>
<TD style="FONT-SIZE: 12px" vAlign=top width=42>
<P> </P>
<P> </P>
<P> </P></TD>
<TD style="FONT-SIZE: 12px" vAlign=top width=515> <BR>
<BR><BR>TC2.0下寫的DOS圖形中文菜單<BR><BR><BR>這是本人自編的在DOS下的比較全面操作的圖形中文菜單!不過當前目錄需要有UCDOS自帶的幾個字庫文件!hzk24h,hzk24k文件<BR><BR>/*---------------------------------------------------------------------------<BR>File:
MENU.C<BR>Function: Operate
MainMenu<BR>---------------------------------------------------------------------------*/<BR>#
define MAX_FRAME 4<BR># define UP 72<BR># define DOWN 80<BR># define
LEFT 75<BR># define RIGHT 77<BR># define ESC 27<BR># define F1
59<BR># define DEL 83<BR># define SPACE 32<BR># define ENTER 13<BR>#
define Alt_X 45<BR># define Alt_Y 21<BR># define Alt_D 32<BR>#
define Alt_T 20<BR># define Alt_O 24<BR># define BackSpace
8<BR>struct gmenu{<BR>int left,top;<BR>char *menuname;<BR>char
*submenu[7];<BR>int
count,width;<BR>}menuframe[MAX_FRAME]={<BR>{15,31,"數據庫操作(D)",{"打開庫文件",<BR>"顯示庫結構",<BR>"顯示記錄內容",<BR>"記錄查找",<BR>"關閉庫文件",<BR>"-",<BR>"退出ALT+X"},7,14,},<BR>{175,31,"函數曲線圖(T)",{"SIN函數",<BR>"COS函數",<BR>"TAN函數",<BR>"CTG函數",<BR>"-",<BR>"B組設計"},6,12,},<BR>{335,31,"軟件(DIY)",{"窗口顏色",<BR>"窗口字體顏色",<BR>"主菜單設置",<BR>"子菜單設置",<BR>"-",<BR>"系統填充模式",<BR>"用戶定義模式",},7,12,},<BR>{480,31,"其他(O)",{"老鼠闖迷宮 ",<BR>"串口通訊傳輸",<BR>"音樂欣賞 ",<BR>"-",<BR>"系統還原",<BR>"幫助 F1",<BR>"關于"},7,12,}};<BR>char
*title="C語言程序綜合設計";<BR>int
diy_style=1,diy_ufill=-1,diy_color=BLUE,diy_bkcolor=LIGHTGRAY,chang=0;<BR>int
diy_sgkcolor=RED,diy_sgcolor=WHITE,diy_mgkcolor=CYAN,diy_mgcolor=BLUE;<BR><BR>int
setmenu(void)<BR>{ int
title_x=200;<BR>setbkcolor(BLUE);<BR>setcolor(WHITE);<BR>Tbox(2,2,getmaxx()-2,getmaxy()-2,LIGHTGRAY,BLUE,4);<BR>dis_hz(title_x,8,title,YELLOW);<BR>Tline(6,getmaxy()-32,getmaxx()-6,getmaxy()-32);<BR>setfillstyle(0,1);bar(10,getmaxy()-28,getmaxx()-10,getmaxy()-7);<BR>dis_hz(10,getmaxy()-28,"操作導航:請選擇………",WHITE);<BR>dis_hz(getmaxx()-12-7*16,getmaxy()-28,"退出ALT+X",WHITE);<BR>listtopmenu();return
0;<BR>}<BR>int listtopmenu(void)<BR>{ int
i;<BR>Tbutton(7,28,getmaxx()-8,53,diy_bkcolor,diy_color,NULL,0,diy_style);<BR>for
(i=0;i<MAX_FRAME;i++)<BR>Tbutton(menuframe[i].left,menuframe[i].top,menuframe[i].left+(strlen(menuframe[i].menuname)+2)*8,menuframe[i].top+20,diy_bkcolor,diy_color,menuframe[i].menuname,0,diy_style);<BR>return
0;<BR>}<BR>int loadmenu(int which)<BR>{int
i,keylr,size,sleft,stop,zwidth,swidth,scount,atop,ptop,subwhich;<BR>void
*buffer;<BR>subwhich=keylr=sleft=stop=0;<BR>while
(1)<BR>{setfillstyle(0,1);bar(90,getmaxy()-28,getmaxx()-8*16,getmaxy()-7);<BR>dis_hz(90,getmaxy()-28,menuframe[which].submenu[subwhich],WHITE);<BR>sleft=menuframe[which].left;stop=menuframe[which].top;<BR>zwidth=sleft+(strlen(menuframe[which].menuname)+2)*8;<BR>swidth=sleft+(menuframe[which].width+2)*8+10;<BR>scount=menuframe[which].count;atop=stop+30;<BR>for
(i=0;i<scount;i++)
atop=(strcmp("-",menuframe[which].submenu[i])==0)?atop+10:atop+30;<BR>size=imagesize(sleft,stop,((swidth>zwidth)?swidth:zwidth)+(which==2?2:12),atop+stop);<BR>if
(size!=-1) buffer=malloc(size);<BR>if
(keylr==0||change==2||(buffer&&(keylr==LEFT||keylr==RIGHT)))<BR>{
getimage(sleft,stop,((swidth>zwidth)?swidth:zwidth)+(which==2?2:12),atop+stop,buffer);change=0;
}<BR>Tbutton(sleft,stop,zwidth,stop+19,diy_mgkcolor,diy_mgcolor,menuframe[which].menuname,0,diy_style);<BR>Tbutton(sleft+4,stop+30,swidth+7,atop+15,diy_bkcolor,diy_color,NULL,0,diy_style);<BR>ptop=stop+40;<BR>for
(i=0;i<scount;i++)<BR>{ if
(strcmp("-",menuframe[which].submenu[i])==0)<BR>{
Tline(sleft+8,ptop+3,swidth+5,ptop+3); ptop+=10;}<BR>else<BR>{ if
(subwhich==i)
Tbutton(sleft+13,ptop,sleft+25+(menuframe[which].width)*8,ptop+22,diy_sgkcolor,diy_sgcolor,menuframe[which].submenu[i],0,diy_style);<BR>else
Tbutton(sleft+13,ptop,sleft+25+(menuframe[which].width)*8,ptop+22,diy_bkcolor,diy_color,menuframe[which].submenu[i],0,diy_style);<BR>ptop+=30;
}<BR>}<BR>switch (keylr=inkey())<BR>{ case Alt_X:
quit();break;<BR>case F1 : help();break;<BR>case ESC:
which=-1;break;<BR>case LEFT:
which=which==0?MAX_FRAME-1:which-1;subwhich=0;listtopmenu();break;<BR>case
RIGHT:
which=which==MAX_FRAME-1?0:which+1;subwhich=0;listtopmenu();break;<BR>case
UP: subwhich=(subwhich==0)?scount-1:subwhich-1;<BR>if
(strcmp(menuframe[which].submenu[subwhich],"-")==0)
subwhich--;break;<BR>case DOWN:
subwhich=(subwhich==scount-1)?0:subwhich+1;<BR>if
(strcmp(menuframe[which].submenu[subwhich],"-")==0)
subwhich++;break;<BR>case ENTER:<BR>clear();<BR>if (which==0)<BR>{
if (subwhich==0) openfile();<BR>if (subwhich==1)
list_db_structure();<BR>if (subwhich==2) list_db_recorder();<BR>if
(subwhich==3) db_search();<BR>if (subwhich==4) closefile();<BR>if
(subwhich==6) quit();<BR>}<BR>if (which==1)<BR>if (subwhich==5)
{system("fpk");cleardevice();setmenu();}<BR>else
draw(subwhich+1);<BR>if (which==2)<BR>{ if (subwhich==0)
set_bkcolor();<BR>if (subwhich==1) set_color();<BR>if (subwhich==2)
set_mcolor();<BR>if (subwhich==3) set_scolor();<BR>if (subwhich==5)
set_fillstyle();<BR>if (subwhich==6) set_filluser();<BR>}<BR>if
(which==3)<BR>{ if (subwhich==0)
{system("maze");cleardevice();setmenu();}<BR>if (subwhich==1)
message(menuframe[which].submenu[subwhich]);<BR>if (subwhich==2)
playmusic();<BR>if (subwhich==4) reset();<BR>if (subwhich==5)
help();<BR>if (subwhich==6) welcome();<BR>}<BR>clear();<BR>}<BR>if
(buffer&&(keylr==LEFT||keylr==RIGHT))
{putimage(sleft,stop,buffer,COPY_PUT);clear();}<BR>free(buffer);<BR>if
(change==1) {listtopmenu();clear();change=2;}<BR>if (which<0) {
listtopmenu();clear();break; }<BR>}<BR>return 0;<BR>}<BR><BR>int
inkey(void)<BR>{int key;<BR>while(bioskey(1)==0)
display_time(400,getmaxy()-50,WHITE);<BR>key=bioskey(0);<BR>key=key&0xff?key&0xff:key>>8;<BR>return
(key);<BR>}<BR><BR><BR><BR><BR><BR><BR> </TD>
<TD style="FONT-SIZE: 12px" vAlign=top width=102
bgColor=#008000> </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV>
<TABLE height=65 cellSpacing=0 cellPadding=0 width=770 align=center
background=TC2.0下寫的DOS圖形中文菜單.files/bottom_line.gif border=0>
<TBODY>
<TR>
<TD height=5> </TD></TR>
<TR>
<TD align=middle>
<SCRIPT src=""></SCRIPT>
<SCRIPT>var tc_user="adu520";var tc_class="2";</SCRIPT>
<SCRIPT src=""></SCRIPT>
<SCRIPT src=""></SCRIPT>
</TD></TR>
<TR>
<TD align=middle>
<DIV align=center><FONT face=Verdana, size=2 sans-serif Helvetica,
Arial,>CopyRight© </FONT><FONT size=2 sans-serif helvetica, arial,>2003
</FONT><A href="http://adu520.yeah.net/"><STRONG><FONT color=#000000
size=2 sans-serif helvetica, arial,>樂知網絡</FONT></STRONG></A><FONT
face=Verdana, size=2 sans-serif Helvetica, Arial,>All Rights
Reserved</FONT></DIV></TD></TR>
<TR>
<TD align=middle>
<DIV align=center>
<P align=center>未經授權禁止復制或建立鏡像。謝謝!</P></DIV></TD></TR></TBODY></TABLE>
<SCRIPT src=""></SCRIPT>
</BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -