Older Newer
Sat, 05 Mar 2005 10:19:57 . . . . SyneRyder


Changes by last author:

Added:
= triggerEvent =

== Syntax ==

:int triggerEvent(int n, int event, int previous)

== Arguments ==

:n

::the control number of the event (eg CTL_OK or a programmer defined value)

:event

::the type of event to raise (eg FME_CLICKED, FME_CUSTOMEVENT)

:previous

::a value to pass to the event handler (usually the previous value of the control)

== Return ==

:A value of 0 or 1, depending on whether the event handler code returned true or false.

== Description ==

:triggerEvent is used to artificially launch events, such as a dialog button click, the mouse moving over a dialog control, or to trigger timer events without resetting the actual timer. You can also use triggerEvent to write your own user-defined functions. By using FME_CUSTOMEVENT and creating custom values for the 'n' parameter, you can call specific sections of your OnCtl handler. You can even use the previous variable as a simple function parameter - though if you need more parameters, you are better off using the built-in global variables to pass and return values.

== Example ==

<code>

OnCtl( n ):

{

if ( e == FME_CUSTOMEVENT )

{

switch ( n )

{

case 0:

// Execute this code

if ( previous == 1 ) ...

else if ( previous == 2 ) ...

return true;

case 1:

// Execute that code

...

return false;

}

}

return false;

}

</code>

== Also see ==

:(FME_CUSTOMEVENT)?

== Comments ==

:Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.