Author : Rob Davison (rdavison@xtra.co.nz)
Date : 06/12/98
What you do:
- Create a tag for the object.
Update the tag data when the object moves in memory. When the object is deleted (whatever reason) broadcast Message_Deselect and delete the tag.
- Build a dialogue and display it.
- When the user selects an item in the dialogue call PCA_ActionDialogue and remember any task handle returned.
- On receipt of Message_UpdateArea quoting the objects tag redraw an appropriate bit of your window (pref. using Wimp_UpdateArea).
Whenever your task modifies the object broadcast Message_UpdateArea too.
- On receipt of Message_DoneMyStuff quoting the objects tag redraw the entire object.
- On receipt of Message_Changed quoting the objects tag re-read the objects details and redraw the greater of the objects previous and new sizes (used when physical size and colour depth have changed).
- On receipt of Message_HookMe quoting the objects tag setup for inplace editing and send Message_ObjectPosition
If you don't want do do inplace editing set the appropriate bits of the clear and eor words in the build dialogue swi data block.
If doing inplace editing, you must send Message_ObjectPosition whenever the doument window moves, changes view scale or whenever the object moves within the document.
Also, whenever a mouse click event over the object occurs, you should translate the coordinates and send this click event on to the inplace tool. See the version one documentation for more detail. Not updated this yet
- On receipt of Message_UnhookMe quoting the objects tag forget about that tool. If the tool was inplace delete any trap icons and clear flags associated with it.
- On receipt of Message_ResizeRequest allocate memory as appropriate and send Message_ResizeAck (If you don't do this those applets that rely on changing the objects size won't work).
- If doing dynamic PCA on reciept of Message_AppletsChanged set a flag and rebuild the dialogue box on the next null-poll.
Thats it basically. :-)