Enabling Commands Through the Asset Navigator Control

 

The latest version of GENESIS64/GraphWorX64 allows you to run commands from a tree navigation control into other controls in the display. This is done by utilizing the asset catalog structure set up through the AssetWorX provider in the Workbench.

 

The following is an example of how to utilize an Asset Navigator Control within a GraphWorX64 display to initiate a command for an additional control within the same display (in this example, a GraphWorX64 Viewer).

  1. Open GraphWorX64. From the Start menu > All Programs > ICONICS > GENESIS64 > GraphWorX64 > GraphWorX64.
  2. Select the Asset Navigator control from the Controls ribbon, as shown below.

Selecting the Asset Navigator Control in GraphWorX64

  1. Draw a box in which to place the Asset Navigator control. Since a tree navigation control typically expands vertically, a more vertical box is appropriate. Once you've placed the control, you'll notice the asset tree has branch placeholders including "Root", "Company" and "Factory". These will be replaced during runtime if you have previously set up an asset database within the AssetWorX provider in the Workbench.

  2. Next, select the GraphWorX64 Viewer control and draw another box in which to place that control. Your GraphWorX64 display should closely resemble the following image:

Asset Navigator and GraphWorX64 Viewer Controls Added

 

  1. At any point prior to including these two controls within a GraphWorX64 display, you should have already created an asset catalog database within the AssetWorX provider in the Workbench. The image below shows the AssetWorX provider within the Workbench. The host machine, 'localhost', contains our asset catalog database (also named 'AssetWorX'), that contains a sample asset that we've named 'Test Asset' (highlighted in the red box on the left).

    When you double-click on the asset (in our example, 'Test Asset') its properties will appear in the form on the right. Click on the 'Commands' tab (highlighted in the red box in the top middle) to set a specific command.

    In our specific example, we will select the 'Load Graphics Display' from the Command pulldown menu. We've also named the command as 'Load Display' so as to recognize this specific command selection during runtime later on. We've made sure its 'Visible' as well as enabled its 'Drag & drop' ability. We want to make sure that it can be used in GraphWorX64 (as well as the remaining selections). For this example, we will not use any aliases (Local or Global).

    For the FileName, we will provide the location of a previously created GraphWorX64 display.

    For Target, we will enter what the GraphWorX64 Viewer control name will be once we return to the GraphWorX64 display we started creating (for our example, we've named it "TestControlCommandTarget").

    Click 'Apply' or 'Apply & Close' to save these settings.

Setting Commands Properties for an Asset in the AssetWorX Provider

  1. Returning to our GraphWorX64 display, since we wanted to utilize Drag & Drop, we need to ensure each Control is set to use it. Click on the Asset Navigator control's box to select it, then edit the 'DragAndDropEnabled" field in the 'Misc' section of the Properties to the right of the screen, by setting the pulldown to 'True' (as shown below).

Enabling Drag and Drop for the Asset Navigator Control

  1. Next, click on the GraphWorX64 Viewer control to select it, then edit the DragandDropCommandingEnabled field in the Misc - Commanding section of the Properties to the right of the screen, by setting the pulldown to 'True' (as shown below).

Enabling Drag and Drop for the GraphWorX64 Viewer Control

  1. At the same time, now that we have the GraphWorX64 Viewer control selected, we will give it the name we previously entered in the 'Target' field of the Commands tab of the properties for the 'Test Asset' in AssetWorX (in Step 5 above). We'll enter 'TestControlCommandTarget' in the Name field in the Common section of the Properties to the right of the screen, as shown below.

Naming the GraphWorX64 Viewer Control

  1. We can now put the display into Runtime (by either clicking on the Runtime button in the top right of the screen or using 'Ctrl-M'). Our example display will resemble the following image. You'll notice that the Asset Navigator control no longer has the placeholder 'Root>Company>Factory' branches and that it now shows the top level of the asset catalog database you created in the AssetWorX provider in the Workbench (in our example, the top level is 'Assets'), as shown below. You'll also notice that the GraphWorX64 Viewer control is presently blank.

Initial Runtime View of Asset Navigator and GraphWorX64 Viewer Controls

  1. Expand the asset tree within the Asset Navigator control. You'll see the 'Test Asset' we created within the AssetWorX provider in the Workbench. Right-click on the 'Test Asset' branch and you'll see the 'Load Display' command we created and named, as well.

Expanded Asset Tree in Asset Navigator with Associated Command

 

Since we also enabled 'Drag and Drop' for both controls, instead of right-clicking on the 'Test Asset', you could also left-click on its icon and drag it directly into the GraphWorX64 Viewer control. You'll see the cursor change to include a plus sign [+] to signify that the control will accept a dragged item.

  1. The GraphWorX64 Viewer control will now show the successfully sent command from the Asset Navigator [which is the GraphWorX64 file you set in the 'FileName' field of the Commands tab of the properties for the 'Test Asset' in AssetWorX (in Step 5 above)] (see image below).

GraphWorX64 Viewer Control with Successful Command Sent from Asset Navigator Control

 

See Also:

Commanding

Commanding in GraphWorX64

Local Commands

Global Commands