Screen Events

Event icon The Screen supports the following scripting events. Click next to any event name in the Events pane to see a short description for the selected event.

See Accessing Screen Objects for more information about how to view control objects in script in the Canvas application.

Event Description Event Argument Type (more info)

Broadcast Message Received

The Broadcast Message Received event is called when a broadcast message from another screen is received.

See Broadcast a Message Via Script for more information about using this event.

Canvas.Shared.BroadcastMessageEventArgs

Example

var argument = args as Canvas.Shared.BroadcastMessageEventArgs;

Close

The Close event is called when the screen is closed.

 

Controls Initialized

The Controls Initialized event is called after the Initialize event has been fired on the screen and all other controls within.

 

Custom Context Menu Action

The Custom Context Menu Action event is called when the custom context menu item is clicked. A Script event ID (configured for each custom context menu item in the Context Menu Items property for the screen or control) is passed in along with other relevant information in the context of the click, for example, facility or point tag, as appropriate.

CustomContextMenuActionEventArgs

When you click on a custom context menu item from the screen, Canvas will execute the following function:

  • Screen_CustomContextMenuAction(object sender, EventArgs args)

CustomContextMenuActionEventArgs.EventActionID indicates the Script event ID defined in the Custom Context Menu Configuration dialog box.

Example

private void Screen_CustomContextMenuAction(object sender, EventArgs args)

{

CustomContextMenuActionEventArgs myargs = (CustomContextMenuActionEventArgs)args;

MessageBox.Show(myargs.MenuItemText + " " + myargs.EventActionID + " " + myargs.FacilityTag + " " + myargs.PointTag);

}

Facility Changed

The Facility Changed event is called when the screen's facility is changed.

Canvas.Shared.FacilityChangedEventArgs

Example

var argument = args as Canvas.Shared.FacilityChangedEventArgs;

Initialize

The Initialize event is called when the screen is created in preview or run mode to allow further initialization of the control.

 

Navigate By Facility

The Navigate By Facility event is called when the screen receives a request to navigate by a specific facility tag.

See Navigation by Facility for more information about using this event.

Canvas.Shared.Events.NavigateByFacilityEventArgs

Example

var argument = args as Canvas.Shared.Events.NavigateByFacilityEventArgs;

 

Nested View Message Received

The Nested View Message Received event is called when a nested view sends a message to its parent screen.

See To communicate between screens in a nested view via script for more information about using this event.

Canvas.Shared.NestedViewMessageEventArgs

Example

var argument = args as Canvas.Shared.NestedViewMessageEventArgs;

Opened Via Hyperlink

The Opened Via Hyperlink event is called when a screen is opened via a hyperlink. The screen issuing the hyperlink must also provide a value for a data parameter; without this custom data, the event will not fire.

See Hyperlinking Screens and Navigation by Facility for more information about using this event.

Canvas.Shared.OpenedViaHyperlinkEventArgs

Example

var argument = args as Canvas.Shared.OpenedViaHyperlinkEventArgs;

See Order of Event Execution for information about the order in which events are executed on a screen.