User Tools

Site Tools


pracro:devas_corner

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
pracro:devas_corner [2010/08/10 11:14] devapracro:devas_corner [2010/08/10 11:15] deva
Line 60: Line 60:
 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)''.\\ 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)''.\\
 Since it is no longer required (due to redundancy) the ''regexp'' attribute will be removed. Since it is no longer required (due to redundancy) the ''regexp'' attribute will be removed.
 +
  
 ====Event Handlers==== ====Event Handlers====
   * ''onChange'': triggered whenever the value of the widget is changed, either programmatically or by the user.   * ''onChange'': triggered whenever the value of the widget is changed, either programmatically or by the user.
-  * ''onUserChange'': triggered whenever the value of the widget is changed by the user. +  * 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 'this'. 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 'this'.
-Other object can be retrieved using the ''getWidget('name')'' function.+Other object can be retrieved using the ''widget('name')'' function.
 <code lua> <code lua>
 function foo() function foo()
-   if (this.value == 'bar')+   if (this:value() == 'bar')
    then    then
-      this.setValue('dut')+      this:setValue('dut')
    end    end
  
-   bas = getWidget('mywdg'+   bas = widget('mywdg'
-   if (bas && bas.value == 'bar' )+   if (bas && bas:value() == 'bar' )
    then    then
-      bas.setValue('dims')+      bas:setValue('dims')
    end    end
 end end
pracro/devas_corner.txt · Last modified: 2011/01/14 14:49 by deva