pracro:devas_corner
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
pracro:devas_corner [2010/08/02 14:32] – deva | pracro:devas_corner [2010/08/10 11:14] – deva | ||
---|---|---|---|
Line 5: | Line 5: | ||
<?xml version=' | <?xml version=' | ||
<macro name=" | <macro name=" | ||
- | < | ||
- | function foo() | ||
- | -- this: current widget (widget that triggered the event) | ||
- | this.setChecked(true) | + | < |
+ | <script src=" | ||
+ | < | ||
+ | -- inline code | ||
+ | if(regexp(' | ||
+ | then | ||
+ | return 'a string' | ||
+ | else | ||
+ | return ' | ||
+ | end | ||
+ | </ | ||
+ | </ | ||
- | | + | < |
+ | < | ||
+ | function | ||
+ | -- this: current widget (widget that triggered the event) | ||
- | | + | this: |
- | then | + | |
- | | + | foo = widget(' |
+ | |||
+ | | ||
+ | then | ||
+ | foo:setValue(' | ||
+ | end | ||
end | end | ||
- | | + | |
- | </script> | + | </scripts> |
<widgets caption=" | <widgets caption=" | ||
layout=" | layout=" | ||
Line 29: | Line 45: | ||
The script tag can either consist of inline code, or be a reference to a serverside file, that will be inserted in-place by the server before it is sent to the client. | The script tag can either consist of inline code, or be a reference to a serverside file, that will be inserted in-place by the server before it is sent to the client. | ||
<code xml> | <code xml> | ||
- | < | + | < |
- | --example | + | |
- | </ | + | < |
- | <script file=" | + | |
+ | </ | ||
+ | </scripts> | ||
</ | </ | ||
+ | |||
====The Widget Events==== | ====The Widget Events==== | ||
Line 39: | Line 58: | ||
Currently the script is referred by its name, and called whenever the widget changes its value.\\ | Currently the script is referred by its name, and called whenever the widget changes its value.\\ | ||
In the new system, the script attribute is removed and replaced by event attributes. The event attributes will themselves contain lua code and not simply a name. In order to call ' | In the new system, the script attribute is removed and replaced by event attributes. The event attributes will themselves contain lua code and not simply a name. In order to call ' | ||
- | The return values will no longer be used. Instead widget methods will be added to control the validation state of each widget, eg. setValid(true|false), setInvalid(), | + | The return values will no longer be used. Instead widget methods will be added to control the validation state of each widget, eg. '' |
Since it is no longer required (due to redundancy) the '' | Since it is no longer required (due to redundancy) the '' | ||
+ | |||
====Event Handlers==== | ====Event Handlers==== | ||
* '' | * '' | ||
- | * '' | + | * more to come |
- | * and many more | + | |
====The Widget Object==== | ====The Widget Object==== | ||
Line 65: | Line 85: | ||
</ | </ | ||
A small number of methods are common to all widget types. These include are: | A small number of methods are common to all widget types. These include are: | ||
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
Others are specific to certain widget types, such as (and many more): | Others are specific to certain widget types, such as (and many more): | ||
- | * '' | + | * '' |
- | * '' | + | |
- | * '' | + | |
=====New protocol===== | =====New protocol===== |
pracro/devas_corner.txt · Last modified: 2011/01/14 14:49 by deva