Interface Work

Quick Guide

Once you implement the node, its property sheet, data interfaces, and a scripted create command, you are ready to install the create command in the interface and begin testing.

Installing In The Interface

Scripted Create Command

The first step is to write a scripted create command.

  1. Open an Explorer window to \PROGRAM FILES\SCENOMICS\SCRIPTS.
  2. Create a text file named MYCOMPANY_CREATE_SCRIPTS.SSL.
  3. Copy/Paste the following example into your script.
  4. Change the file header to reflect your script name and copyright.
  5. Change the script header to reflect the name of your create command.
  6. Change the macro name to reflect the name of your create command.
  7. Change the IMAGE to use your custom icon or leave it as is.
  8. Change MYCLASSNAME to reflect the C++ class name of your node.
  9. Start Scenome and left click the Scripts tab.
  10. Add your script.
  11. Access the Customization Center.
  12. The Commands tab is active.
  13. Find the Create Commands command category.
  14. Find your create command.
  15. Drag and drop it over the create menu.
  16. This will allow you to create and test the node.

Example

This is what your script looks like:

/*----------------------------------------------------------------------------*/
/*  My Company Create Scripts                                                 */
/*                                                                            */
/*  Copyright (c) 2007 My Company. All Rights Reserved.                       */
/*----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------*/
/* AddNode Function                                                           */
/*----------------------------------------------------------------------------*/

function int AddNode( Node new_node, Group parentNode )
{
   Model.AddNode( new_node, parentNode, -1 );
   Model.Deselect( parentNode );
   return 1;
}

/*----------------------------------------------------------------------------*/
/* CreateMyNode                                                               */
/*----------------------------------------------------------------------------*/

macro CreateMyNode()
[Category="Create Commands", Guid="{1F91F915-F612-46D4-A453-4B81096121A9}", Image=".\\icons\\generic_script_icon.bmp"]
{
   for( int i = 0; i < Model.GetSelectCount(); ++i )
   {
      Node selNode = Model.GetSelectedNode( i ).GetNode();
      if( selNode.IsDerived( Group ) )
      {
         MYCLASSNAME myNode = new MYCLASSNAME;
         myNode.Name = "MyNode";
         AddNode( myNode, (Group)selNode );
      }
    }
}

Create A Command Menu

You need to create a command menu as well. This is very easy.

  1. Find SCENOME.XML on your hard drive.
  2. Open the file in a text editor.
  3. Find the first instance of the text CONTEXTMENU.
  4. Directly below that string, insert the XML from the example below.
  5. You can change the name attribute of the context menu to whatever you want but you should use the class name.
  6. The class attribute must match the C++ name of the class.
<contextmenu name="MYNODENAME" class="MYCLASSNAME">
  <item name="&Delete" guid="{1F91F9D2-F612-46D4-A453-4B81096121A9}" text="true" image="true"/>
  <separator/>
  <item name="&Properties..." guid="{1F91F85C-F612-46D4-A453-4B81096121A9}" text="true" image="true"/>
</contextmenu>

Further Work

If you implement additional commands that modify the new node you should add a new category to the Modify Menu and place those commands in the new menu. You should also add those commands to the command menu.

  1. Find SCENOME.XML on your hard drive.
  2. Open the file in a text editor.
  3. Find the first instance of the text CONTEXTMENU.
  4. Directly below that string, insert the XML from the example below.
  5. You can change the name attribute of the context menu to whatever you want but you should use the class name.
  6. The class attribute must match the C++ name of the class.