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:

Configure Canvas for the First Time

  1. Before you start creating Canvas screens we highly recommend that you install the latest Microsoft .NET Developer Pack and configure the system locations for .NET Framework and CygNet .NET API assemblies. See the Canvas System Requirements for more information.
    1. Install the Microsoft .NET Developer Pack.
    2.  In Canvas, create a new screen, select the Script view tab, click Enable scripting for this screen.
    3. On the Script view toolbar, click Manage external assemblies loaded for script to access the Assembly Manager. See the Assembly Manager for more information on managing assemblies.
      1. Select System Assemblies in the left pane, and click Use default system path for .NET SDK. Browse to search for assembly files. Click the check box next to the assemblies you want to use.
      2. Select CygNet in the left pane, and click Select the folder for your CygNet assemblies. Browse to local \CygNet\Bin directory for the CygNet and third-party .NET assemblies. Click the check box next to the assemblies you want to use.

Assembly Manager - System Assemblies

Assembly Manager - System Assemblies

 

Assembly Manager - CygNet Assemblies

Assembly Manager - CygNet Assemblies

  1. Create or choose a Global Settings File. The Canvas Global Settings File is an XML-based file (<name>.gsf) containing a compilation of underlying configuration settings globally available to Canvas and Canvas.View. Global settings apply to all screens and objects and are automatically associated with a screen when it is created. Global settings include, for example, relative facility definitions, object library location, style sheets (describing colors, fonts, etc. for controls), facility navigation settings, color palettes, default date format, and blink interval. See Global Settings for information on how to create a new global settings file.

Make a Simple Screen

  1. Create a new Canvas Screen.
  2. Open a Toolbox pane to select some controls.
  1. Drag a Text Tool onto your screen.
  2. Drag a button onto your screen.
  1. Open a Properties pane to set some control properties.
  1. Rename the Text Tool and assign its text.
  1. Click the Text Tool to view its properties.
  2. Find the control Name, below the Properties header, and rename it, for example, TextTime.
  3. 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.
  1. Rename the button tool and assign its text.
  1. Click the button to view its properties.
  2. Find the control Name, below the Properties header, and rename it, for example, ButtonTime.
  3. Find the Text property of the button and type the desired text into the text field to give it a new value, for example, GetTime.
  1. Open an Events pane to assign an event.
  1. Click the button to view its events.
  2. 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.
  3. 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();

  1. Validate your script.
  2. Save the screen you just made.
  3. Run the screen and see how your button works.

Retrieve CygNet Data

  1. Create a new Canvas screen
  2. Open a Toolbox pane.
  1. Open a Properties pane.
  1. Save the screen.
  2. 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 add new assembly references.

Link to an External or Custom API

  1. Use the Assembly Manager to locate and link to your target .dll file, as describe above.
  2. 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.

Build Your Own Custom Controls

Start Canvas Via the Command Line

See Starting Canvas from a Command Line for more information.