templeos-info/public/Wb/Adam/DolDoc/DocRun.HC.HTML

135 lines
13 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=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;DolDoc&quot;</span><span class=cF0>
<a name="l2"></a>
<a name="l3"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>DocEntryRun</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e,
<a name="l4"></a> </span><span class=cF1>Bool</span><span class=cF0> exited,</span><span class=cF9>I64</span><span class=cF0> *_has_action=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l5"></a>{</span><span class=cF2>//Do action on final entry sel by user.</span><span class=cF0>
<a name="l6"></a></span><span class=cF2>//Sometimes returns locked, sometimes unlocked</span><span class=cF0>
<a name="l7"></a> </span><span class=cF1>U8</span><span class=cF0> ch=doc-&gt;cmd_U8,*st;
<a name="l8"></a> </span><span class=cF9>I64</span><span class=cF0> res=</span><span class=cF3>DOCM_CANCEL</span><span class=cF0>,has_action=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l9"></a> </span><span class=cF9>CHashDefineStr</span><span class=cF0> *tmph;
<a name="l10"></a> </span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l11"></a> </span><span class=cF1>if</span><span class=cF0> (!exited) </span><span class=cF7>{</span><span class=cF0>
<a name="l12"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_ESC</span><span class=cF0>) {
<a name="l13"></a> </span><span class=cF5>Msg</span><span class=cF0>(</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>,</span><span class=cF3>CH_ESC</span><span class=cF0>,0,1&lt;&lt;</span><span class=cF3>JOBf_DONT_FILTER</span><span class=cF0>);
<a name="l14"></a> has_action=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l15"></a> </span><span class=cF1>goto</span><span class=cF0> er_done;
<a name="l16"></a> } </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_QUIT</span><span class=cF0>) {
<a name="l17"></a> </span><span class=cF5>Msg</span><span class=cF0>(</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>,</span><span class=cF3>CH_SHIFT_ESC</span><span class=cF0>,0,1&lt;&lt;</span><span class=cF3>JOBf_DONT_FILTER</span><span class=cF0>);
<a name="l18"></a> has_action=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l19"></a> </span><span class=cF1>goto</span><span class=cF0> er_done;
<a name="l20"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_CHECK_COLLAPSABLE</span><span class=cF0>) {
<a name="l21"></a> doc_e-&gt;de_flags^=</span><span class=cF3>DOCEF_CHECKED_COLLAPSED</span><span class=cF0>;
<a name="l22"></a> has_action=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l23"></a> }
<a name="l24"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l25"></a> </span><span class=cF1>try</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l26"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF3>CH_SPACE</span><span class=cF0>) {
<a name="l27"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_LINK</span><span class=cF0> &amp;&amp; doc-&gt;left_click_link) </span><span class=cF7>{</span><span class=cF0>
<a name="l28"></a> res=(*doc-&gt;left_click_link)(doc,doc_e);
<a name="l29"></a> has_action=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l30"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l31"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_LEFT_EXP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l32"></a> res=doc_e-&gt;left_exp;
<a name="l33"></a> has_action=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l34"></a> </span><span class=cF5>Msg</span><span class=cF0>(</span><span class=cF3>MSG_CMD</span><span class=cF0>,res,0,1&lt;&lt;</span><span class=cF3>JOBf_DONT_FILTER</span><span class=cF0>);
<a name="l35"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l36"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_LEFT_CB</span><span class=cF0> &amp;&amp; doc_e-&gt;left_cb) </span><span class=cF7>{</span><span class=cF0>
<a name="l37"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l38"></a> res=(*doc_e-&gt;left_cb)(doc,doc_e);
<a name="l39"></a> has_action=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l40"></a> </span><span class=cF5>Msg</span><span class=cF0>(</span><span class=cF3>MSG_CMD</span><span class=cF0>,res,0,1&lt;&lt;</span><span class=cF3>JOBf_DONT_FILTER</span><span class=cF0>);
<a name="l41"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l42"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_LEFT_MACRO</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l43"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_POPUP</span><span class=cF0>) {
<a name="l44"></a> st=</span><span class=cF5>StrNew</span><span class=cF0>(doc_e-&gt;left_macro);
<a name="l45"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l46"></a> </span><span class=cF5>PopUp</span><span class=cF0>(st,</span><span class=cF5>Fs</span><span class=cF0>);
<a name="l47"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l48"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l49"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_LEFT_IN_STR</span><span class=cF0>)
<a name="l50"></a> </span><span class=cF5>InStr</span><span class=cF0>(</span><span class=cF6>&quot;%s&quot;</span><span class=cF0>,doc_e-&gt;left_macro);
<a name="l51"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l52"></a> </span><span class=cF5>In</span><span class=cF0>(</span><span class=cF6>&quot;%s&quot;</span><span class=cF0>,doc_e-&gt;left_macro);
<a name="l53"></a> }
<a name="l54"></a> has_action=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l55"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l56"></a> </span><span class=cF1>if</span><span class=cF0> (!exited &amp;&amp; doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_LST</span><span class=cF0> &amp;&amp;
<a name="l57"></a> doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_DEFINE</span><span class=cF0> &amp;&amp;
<a name="l58"></a> </span><span class=cF7>(</span><span class=cF0>tmph=</span><span class=cF5>HashFind</span><span class=cF0>(doc_e-&gt;define_str,
<a name="l59"></a> doc-&gt;win_task-&gt;hash_table,</span><span class=cF3>HTT_DEFINE_STR</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l60"></a> </span><span class=cF7>(</span><span class=cF0>res=</span><span class=cF5>PopUpPickLst</span><span class=cF0>(tmph-&gt;data)</span><span class=cF7>)</span><span class=cF0>!=</span><span class=cF3>DOCM_CANCEL</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l61"></a> </span><span class=cF5>DocDataFmt</span><span class=cF0>(doc,doc_e,res);
<a name="l62"></a> </span><span class=cF5>DocDataScan</span><span class=cF0>(doc,doc_e);
<a name="l63"></a> has_action=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l64"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l65"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'\n'</span><span class=cF0>) {
<a name="l66"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_LINK</span><span class=cF0> &amp;&amp; doc-&gt;right_click_link) </span><span class=cF7>{</span><span class=cF0>
<a name="l67"></a> res=(*doc-&gt;right_click_link)(doc,doc_e);
<a name="l68"></a> has_action=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l69"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l70"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_RIGHT_EXP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l71"></a> res=doc_e-&gt;right_exp;
<a name="l72"></a> has_action=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l73"></a> </span><span class=cF5>Msg</span><span class=cF0>(</span><span class=cF3>MSG_CMD</span><span class=cF0>,res,0,1&lt;&lt;</span><span class=cF3>JOBf_DONT_FILTER</span><span class=cF0>);
<a name="l74"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l75"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_RIGHT_CB</span><span class=cF0> &amp;&amp; doc_e-&gt;right_cb) </span><span class=cF7>{</span><span class=cF0>
<a name="l76"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l77"></a> res=(*doc_e-&gt;right_cb)(doc,doc_e);
<a name="l78"></a> has_action=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l79"></a> </span><span class=cF5>Msg</span><span class=cF0>(</span><span class=cF3>MSG_CMD</span><span class=cF0>,res,0,1&lt;&lt;</span><span class=cF3>JOBf_DONT_FILTER</span><span class=cF0>);
<a name="l80"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l81"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_RIGHT_MACRO</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l82"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_POPUP</span><span class=cF0>) {
<a name="l83"></a> st=</span><span class=cF5>StrNew</span><span class=cF0>(doc_e-&gt;right_macro);
<a name="l84"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l85"></a> </span><span class=cF5>PopUp</span><span class=cF0>(st,</span><span class=cF5>Fs</span><span class=cF0>);
<a name="l86"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l87"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l88"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_RIGHT_IN_STR</span><span class=cF0>)
<a name="l89"></a> </span><span class=cF5>InStr</span><span class=cF0>(</span><span class=cF6>&quot;%s&quot;</span><span class=cF0>,doc_e-&gt;right_macro);
<a name="l90"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l91"></a> </span><span class=cF5>In</span><span class=cF0>(</span><span class=cF6>&quot;%s&quot;</span><span class=cF0>,doc_e-&gt;right_macro);
<a name="l92"></a> }
<a name="l93"></a> has_action=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l94"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l95"></a> }
<a name="l96"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l97"></a> </span><span class=cF1>catch</span><span class=cF0>
<a name="l98"></a> </span><span class=cF5>DocBottom</span><span class=cF0>(doc);
<a name="l99"></a> doc-&gt;cmd_U8=</span><span class=cF3>CH_SPACE</span><span class=cF0>;
<a name="l100"></a>er_done:
<a name="l101"></a> </span><span class=cF1>if</span><span class=cF0> (_has_action) *_has_action=has_action;
<a name="l102"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l103"></a>}
</span></pre></body>
</html>