Ben624 Posted February 21, 2008 Share Posted February 21, 2008 Hi all, Is there any way to force a dialog event without actually having the user click on a field or a button? Ben Quote Link to comment
Pat Stanford Posted February 21, 2008 Share Posted February 21, 2008 What are you actually trying to accomplish? As far as I know, once a dialog box is opened, the only way to close it is to click on the close or cancel button. Perhaps there is another way to do what you want? Pat Quote Link to comment
Ben624 Posted February 21, 2008 Author Share Posted February 21, 2008 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. Quote Link to comment
Pat Stanford Posted February 22, 2008 Share Posted February 22, 2008 Could you have a button that would allow you do the data import as a final step? I.E. import the data and end the dialog? So the user would have to re-run the command if they wanted to make other changes? I don't know of any way to accomplish what you are trying to do. Pat Quote Link to comment
MullinRJ Posted February 22, 2008 Share Posted February 22, 2008 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 Quote Link to comment
Recommended Posts
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.