|
||||||||||||||||||||||
We often get asked how to put a button onto the SIMUL8 Window to, for example, run the simulation or change one of the simulation parameters. Custom dialog boxes are great, but you don't always want to click around so much. SIMUL8 can run a piece of code if you click on a graphic placed on the Simulation Window. So, to put a button on the screen click on the "Load Graphics from Disk" option on the graphics toolbar, then click on the simulation window and browse for the image you want to use - you don't need to use a button image, we have used the UpArrow and DownArrow images supplied with SIMUL8. Next, hold down the control key and double click on the image and this dialog box pops-up.
Create the Button Global Data Item in the Objects, Information Store option. Remember to select the Text option. Now select the Tools menu / Other Events / On Button Clcik. Whenever you click on one of the images the text you typed into the dialog box is placed into a special text Global Data Item called "Button". This lets you write some Visual Logic to run depending on the image that you clicked. Finally write some Visual Logic in the On Button Click Visual Logic section. Remember to put quotations around the words Up and Down so that SIMUL8 knows you are looking for text, and not the name of an object or some other item that exists in the simulation.
If you have any questions generated from, or comments about this newsletter then email You are receiving this e-mail because you subscribed or are a new SIMUL8
user. To unsubscribe click here. |
||||||||||||||||||||||