121 lines
9.7 KiB
HTML
Executable File
121 lines
9.7 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="generator" content="TempleOS V5.03">
|
|
<meta name="viewport" content="width=device-width">
|
|
<link rel="stylesheet" href="/style/templeos.css">
|
|
<script src="/script/templeos.js"></script>
|
|
<style type="text/css">
|
|
.cF0{color:#000000;background-color:#ffffff;}
|
|
.cF1{color:#0000aa;background-color:#ffffff;}
|
|
.cF2{color:#00aa00;background-color:#ffffff;}
|
|
.cF3{color:#00aaaa;background-color:#ffffff;}
|
|
.cF4{color:#aa0000;background-color:#ffffff;}
|
|
.cF5{color:#aa00aa;background-color:#ffffff;}
|
|
.cF6{color:#aa5500;background-color:#ffffff;}
|
|
.cF7{color:#aaaaaa;background-color:#ffffff;}
|
|
.cF8{color:#555555;background-color:#ffffff;}
|
|
.cF9{color:#5555ff;background-color:#ffffff;}
|
|
.cFA{color:#55ff55;background-color:#ffffff;}
|
|
.cFB{color:#55ffff;background-color:#ffffff;}
|
|
.cFC{color:#ff5555;background-color:#ffffff;}
|
|
.cFD{color:#ff55ff;background-color:#ffffff;}
|
|
.cFE{color:#ffff55;background-color:#ffffff;}
|
|
.cFF{color:#ffffff;background-color:#ffffff;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre id="content">
|
|
<a name="l1"></a><span class=cF2>//See </span><span class=cF4><u>Menus</span><span class=cF0>
|
|
<a name="l2"></a>
|
|
<a name="l3"></a></u>#</span><span class=cF1>define</span><span class=cF0> M_OPTION1 1
|
|
<a name="l4"></a>#</span><span class=cF1>define</span><span class=cF0> M_OPTION2 2
|
|
<a name="l5"></a>
|
|
<a name="l6"></a></span><span class=cF1>U0</span><span class=cF0> PullDownMenuDemo()
|
|
<a name="l7"></a>{
|
|
<a name="l8"></a> </span><span class=cF9>I64</span><span class=cF0> msg_code,arg1,arg2;
|
|
<a name="l9"></a> </span><span class=cF9>CMenuEntry</span><span class=cF0> *tmpse;
|
|
<a name="l10"></a>
|
|
<a name="l11"></a> </span><span class=cF5>MenuPush</span><span class=cF0>(
|
|
<a name="l12"></a> </span><span class=cF6>"File {"</span><span class=cF0>
|
|
<a name="l13"></a> </span><span class=cF6>" Open(,'O');"</span><span class=cF0>
|
|
<a name="l14"></a> </span><span class=cF6>" Save(,'S');"</span><span class=cF0>
|
|
<a name="l15"></a> </span><span class=cF6>" Exit(,CH_SHIFT_ESC);"</span><span class=cF0>
|
|
<a name="l16"></a> </span><span class=cF6>"}"</span><span class=cF0>
|
|
<a name="l17"></a> </span><span class=cF6>"Edit {"</span><span class=cF0>
|
|
<a name="l18"></a> </span><span class=cF6>" Cut(,,SC_DELETE|SCF_SHIFT);"</span><span class=cF0>
|
|
<a name="l19"></a> </span><span class=cF6>" Paste(,,SC_INS|SCF_SHIFT);"</span><span class=cF0>
|
|
<a name="l20"></a> </span><span class=cF6>"}"</span><span class=cF0>
|
|
<a name="l21"></a> </span><span class=cF6>"Misc {"</span><span class=cF0>
|
|
<a name="l22"></a> </span><span class=cF6>" Beep(,CH_SPACE);"</span><span class=cF0>
|
|
<a name="l23"></a> </span><span class=cF6>" Opt1(MSG_CMD,M_OPTION1);"</span><span class=cF0>
|
|
<a name="l24"></a> </span><span class=cF6>" Opt2(MSG_CMD,M_OPTION2);"</span><span class=cF0>
|
|
<a name="l25"></a> </span><span class=cF6>"}"</span><span class=cF0>
|
|
<a name="l26"></a> </span><span class=cF6>"Help {"</span><span class=cF0>
|
|
<a name="l27"></a> </span><span class=cF6>" Help(,,0x3B0000003B);"</span><span class=cF0>
|
|
<a name="l28"></a> </span><span class=cF6>" About(,,0x23B0000023B);"</span><span class=cF0>
|
|
<a name="l29"></a> </span><span class=cF6>"}"</span><span class=cF0>);
|
|
<a name="l30"></a>
|
|
<a name="l31"></a> </span><span class=cF6>"A pull-down menu will appear "</span><span class=cF0>
|
|
<a name="l32"></a> </span><span class=cF6>"if you move the mouse to the top "</span><span class=cF0>
|
|
<a name="l33"></a> </span><span class=cF6>"of the scrn.\n\n"</span><span class=cF0>;
|
|
<a name="l34"></a>
|
|
<a name="l35"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l36"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&arg1,&arg2,1<<</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>+1<<</span><span class=cF3>MSG_CMD</span><span class=cF0>);
|
|
<a name="l37"></a> </span><span class=cF6>"\nCmd:%d ARG1:%X ARG2:%X\n\n"</span><span class=cF0>,msg_code,arg1,arg2;
|
|
<a name="l38"></a>
|
|
<a name="l39"></a> </span><span class=cF1>switch</span><span class=cF0> (msg_code) {
|
|
<a name="l40"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>:
|
|
<a name="l41"></a> </span><span class=cF1>switch</span><span class=cF0> (arg1) </span><span class=cF7>{</span><span class=cF2>//ASCII</span><span class=cF0>
|
|
<a name="l42"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_SPACE</span><span class=cF0>:
|
|
<a name="l43"></a> </span><span class=cF5>Beep</span><span class=cF0>;
|
|
<a name="l44"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l45"></a> </span><span class=cF1>case</span><span class=cF0> 0:
|
|
<a name="l46"></a> </span><span class=cF1>switch</span><span class=cF0> (arg2.u8[0]) {</span><span class=cF2>//arg2=Scan code</span><span class=cF0>
|
|
<a name="l47"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SC_F1</span><span class=cF0>:
|
|
<a name="l48"></a> </span><span class=cF1>if</span><span class=cF0> (arg2&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>)
|
|
<a name="l49"></a> </span><span class=cF6>"About PullDown Demo\n"</span><span class=cF0>;
|
|
<a name="l50"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l51"></a> </span><span class=cF6>"Test the menu.\n"</span><span class=cF0>;
|
|
<a name="l52"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l53"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SC_DELETE</span><span class=cF0>:
|
|
<a name="l54"></a> </span><span class=cF1>if</span><span class=cF0> (arg2&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>)
|
|
<a name="l55"></a> </span><span class=cF6>"Cut\n"</span><span class=cF0>;
|
|
<a name="l56"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l57"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SC_INS</span><span class=cF0>:
|
|
<a name="l58"></a> </span><span class=cF1>if</span><span class=cF0> (arg2&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>)
|
|
<a name="l59"></a> </span><span class=cF6>"Paste\n"</span><span class=cF0>;
|
|
<a name="l60"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l61"></a> }
|
|
<a name="l62"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l63"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l64"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l65"></a>
|
|
<a name="l66"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_CMD</span><span class=cF0>:
|
|
<a name="l67"></a></span><span class=cF2>//I Recommend making your menu</span><span class=cF0>
|
|
<a name="l68"></a> </span><span class=cF2>//drive by key strokes, but you can</span><span class=cF0>
|
|
<a name="l69"></a> </span><span class=cF2>//use the </span><a href="/Wb/Kernel/KernelA.HH.HTML#l3175"><span class=cF4>MSG_CMD</span></a><span class=cF2> val.</span><span class=cF0>
|
|
<a name="l70"></a> </span><span class=cF1>switch</span><span class=cF0> (arg1) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l71"></a> </span><span class=cF1>case</span><span class=cF0> M_OPTION1:
|
|
<a name="l72"></a> </span><span class=cF6>"Option # 1\n"</span><span class=cF0>;
|
|
<a name="l73"></a> </span><span class=cF1>if</span><span class=cF0> (tmpse=</span><span class=cF5>MenuEntryFind</span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>->cur_menu,</span><span class=cF6>"Misc/Opt1"</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l74"></a> tmpse->checked=!tmpse->checked;
|
|
<a name="l75"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l76"></a> </span><span class=cF1>case</span><span class=cF0> M_OPTION2:
|
|
<a name="l77"></a> </span><span class=cF6>"Option # 2\n"</span><span class=cF0>;
|
|
<a name="l78"></a> </span><span class=cF1>if</span><span class=cF0> (tmpse=</span><span class=cF5>MenuEntryFind</span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>->cur_menu,</span><span class=cF6>"Misc/Opt2"</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l79"></a> tmpse->checked=!tmpse->checked;
|
|
<a name="l80"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l81"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l82"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l83"></a> }
|
|
<a name="l84"></a>
|
|
<a name="l85"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>||</span><span class=cF7>(</span><span class=cF0>arg1!=</span><span class=cF3>CH_SHIFT_ESC</span><span class=cF0> && arg1!=</span><span class=cF3>CH_ESC</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l86"></a> </span><span class=cF5>MenuPop</span><span class=cF0>;
|
|
<a name="l87"></a>}
|
|
<a name="l88"></a>
|
|
<a name="l89"></a>PullDownMenuDemo;
|
|
</span></pre></body>
|
|
</html>
|