Adding and saving screens objects at run time.

Question:

Can I add screen objects at run time and then save them?

Solution:

By using AddObject method, you can add screen objects at run time. For example:

‘Script that adds a rectangle on the  screen:
set obj = Screen.AddObject(“DrawRect”, False)
obj.X = 11243
obj.Y = 6266
obj.Height = 1500
obj.Width = 5000 
obj.Color = “0”
obj.Activate()

However, it is not possible to save these objects, and they will not be displayed on E3Studio. Also, it is not possible to add scripts to the created objects.

However, by using XControls and .TXT files reading and writing resources (check related articles),  the Configurable Objects library was developed, so you can save all the process of adding objects in a text file, as a script. After that, you must execute this script in the Studio, using CustomConfig resource so the objects added at run time can be saved.

In addition, the objects from this library are set to execute scripts saved in individual text files. So, you can edit objects’ scripts at run time.

Instructions to use this library:

1. Download the attached file and add it to your project.
2. In Studio, insert an XcAddObject on screen.
3. Run the Viewer, and use the tool to add some objects.
4. Right-click the added objects to add a script (always on Click event).
5. Back to E3Studio, right-click XcAddObject object and select Refresh option.

Attachments:

ConfigurableObjects

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *