Example 5
Example 5

Example 5

This example demonstrates a WML menu structure with three cards. The "darkness" card leverages WML and the SGD "print.tone" command to allow the user to both view and configure a setting.
1→
2→
3→
4→
5→
6→
7→
8→
9→
10→
11→
12→
13→
14→
15→
16→
17→
18→
19→
20→
21→
22→
23→
24→
25→
26→
27→
28→
29→
30→
31→
32→
33→
34→
35→
36→
37→
<wml>
<display>
<card id="main" title="" ontimer="#main" alerts="on">
<timer value="50"></timer>
<p>Baud: $(comm.baud)</p>
<br/>
<p>AP: $(wlan.essid)</p>
<p> </p><br/>
<p> </p><br/>
<p> <a href="#system">Firmware</a></p>
</card>
<card id="system" title="" ontimer="#main" alerts="on">
<timer value="50"></timer>
<p>Firmware:</p><br/>
<p>$(appl.name)</p><br/>
<p>ZBI State:</p><br/>
<p>$(zbi.key)</p><br/>
<p><a href="#main">Main</a> <a href="#darkness">Darkness</a></p>
</card>
<card id="darkness" title="" ontimer="#main" alerts="on">
<timer value="50"></timer>
<p>Current: $(print.tone)</p><br/>
<p>Change: </p><do type="accept" label="Up"><setvar name="print.tone"
value="+1.0"/></do><br/>
<p>Change: </p><do type="accept" label="Down"><setvar name="print.tone"
value="-1.0"/></do><br/>
<p> </p><br/>
<p><a href="#main">Main</a> <a href="#config">Config</a></p>
</card>
<card id="config" title="" ontimer="#main" alerts="on">
<timer value="50"></timer>
<p>Printing </p><br/>
<p> Config Label...</p><br/>
<p></p><br/>
<p>Please wait...</p><br/>
<setvar name="file.run" value="e:config.nrd"/>
</card>
</display>
</wml>
23
<p>Change: </p>
  • Defines the fixed text
    "Change: "
<do type="accept" label="Up"><setvar name="print.tone" value="+1.0"/></do><br/>
  • Defines selecting the word "Up" as equal to sending the value "+1.0" for the SGD command "print.tone". In this case, this increases the setting by 1.0.
24
<p>Change: </p>
  • Defines the fixed text
    "Change: "
do type="accept" label="Down"><setvar name="print.tone" value="-1.0"/></do><br/>
  • Defines selecting the word "Down" as equal to sending the value "-1.0" for the SGD command "print.tone". In this case, this decreases the setting by 1.0.
In use, these WML menus look similar to this:
GX series printers can display four lines of text. If you are using a GX series printer, remove one line of text from each “card” to use this example.