arthur&l?on Posted February 15, 2011 Share Posted February 15, 2011 Hello. I haven't scripted for some years and never used a lot modern dialogs. I try to know how Pushbuttons work.. in fact, what happens when the user clicks on such a thing ? What happens and how to retrieve data passed, what kind of data and how to use it ? If someone can help, many thanks in advance Francesco Quote Link to comment
James Russell Posted February 15, 2011 Share Posted February 15, 2011 (edited) Francesco, After just getting my head around dialogs I can say it was an interesting experience. http://techboard.nemetschek.net/ubbthreads.php?ubb=showflat&Main=30918&Number=151961#Post151961 This is a topic which we only finished days ago. There are also plenty of resources to view under resources and examples at the Vectorworks homepage, have a look at these for various structures. As for what actually happens my comprehension is easiest understood in three parts. First is the layout section which deals with the physical layout of the dialog. The second is the handler which retains the data when the ok/cancel/anything button is pressed and then is used to save appropriate data to Variables, Strings and Booleans. The third is the run component which is what you will do with the newly saved components, make a table, make a rectangle, etc. If none of that makes sense feel free to chip in anyone. J Edited February 15, 2011 by James Russell Quote Link to comment
maarten. Posted February 15, 2011 Share Posted February 15, 2011 Francesco] ... The second is the handler which retains the data when the ok/cancel/anything button is pressed and then is used to save appropriate data to Variables, Strings and Booleans. ... True, but you can also adjust the dialog in this part. So it's not only to save the output but also to change the data in the dialog or the layout of the dialog. Quote Link to comment
MullinRJ Posted February 15, 2011 Share Posted February 15, 2011 Francesco, ???Every item in a modern dialog has an ID number. When a user clicks on, or types into one of the items, the Modern Dialog "machinery" senses which item was invoked and passes the item's ID number to a routine that you have to write. That procedure will usually have a case statement inside with one case item for every active dialog item ID. You tell the Modern Dialog "machinery" what that procedure is with the RunLayoutDialog() command. ???If your button has an ID of "10", then you will have to write code inside the case statement, for item = 10, to tell your program what to do when it gets pressed. Here's a sample routine for doing something for ITEM 10, which you defined with your CreatePushButton call. PROCEDURE Dialog_Handler(var item :LONGINT; data :LONGINT); Begin ???case item of ??????10: begin ?????????{ Do your thing here } ??????end;??????{ 10 } ???end;??????{ case } End;??????{ Dialog_Handler } There are many short examples in the VectorScript Function Reference. Check out "CreatePullDownMenu" and "CreateColorPopup" for some short examples that work. Also check online at http://developer.vectorworks.net/index.php?title=Main_Page Write back when you have more questions. HTH, Raymond Quote Link to comment
arthur&l?on Posted February 15, 2011 Author Share Posted February 15, 2011 Thank you very much to all of you. I just have to insert a CASE OF, so. Great great community, here Best regards Francesco 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.