http://fpcamigawiki.alb42.de/index.php?title=MUI_Helper&feed=atom&action=history
MUI Helper - Revision history
2024-03-29T07:54:01Z
Revision history for this page on the wiki
MediaWiki 1.35.1
http://fpcamigawiki.alb42.de/index.php?title=MUI_Helper&diff=747&oldid=prev
Alb42: top align, align lines to each other
2016-12-18T15:56:19Z
<p>top align, align lines to each other</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 15:56, 18 December 2016</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l6" >Line 6:</td>
<td colspan="2" class="diff-lineno">Line 6:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>! C-Source with Macros (balance example from MUI developer archive)</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>! C-Source with Macros (balance example from MUI developer archive)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>! Pascal-Source with muihelper unit</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>! Pascal-Source with muihelper unit</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>|- <ins class="diffchange diffchange-inline">style="vertical-align: top;"</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|<source lang="C"></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|<source lang="C"></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>#include "demo.h"</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>#include "demo.h"</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l99" >Line 99:</td>
<td colspan="2" class="diff-lineno">Line 99:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> End,</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> End,</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> End;</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> End;</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if (!app)</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if (!app)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> fail(app,"Failed to create Application.");</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> fail(app,"Failed to create Application.");</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> DoMethod(window,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> DoMethod(window,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l121" >Line 121:</td>
<td colspan="2" class="diff-lineno">Line 125:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> sigs = Wait(sigs | SIGBREAKF_CTRL_C);</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> sigs = Wait(sigs | SIGBREAKF_CTRL_C);</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if (sigs & SIGBREAKF_CTRL_C) break;</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if (sigs & SIGBREAKF_CTRL_C) break;</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> }</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> }</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> }</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> }</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l183" >Line 183:</td>
<td colspan="2" class="diff-lineno">Line 188:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Child, AsTag(MH_Rectangle(TextFrame, [TAG_END])),</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Child, AsTag(MH_Rectangle(TextFrame, [TAG_END])),</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> TAG_END])),</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> TAG_END])),</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Child, AsTag(MH_HGroup(GroupFrame, [</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Child, AsTag(MH_HGroup(GroupFrame, [</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Child, AsTag(MH_HGroup([</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Child, AsTag(MH_HGroup([</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l224" >Line 224:</td>
<td colspan="2" class="diff-lineno">Line 228:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> TAG_END])),</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> TAG_END])),</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> TAG_END])),</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> TAG_END])),</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> TAG_END]);</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> TAG_END]);</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l241" >Line 241:</td>
<td colspan="2" class="diff-lineno">Line 244:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> // Note that MUIM_Application_NewInput expects sigs to contain the result</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> // Note that MUIM_Application_NewInput expects sigs to contain the result</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> // from Wait() (or 0). This makes the input loop significantly faster.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> // from Wait() (or 0). This makes the input loop significantly faster.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> MH_Set(Window, MUIA_Window_Open, AsTag(True));</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> MH_Set(Window, MUIA_Window_Open, AsTag(True));</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> //</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> //</div></td></tr>
<!-- diff cache key db624220369-ntdbjym2gu:diff::1.12:old-746:rev-747 -->
</table>
Alb42
http://fpcamigawiki.alb42.de/index.php?title=MUI_Helper&diff=746&oldid=prev
Alb42: Comparison C-macro code with Pascal MuiHelper code
2016-12-18T15:45:15Z
<p>Comparison C-macro code with Pascal MuiHelper code</p>
<p><b>New page</b></p><div>This Page describe how to write MUI/Zune application in FreePascal comparable to C-Sources with the MUI macros. The needed functions for it are collected inside muihelper unit in the ami-extra package. Therefore this unit should be available for all Amiga-style systems.<br />
<hr><br />
Comparison C with Macros and Pascal with muihelper unit:<br />
{| class="wikitable"<br />
|-<br />
! C-Source with Macros (balance example from MUI developer archive)<br />
! Pascal-Source with muihelper unit<br />
|-<br />
|<source lang="C"><br />
#include "demo.h"<br />
<br />
int main(int argc,char *argv[])<br />
{<br />
APTR app,window;<br />
<br />
init();<br />
<br />
app = ApplicationObject,<br />
MUIA_Application_Title , "BalanceDemo",<br />
MUIA_Application_Version , "$VER: BalanceDemo 19.5 (12.02.97)",<br />
MUIA_Application_Copyright , "©1995, Stefan Stuntz",<br />
MUIA_Application_Author , "Stefan Stuntz",<br />
MUIA_Application_Description, "Show balancing groups",<br />
MUIA_Application_Base , "BALANCEDEMO",<br />
<br />
SubWindow, window = WindowObject,<br />
MUIA_Window_Title, "Balancing Groups",<br />
MUIA_Window_ID , MAKE_ID('B','A','L','A'),<br />
MUIA_Window_Width , MUIV_Window_Width_Screen(50),<br />
MUIA_Window_Height, MUIV_Window_Height_Screen(50),<br />
<br />
WindowContents, HGroup,<br />
<br />
Child, VGroup, GroupFrame, MUIA_Weight, 15,<br />
Child, RectangleObject, TextFrame, MUIA_Weight, 50, End,<br />
Child, RectangleObject, TextFrame, MUIA_Weight, 100, End,<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
Child, RectangleObject, TextFrame, MUIA_Weight, 200, End,<br />
End,<br />
<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
<br />
Child, VGroup,<br />
Child, HGroup, GroupFrame,<br />
Child, RectangleObject, TextFrame, MUIA_ObjectID, 123, End,<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
Child, RectangleObject, TextFrame, MUIA_ObjectID, 456, End,<br />
End,<br />
Child, HGroup, GroupFrame,<br />
Child, RectangleObject, TextFrame, End,<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
Child, RectangleObject, TextFrame, End,<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
Child, RectangleObject, TextFrame, End,<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
Child, RectangleObject, TextFrame, End,<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
Child, RectangleObject, TextFrame, End,<br />
End,<br />
Child, HGroup, GroupFrame,<br />
Child, HGroup,<br />
Child, RectangleObject, TextFrame, End,<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
Child, RectangleObject, TextFrame, End,<br />
End,<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
Child, HGroup,<br />
Child, RectangleObject, TextFrame, End,<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
Child, RectangleObject, TextFrame, End,<br />
End,<br />
End,<br />
Child, HGroup, GroupFrame,<br />
Child, RectangleObject, TextFrame, MUIA_Weight, 50, End,<br />
Child, RectangleObject, TextFrame, MUIA_Weight, 100, End,<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
Child, RectangleObject, TextFrame, MUIA_Weight, 200, End,<br />
End,<br />
Child, HGroup, GroupFrame,<br />
Child, SimpleButton("Also"),<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
Child, SimpleButton("Try"),<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
Child, SimpleButton("Sizing"),<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
Child, SimpleButton("With"),<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
Child, SimpleButton("Shift"),<br />
End,<br />
Child, HGroup, GroupFrame,<br />
Child, Label("Label 1:"),<br />
Child, TextObject, MUIA_Text_Contents, "data...", End,<br />
Child, BalanceObject, MUIA_CycleChain, 1, End,<br />
Child, Label("Label 2:"),<br />
Child, TextObject, MUIA_Text_Contents, "more data...", End,<br />
End,<br />
End,<br />
End,<br />
End,<br />
End;<br />
if (!app)<br />
fail(app,"Failed to create Application.");<br />
<br />
DoMethod(window,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,<br />
app,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit);<br />
/*<br />
** This is the ideal input loop for an object oriented MUI application.<br />
** Everything is encapsulated in classes, no return ids need to be used,<br />
** we just check if the program shall terminate.<br />
** Note that MUIM_Application_NewInput expects sigs to contain the result<br />
** from Wait() (or 0). This makes the input loop significantly faster.<br />
*/<br />
set(window,MUIA_Window_Open,TRUE);<br />
{<br />
ULONG sigs = 0;<br />
<br />
while (DoMethod(app,MUIM_Application_NewInput,&sigs) != MUIV_Application_ReturnID_Quit)<br />
{<br />
if (sigs)<br />
{<br />
sigs = Wait(sigs | SIGBREAKF_CTRL_C);<br />
if (sigs & SIGBREAKF_CTRL_C) break;<br />
}<br />
}<br />
}<br />
<br />
set(window,MUIA_Window_Open,FALSE);<br />
/*<br />
** Shut down...<br />
*/<br />
fail(app,NULL);<br />
}<br />
</source><br />
|<source lang="pascal"><br />
program balancing;<br />
uses<br />
Exec, Utility, intuition, AmigaDos, mui, muihelper;<br />
procedure StartMe;<br />
var<br />
App, Window: PObject_;<br />
Sigs: LongInt;<br />
begin<br />
app := MH_Application([<br />
MUIA_Application_Title, AsTag('BalanceDemo'),<br />
MUIA_Application_Version, AsTag('$VER: BalanceDemo 19.5 (12.02.97)'),<br />
MUIA_Application_Copyright, AsTag('©1995, Stefan Stuntz'),<br />
MUIA_Application_Author, AsTag('Stefan Stuntz'),<br />
MUIA_Application_Description, AsTag('Show balancing groups'),<br />
MUIA_Application_Base, AsTag('BALANCEDEMO'),<br />
<br />
SubWindow, AsTag(MH_Window(Window, [<br />
MUIA_Window_Title, AsTag('Balancing Groups'),<br />
MUIA_Window_ID, MAKE_ID('B','A','L','A'),<br />
MUIA_Window_Width , MUIV_Window_Width_Screen(50),<br />
MUIA_Window_Height, MUIV_Window_Height_Screen(50),<br />
<br />
WindowContents, AsTag(MH_HGroup([<br />
<br />
Child, AsTag(MH_VGroup(GroupFrame, [MUIA_Weight, 15,<br />
Child, AsTag(MH_Rectangle(TextFrame, [MUIA_Weight, 50, TAG_END])),<br />
Child, AsTag(MH_Rectangle(TextFrame, [MUIA_Weight, 100, TAG_END])),<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
Child, AsTag(MH_Rectangle(TextFrame, [MUIA_Weight, 200, TAG_END])),<br />
TAG_END])),<br />
<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
<br />
Child, AsTag(MH_VGroup([<br />
Child, AsTag(MH_HGroup(GroupFrame, [<br />
Child, AsTag(MH_Rectangle(TextFrame, [MUIA_ObjectID, 123, TAG_END])),<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
Child, AsTag(MH_Rectangle(TextFrame, [MUIA_ObjectID, 456, TAG_END])),<br />
TAG_END])),<br />
Child, AsTag(MH_HGroup(GroupFrame, [<br />
Child, AsTag(MH_Rectangle(TextFrame, [TAG_END])),<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
Child, AsTag(MH_Rectangle(TextFrame, [TAG_END])),<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
Child, AsTag(MH_Rectangle(TextFrame, [TAG_END])),<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
Child, AsTag(MH_Rectangle(TextFrame, [TAG_END])),<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
Child, AsTag(MH_Rectangle(TextFrame, [TAG_END])),<br />
TAG_END])),<br />
<br />
Child, AsTag(MH_HGroup(GroupFrame, [<br />
Child, AsTag(MH_HGroup([<br />
Child, AsTag(MH_Rectangle(TextFrame, [TAG_END])),<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
Child, AsTag(MH_Rectangle(TextFrame, [TAG_END])),<br />
TAG_END])),<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
Child, AsTag(MH_HGroup([<br />
Child, AsTag(MH_Rectangle(TextFrame, [TAG_END])),<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
Child, AsTag(MH_Rectangle(TextFrame, [TAG_END])),<br />
TAG_END])),<br />
TAG_END])),<br />
Child, AsTag(MH_HGroup(GroupFrame, [<br />
Child, AsTag(MH_Rectangle(TextFrame, [MUIA_Weight, 50, TAG_END])),<br />
Child, AsTag(MH_Rectangle(TextFrame, [MUIA_Weight, 100, TAG_END])),<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
Child, AsTag(MH_Rectangle(TextFrame, [MUIA_Weight, 200, TAG_END])),<br />
TAG_END])),<br />
Child, AsTag(MH_HGroup(GroupFrame, [<br />
Child, AsTag(MH_SimpleButton('Also')),<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
Child, AsTag(MH_SimpleButton('Try')),<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
Child, AsTag(MH_SimpleButton('Sizing')),<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
Child, AsTag(MH_SimpleButton('With')),<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
Child, AsTag(MH_SimpleButton('Shift')),<br />
TAG_END])),<br />
Child, AsTag(MH_HGroup(GroupFrame, [<br />
Child, AsTag(MH_Label('Label 1:')),<br />
Child, AsTag(MH_Text('data...', [TAG_END])),<br />
Child, AsTag(MH_Balance([MUIA_CycleChain, 1, TAG_END])),<br />
Child, AsTag(MH_Label('Label 2:')),<br />
Child, AsTag(MH_Text('more data...', [TAG_END])),<br />
TAG_END])),<br />
TAG_END])),<br />
TAG_END])),<br />
TAG_END])),<br />
<br />
TAG_END]);<br />
<br />
if not Assigned(app) then<br />
begin<br />
writeln('Failed to create Application');<br />
Exit;<br />
end;<br />
<br />
DoMethod(window, [MUIM_Notify, MUIA_Window_CloseRequest, MUI_TRUE,<br />
AsTag(app), 2, AsTag(MUIM_Application_ReturnID), AsTag(MUIV_Application_ReturnID_Quit)]);<br />
<br />
// This is the ideal input loop for an object oriented MUI application.<br />
// Everything is encapsulated in classes, no return ids need to be used,<br />
// we just check if the program shall terminate.<br />
// Note that MUIM_Application_NewInput expects sigs to contain the result<br />
// from Wait() (or 0). This makes the input loop significantly faster.<br />
MH_Set(Window, MUIA_Window_Open, AsTag(True));<br />
//<br />
if MH_Get(Window, MUIA_Window_Open) <> 0 then<br />
begin<br />
while Integer(DoMethod(app, [MUIM_Application_NewInput, AsTag(@sigs)])) <> MUIV_Application_ReturnID_Quit do<br />
begin<br />
if Sigs <> 0 then<br />
begin<br />
Sigs := Wait(sigs or SIGBREAKF_CTRL_C);<br />
if (Sigs and SIGBREAKF_CTRL_C) <>0 then<br />
Break;<br />
end;<br />
end;<br />
end;<br />
//Shut down...<br />
MH_Set(Window, MUIA_Window_Open, AsTag(True));<br />
<br />
MUI_DisposeObject(app);<br />
end;<br />
<br />
begin<br />
StartMe;<br />
end.<br />
</source><br />
|}</div>
Alb42