templeos-info/public/Wb/Adam/Gr/SpriteSideBar.HC.HTML

127 lines
11 KiB
Plaintext
Raw Normal View History

2024-03-24 21:24:44 +00:00
<!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;Graphics/Sprite;Sprites&quot;</span><span class=cF0>
<a name="l2"></a>
<a name="l3"></a></span><span class=cF9>CSprite</span><span class=cF0> *</span><span class=cF5>SpriteSideBar2SpriteQue</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>CSprite</span><span class=cF0> *head,</span><span class=cF9>I64</span><span class=cF0> *_cur_elem_num)
<a name="l4"></a>{</span><span class=cF2>//For the side-bar</span><span class=cF0>
<a name="l5"></a> </span><span class=cF9>CSprite</span><span class=cF0> *res=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CSprite</span><span class=cF7>)</span><span class=cF0>),*tmpg;
<a name="l6"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e=doc-&gt;head.next;
<a name="l7"></a> </span><span class=cF1>Bool</span><span class=cF0> found=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l8"></a> </span><span class=cF9>I64</span><span class=cF0> num=0;
<a name="l9"></a> </span><span class=cF5>QueInit</span><span class=cF0>(res);
<a name="l10"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e!=doc) </span><span class=cF7>{</span><span class=cF0>
<a name="l11"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;type_u8==</span><span class=cF3>DOCT_MENU_VAL</span><span class=cF0> &amp;&amp; doc_e-&gt;left_exp&gt;=0) {
<a name="l12"></a> tmpg=</span><span class=cF5>SpriteSetSettings</span><span class=cF0>(,head,doc_e-&gt;left_exp);
<a name="l13"></a> </span><span class=cF1>if</span><span class=cF0> (tmpg!=head) </span><span class=cF7>{</span><span class=cF0>
<a name="l14"></a> tmpg=</span><span class=cF5>MAllocIdent</span><span class=cF0>(tmpg);
<a name="l15"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&amp;tmpg-&gt;type,</span><span class=cF3>SPf_SEL</span><span class=cF0>,</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;doc_e-&gt;type,</span><span class=cF3>DOCEt_SEL</span><span class=cF7>)</span><span class=cF0>);
<a name="l16"></a> </span><span class=cF1>if</span><span class=cF0> (*_cur_elem_num==doc_e-&gt;left_exp) {
<a name="l17"></a> *_cur_elem_num=num;
<a name="l18"></a> found=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l19"></a> }
<a name="l20"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpg,res-&gt;last);
<a name="l21"></a> num++;
<a name="l22"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l23"></a> }
<a name="l24"></a> doc_e=doc_e-&gt;next;
<a name="l25"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l26"></a> </span><span class=cF1>if</span><span class=cF0> (!found)
<a name="l27"></a> *_cur_elem_num=num;
<a name="l28"></a> </span><span class=cF5>QueDel</span><span class=cF0>(head);
<a name="l29"></a> </span><span class=cF5>Free</span><span class=cF0>(head);
<a name="l30"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l31"></a>}
<a name="l32"></a>
<a name="l33"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>SpriteSideBarPickNew</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>CSprite</span><span class=cF0> *head,</span><span class=cF9>I64</span><span class=cF0> old_num)
<a name="l34"></a>{
<a name="l35"></a> </span><span class=cF9>CSprite</span><span class=cF0> *tmpg;
<a name="l36"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_cur_e=</span><span class=cF3>NULL</span><span class=cF0>,*doc_e;
<a name="l37"></a> </span><span class=cF9>I64</span><span class=cF0> cur_elem_num=0;
<a name="l38"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
<a name="l39"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;$PURPLE$$TX+CX,\&quot;Sprite SideBar\&quot;$\n&quot;</span><span class=cF0>
<a name="l40"></a> </span><span class=cF6>&quot;$LK+PU+CX,\&quot;Click for Help\&quot;,&quot;</span><span class=cF0>
<a name="l41"></a> </span><span class=cF6>&quot;A=\&quot;FI:::/Doc/SpriteSideBar.DD.Z\&quot;$\n\n&quot;</span><span class=cF0>);
<a name="l42"></a> tmpg=head-&gt;next;
<a name="l43"></a> </span><span class=cF1>while</span><span class=cF0> (tmpg!=head) </span><span class=cF7>{</span><span class=cF0>
<a name="l44"></a> st=</span><span class=cF5>SpriteElem2Summary</span><span class=cF0>(tmpg);
<a name="l45"></a> </span><span class=cF1>if</span><span class=cF0> (cur_elem_num==old_num)
<a name="l46"></a> doc_cur_e=doc_e=
<a name="l47"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;$LTRED$$MU-UL,\&quot;%$Q\&quot;,LE=%d$\n&quot;</span><span class=cF0>,st,cur_elem_num++);
<a name="l48"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l49"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;$LTBLUE$$MU-UL,\&quot;%$Q\&quot;,LE=%d$\n&quot;</span><span class=cF0>,st,cur_elem_num++);
<a name="l50"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&amp;doc_e-&gt;de_flags,</span><span class=cF3>DOCEf_SEL</span><span class=cF0>,</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;tmpg-&gt;type,&amp;</span><span class=cF3>SPf_SEL</span><span class=cF7>)</span><span class=cF0>);
<a name="l51"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&amp;doc_e-&gt;type,</span><span class=cF3>DOCEt_SEL</span><span class=cF0>,</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;tmpg-&gt;type,</span><span class=cF3>SPf_SEL</span><span class=cF7>)</span><span class=cF0>);
<a name="l52"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l53"></a> tmpg=tmpg-&gt;next;
<a name="l54"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l55"></a> </span><span class=cF1>if</span><span class=cF0> (cur_elem_num==old_num)
<a name="l56"></a> doc_cur_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;$LTRED$$MU-UL,\&quot;END\&quot;,LE=%d$\n&quot;</span><span class=cF0>,cur_elem_num);
<a name="l57"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l58"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;$LTBLUE$$MU-UL,\&quot;END\&quot;,LE=%d$\n&quot;</span><span class=cF0>,cur_elem_num);
<a name="l59"></a> </span><span class=cF1>if</span><span class=cF0> (doc_cur_e)
<a name="l60"></a> doc-&gt;cur_entry=doc_cur_e;
<a name="l61"></a>}
<a name="l62"></a>
<a name="l63"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>SpriteSideBarTask2</span><span class=cF0>(</span><span class=cF9>CTask</span><span class=cF0> *grand_parent)
<a name="l64"></a>{
<a name="l65"></a> </span><span class=cF9>I64</span><span class=cF0> w,h;
<a name="l66"></a> </span><span class=cF9>CTask</span><span class=cF0> *parent=</span><span class=cF5>Fs</span><span class=cF0>-&gt;parent_task,*pu_task;
<a name="l67"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l68"></a> pu_task=grand_parent-&gt;popup_task;
<a name="l69"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>pu_task</span><span class=cF7>)</span><span class=cF0>) {
<a name="l70"></a> w=parent-&gt;win_right-parent-&gt;win_left;
<a name="l71"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(pu_task-&gt;win_right+2,pu_task-&gt;win_right+2+w,parent);
<a name="l72"></a> h=parent-&gt;win_bottom-parent-&gt;win_top;
<a name="l73"></a> </span><span class=cF5>WinVert</span><span class=cF0>(pu_task-&gt;win_top,pu_task-&gt;win_top+h,parent);
<a name="l74"></a> }
<a name="l75"></a> </span><span class=cF5>Refresh</span><span class=cF0>;
<a name="l76"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l77"></a>}
<a name="l78"></a>
<a name="l79"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>SpriteSideBarTask</span><span class=cF0>(</span><span class=cF9>CTask</span><span class=cF0> *parent,</span><span class=cF9>CSprite</span><span class=cF0> **_head,</span><span class=cF9>I64</span><span class=cF0> *_cur_elem_num)
<a name="l80"></a>{
<a name="l81"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
<a name="l82"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF5>DocPut</span><span class=cF0>;
<a name="l83"></a> </span><span class=cF5>Spawn</span><span class=cF0>(&amp;</span><span class=cF5>SpriteSideBarTask2</span><span class=cF0>,parent,</span><span class=cF6>&quot;CSpriteTask&quot;</span><span class=cF0>,,</span><span class=cF5>Fs</span><span class=cF0>);
<a name="l84"></a> doc-&gt;flags|=</span><span class=cF3>DOCF_SIZE_MIN</span><span class=cF0>|</span><span class=cF3>DOCF_FORM</span><span class=cF0>;
<a name="l85"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l86"></a> </span><span class=cF5>SpriteSideBarPickNew</span><span class=cF0>(doc,*_head,*_cur_elem_num);
<a name="l87"></a> </span><span class=cF5>DocHighlightCursor</span><span class=cF0>(,doc);
<a name="l88"></a> </span><span class=cF5>View</span><span class=cF0>;
<a name="l89"></a> doc_e=doc-&gt;cur_entry;
<a name="l90"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;type_u8==</span><span class=cF3>DOCT_MENU_VAL</span><span class=cF0>)
<a name="l91"></a> *_cur_elem_num=doc_e-&gt;left_exp;
<a name="l92"></a> *_head=</span><span class=cF5>SpriteSideBar2SpriteQue</span><span class=cF0>(doc,*_head,_cur_elem_num);
<a name="l93"></a> </span><span class=cF5>DocClear</span><span class=cF0>(doc);
<a name="l94"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l95"></a>}
</span></pre></body>
</html>