This element contains the UJML code for an application file.
<application> [<interfaces>...</interfaces>] [<state-machines>...</state-machines>] [<state-variables>...</state-variables>] [<variables>...</variables>] [<functions>...</functions>] [<templates>...</templates>] [<execute>...</execute> | <script>...</script>] [<display>...</display>] [<states>...</states>] [<state-machines>...</state-machines>] </application>
An application file contains a standalone UJML application. The application element contains the code for the UJML application. See Application Files.
|
Element |
Purpose |
Default Value |
|
Contains usage interface elements indicating which interfaces the application can create reference variables for. See Interfaces, interface. |
None (not required) | |
|
Contains state machine definitions scoped to the application with the lowest z-order. See State Machines, Z-Order. |
None (not required) | |
|
Contains state variables scoped to the application. See State Variables. |
None (not required) | |
|
Contains variables scoped to the application. See Variables. |
None (not required) | |
|
Contains functions scoped to the application. See User Defined Functions. |
None (not required) | |
|
Contains template definitions scoped to the application. See Visual Element Templates. |
None (not required) | |
|
Contains XML scripting statements executed after the application loads. See Scripting. Note: The application element may contain one execute or one script element, but not one of each. |
None (not required) | |
|
Contains scripting block statements executed after the application loads. See Scripting. Note: The application element may contain one execute or one script element, but not one of each. |
None (not required) | |
|
Contains visual elements which display when the application is active. See Visual Elements. |
None (not required) | |
|
Contains state elements specifying state transitions for state variables. See State Variables, State Transitions |
None (not required) | |
|
Contains state machine definitions scoped to the application with the highest z-order. See State Machines, Z-Order. |
None (not required) |
|
Element |
The following example shows how to display the phrase 'Hello World!' inside of a box until the user clicks the 'F1' button. It is part of the helloworld2.ujml sample.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ujml PUBLIC "-//UIEVOLUTION//DTD UJML 1.5//EN"
"http://www.uievolution.com/dtd/ujml-1.5.dtd" [
<!ENTITY SALUTATION "Hello World!">
<!ENTITY SPACING "4">
]>
<ujml>
<application>
<display>
<box>
<!-- Draw the screen black. -->
<width>
<eval>_getIntProperty(&_PROPERTY_INT_SCREEN_WIDTH;)</eval>
</width>
<height>
<eval>_getIntProperty(&_PROPERTY_INT_SCREEN_HEIGHT;)</eval>
</height>
<bg>&_COLOR_BLACK;</bg>
</box>
<!-- Say Hello on the screen using a label inside of a box. -->
<round-box>
<x>20</x>
<y>20</y>
<width>
<eval>
(&SPACING; * 2) +
_text_width("&SALUTATION;", &_FONT_SIZE_LARGE;, &_FONT_STYLE_ITALIC;,
&_FONT_FACE_SYSTEM;)
</eval>
</width>
<height>
<eval>
(&SPACING; * 2) +
_text_height(&_FONT_SIZE_LARGE;, &_FONT_STYLE_ITALIC;, &_FONT_FACE_SYSTEM;)
</eval>
</height>
<fg>&_COLOR_SILVER;</fg>
<bg>&_COLOR_RED;</bg>
<x-arc-width>8</x-arc-width>
<label>
<text>&SALUTATION;</text>
<x>&SPACING;</x>
<y>&SPACING;</y>
<fg>&_COLOR_WHITE;</fg>
<size>&_FONT_SIZE_LARGE;</size>
<style>&_FONT_STYLE_ITALIC;</style>
<face>&_FONT_FACE_SYSTEM;</face>
</label>
</round-box>
<!-- If the user presses 'Back' unload the application. -->
<fn>
<text>Back</text>
<event name="OnSelect">
<accelerators>
<key>F1</key>
</accelerators>
<script>_unload();</script>
</event>
</fn>
</display>
</application>
</ujml>|
Copyright (c) 2000-2007 UIEvolution, Inc. All rights reserved.
|
|
What do you think about this topic? Send feedback!
|