Getting Started with Canvas
Once you are ready to create some screens, you can try a variety of options to experiment with Canvas, including but not limited to the following:
To Make a Simple Screen
- Create a new Canvas Screen.
- Open a Toolbox pane to select some controls.
- Drag a text tool onto your screen.
- Drag a button onto your screen.
- Open a Properties pane to reset some control properties.
- Rename the text tool and assign its text.
- Click the text tool to view its properties.
- Find the control Name, below the Properties header, and rename it, for example, TextTime.
- Find the Text property of the text tool and type the desired text into the text field to give it a new value, for example, NoTimeYet.
- Rename the button tool and assign its text.
- Click the button to view its properties.
- Find the control Name, below the Properties header, and rename it, for example, ButtonTime.
- Find the Button text property of the button and type the desired text into the text field to give it a new value, for example, GetTime.
- Open an Events pane to assign an event.
- Click the button to view its events.
- Find the Click event and click the check box to enable the event. The Script view opens, with the cursor in the click event section of script.
- In the script view, set what you want the text field to show (the current time) when the button click event is called. To do so, type the following line of code:
|
Objects.TextTime.Text = DateTime.Now.ToString();
|
- Validate your script.
- Save the screen you just made.
- Run the screen and see how your button works.
To Retrieve CygNet Data
- Create a new Canvas screen
- Open a Toolbox pane.
- Drag a text tool onto your Screen.
- Open a Properties pane.
- Click the text tool to view its properties in the Properties pane.
- Modify the Color configuration properties to set the background, text, and border colors for the tool.
- Modify the Point configuration properties to point to a current value in your CygNet system.
- Select Facility tag.
- Set Facility to <Self> and choose a SiteService and facility.
- Set a Long point ID.
- Modify the Text property and change Text Tool to Current Values > %Value%.
- Save the screen.
- Run the screen and see how the value has updated.
Once you've started getting comfortable with the Canvas basics, you might want to try some more advanced options. In Canvas you can choose to use outside assemblies, such as CygNet COM or .NET API library files, using the Canvas Assembly Manager to link to a selected DLL folder location.
To Link to an External or Custom API
- Use the Canvas Assembly Manager to locate and link to your target .dll file.
- Once an assembly is linked, it is available for use in scripting your screens.
If you'd like to get even more adventurous, you can try building your own Canvas controls using our Canvas Custom Control framework.
To Build Your Own Custom Controls
- If you have access to Microsoft Visual Studio, several helpful building tools are available to help you effectively create custom controls.
- If you do not have access to Microsoft Visual Studio, please contact us for help. Contact information is shown on the Feedback page.
To Start Canvas Via the Command Line
See Starting Canvas from a Command Line for more information.