comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » event_pro for compound widgets
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
event_pro for compound widgets [message #40935] Tue, 07 September 2004 10:32 Go to previous message
Benjamin Hornberger is currently offline  Benjamin Hornberger
Messages: 258
Registered: March 2004
Senior Member
Hi all,

I am quite confused now and can't figure out how to write a compound
widget which has an event_pro keyword and behaves like a regular basic
widget. Sorry for the lengthy message...

My compound widget is supposed to control a stepping motor and will
consist of a non-editable field with the current position, editable text
fields for "move to position" and "move by distance", a slider to set a
step size and two buttons to move forward and backward in steps whose
step size is set by the slider. As text fields, I am using David
Fanning's fsc_field.

This compound widget I want to include in other widgets by something like

motor1_id = cw_move_motor(parent, ..., event_pro = 'motor1_event')

When I change the step size of the slider, this should only affect the
CW itself (updating its internal "stepsize" value and a displayed
number"). I could manage to do that already.

All other events (hitting enter in the moveto or moveby field, or
clicking the forward / backward buttons) should send an event structure
to motor1_event.pro (something like { CW_MOVE_MOTOR, id: id, top: top,
handler: handler, type: 0L, moveby: 0D, moveto: 0D, stepsize: 0D } where
type holds a code for whether it was a moveto or moveby request, etc.).

Then, of course I would want to write

PRO motor1_event, event
...
IF event.type EQ 0 ...


Now, what do I do? In the CW definition function, I define
event_func='cw_move_motor_event' for my fsc_fields, buttons etc., This
cw_move_motor_event.pro will create and return the desired event
structure. But where is that returned to?

And of course I have to define a keyword event_pro in my CW definition
function which will hold a string with the event handler procedure's
name. How do I make sure that in case of an event, my event structure is
created and passed to that procedure?

Thanks for your help,

Benjamin
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: EVENT_PRO
Next Topic: Notable Coyote Program Updates

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 16:12:34 PDT 2025

Total time taken to generate the page: 0.00192 seconds