pracro:devas_corner
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
pracro:devas_corner [2010/08/10 11:13] – deva | pracro:devas_corner [2010/08/10 11:15] – deva | ||
---|---|---|---|
Line 52: | Line 52: | ||
</ | </ | ||
</ | </ | ||
+ | |||
====The Widget Events==== | ====The Widget Events==== | ||
Line 57: | 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==== | ||
When in a lua function, invoked by an event handler, the calling object (the object invoking the event) will be made available through the value ' | When in a lua function, invoked by an event handler, the calling object (the object invoking the event) will be made available through the value ' | ||
- | Other object can be retrieved using the '' | + | Other object can be retrieved using the '' |
<code lua> | <code lua> | ||
function foo() | function foo() | ||
- | if (this.value == ' | + | if (this:value() == ' |
then | then | ||
- | this.setValue(' | + | this:setValue(' |
end | end | ||
- | bas = getWidget(' | + | bas = widget(' |
- | if (bas && bas.value == ' | + | if (bas && bas:value() == ' |
then | then | ||
- | bas.setValue(' | + | bas:setValue(' |
end | end | ||
end | end |
pracro/devas_corner.txt · Last modified: 2011/01/14 14:49 by deva