Jump to content
Developer Wiki and Function Reference Links ×

virtual dialog events


Ben624

Recommended Posts

I have written a control panel to move scenery around. By creating individual events for each button or field (rather than just the OK and CANCEL buttons) I have made it so that I can see my changes without hitting ok, but still hit cancel if I want. The problem now is that I have created a button that reads the values from all the sliders/fields/checkboxes and writes them to a text file to be recalled later. Unfortunately, because all of the actions are written into individual events, which are only triggered when a user clicks or edits its corresponding button or field, all my recall button does is put the values back into the fields without actually moving any of the scenery. As it is now, I would need to go through and click on each field to trigger its event in order to apply all the changes. I would like to write a function that cycles through each field and triggers its event to apply all the new values that were just recalled.

Am I making sense?

eg: so instead of my script looking like this:

DialogEvent(item);

CASE item OF

kOK : BEGIN

{-- GATHER ALL VALUES AND APPLY CHANGES --}

END;

It looks like this:

CASE item OF

kPiece1 : BEGIN

{-- gather relevant info on piece 1 and apply changes to it, without closing the dialog --}

END;

kPiece2 : BEGIN

{-- gather relevant info on piece 2 and apply changes to it, without closing the dialog --}

END;

etc. etc.

The only way I can see right now is to copy all of my code under the OK event as well as under the individual events. argh.

Link to comment

Ben,

???I believe you can structure your event loop the way you want, but to see any changes on screen you will have to issue a Redraw or RedrawAll command after you gather data and apply the changes. I do something similar in my Reshaper code.

CASE item OF

???kPiece1 : BEGIN

??????{-- gather relevant info on piece 1 and apply changes to it, without closing the dialog --}

??????Redraw;

???END;

???kPiece2 : BEGIN

??????{-- gather relevant info on piece 2 and apply changes to it, without closing the dialog --}

??????Redraw;

???END;

HTH,

Raymond

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...