// Populates the combo box with feature names
 private void FillComboBox(PropertyManagerPageCombobox box, List <string> featureNames)
 {
     box.Clear();
     box.AddItems("Automatically Generate");
     foreach (string name in featureNames)
     {
         box.AddItems(name);
     }
 }
Exemplo n.º 2
0
        // Finds the specified item in a combobox and sets the box to it. I'm not sure why I couldn't do this with a foreach loop
        // or even a for loop, but there is no way to get the current number of items in the menu
        private void selectComboBox(PropertyManagerPageCombobox box, string item)
        {
            short  i        = 0;
            string itemtext = "nothing";

            box.CurrentSelection = 0;

            // Cycles through the menu items until it finds what its looking for, it finds blank strings, or itemtext is null
            while (itemtext != null && itemtext != "" && itemtext != item)
            {
                // Gets the item text at index in a pull-down menu. No way to now how many items are in the combobox
                itemtext = box.get_ItemText(i);
                if (itemtext == item)
                {
                    box.CurrentSelection = i;
                }
                i++;
            }
        }
Exemplo n.º 3
0
 // Gets all the features in the SolidWorks model doc that match the specific feature name, and updates the specified combobox.
 private void updateComboBoxFromFeatures(PropertyManagerPageCombobox box, string featureName)
 {
     List<string> featureNames = Exporter.FindRefGeoNames(featureName);
     fillComboBox(box, featureNames);
 }
Exemplo n.º 4
0
        // Gets all the features in the SolidWorks model doc that match the specific feature name, and updates the specified combobox.
        private void updateComboBoxFromFeatures(PropertyManagerPageCombobox box, string featureName)
        {
            List <string> featureNames = Exporter.FindRefGeoNames(featureName);

            fillComboBox(box, featureNames);
        }
Exemplo n.º 5
0
        // Finds the specified item in a combobox and sets the box to it. I'm not sure why I couldn't do this with a foreach loop
        // or even a for loop, but there is no way to get the current number of items in the menu
        private void selectComboBox(PropertyManagerPageCombobox box, string item)
        {
            short i = 0;
            string itemtext = "nothing";
            box.CurrentSelection = 0;

            // Cycles through the menu items until it finds what its looking for, it finds blank strings, or itemtext is null
            while (itemtext != null && itemtext != "" && itemtext != item)
            {
                // Gets the item text at index in a pull-down menu. No way to now how many items are in the combobox
                itemtext = box.get_ItemText(i);
                if (itemtext == item)
                {
                    box.CurrentSelection = i;
                }
                i++;
            }
        }
Exemplo n.º 6
0
 // Populates the combo box with feature names
 private void fillComboBox(PropertyManagerPageCombobox box, List<string> featureNames)
 {
     box.Clear();
     box.AddItems("Automatically Generate");
     foreach (string name in featureNames)
     {
         box.AddItems(name);
     }
 }
Exemplo n.º 7
0
        //A method that sets up the Property Manager Page
        private void setupPropertyManagerPage(ref string caption, ref string tip, ref long options, ref int controlType, ref int alignment)
        {
            //Begin adding the controls to the page
            //Create the group box
            caption = "Configure and Organize Links";
            options = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible + (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded;
            pm_Group = (PropertyManagerPageGroup)pm_Page.AddGroupBox(GroupID, caption, (int)options);

            //Create the parent link label (static)
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption = "Parent Link";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            pm_Label_ParentLinkLabel = (PropertyManagerPageLabel)pm_Group.AddControl(Label_LinkName_ID, (short)controlType, caption, (short)alignment, (int)options, "");

            //Create the parent link name label, the one that is updated
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption = "";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            options = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            pm_Label_ParentLink = (PropertyManagerPageLabel)pm_Group.AddControl(Label_LinkName_ID, (short)controlType, caption, (short)alignment, (int)options, "");

            //Create the link name text box label
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption = "Link Name";
            tip = "Enter the name of the link";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            pm_Label_LinkName = (PropertyManagerPageLabel)pm_Group.AddControl(Label_LinkName_ID, (short)controlType, caption, (short)alignment, (int)options, tip);

            //Create the link name text box
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Textbox;
            caption = "base_link";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            tip = "Enter the name of the link";
            options = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            pm_TextBox_LinkName = (PropertyManagerPageTextbox)pm_Group.AddControl(TextBox_LinkNameID, (short)(controlType), caption, (short)alignment, (int)options, tip);

            //Create the joint name text box label
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption = "Joint Name";
            tip = "Enter the name of the joint";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_Label_JointName = (PropertyManagerPageLabel)pm_Group.AddControl(Label_JointName_ID, (short)controlType, caption, (short)alignment, (int)options, tip);

            //Create the joint name text box
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Textbox;
            caption = "";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            tip = "Enter the name of the joint";
            options = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_TextBox_JointName = (PropertyManagerPageTextbox)pm_Group.AddControl(TextBox_LinkNameID, (short)(controlType), caption, (short)alignment, (int)options, tip);

            //Create the global origin coordinate sys label
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption = "Global Origin Coordinate System";
            tip = "Select the reference coordinate system for the global origin";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_Label_GlobalCoordsys = (PropertyManagerPageLabel)pm_Group.AddControl(ID_Label_GlobalCoordsys, (short)controlType, caption, (short)alignment, (int)options, tip);

            // Create pull down menu for Coordinate systems
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Combobox;
            caption = "Global Origin Coordinate System Name";
            tip = "Select the reference coordinate system for the global origin";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            options = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_ComboBox_GlobalCoordsys = (PropertyManagerPageCombobox)pm_Group.AddControl(ID_GlobalCoordsys, (short)controlType, caption, (short)alignment, (int)options, tip);
            pm_ComboBox_GlobalCoordsys.Style = (int)swPropMgrPageComboBoxStyle_e.swPropMgrPageComboBoxStyle_EditBoxReadOnly;

            //Create the ref coordinate sys label
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption = "Reference Coordinate System";
            tip = "Select the reference coordinate system for the joint origin";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = 0;
            pm_Label_CoordSys = (PropertyManagerPageLabel)pm_Group.AddControl(Label_CoordSys_ID, (short)controlType, caption, (short)alignment, (int)options, tip);

            // Create pull down menu for Coordinate systems
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Combobox;
            caption = "Reference Coordinate System Name";
            tip = "Select the reference coordinate system for the joint origin";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            options = 0;
            pm_ComboBox_CoordSys = (PropertyManagerPageCombobox)pm_Group.AddControl(ComboBox_CoordSys_ID, (short)controlType, caption, (short)alignment, (int)options, tip);
            pm_ComboBox_CoordSys.Style = (int)swPropMgrPageComboBoxStyle_e.swPropMgrPageComboBoxStyle_EditBoxReadOnly;

            //Create the ref axis label
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption = "Reference Axis";
            tip = "Select the reference axis for the joint";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_Label_Axes = (PropertyManagerPageLabel)pm_Group.AddControl(Label_Axes_ID, (short)controlType, caption, (short)alignment, (int)options, tip);

            // Create pull down menu for axes
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Combobox;
            caption = "Reference Axis Name";
            tip = "Select the reference axis for the joint";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            options = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_ComboBox_Axes = (PropertyManagerPageCombobox)pm_Group.AddControl(ComboBox_CoordSys_ID, (short)controlType, caption, (short)alignment, (int)options, tip);
            pm_ComboBox_Axes.Style = (int)swPropMgrPageComboBoxStyle_e.swPropMgrPageComboBoxStyle_EditBoxReadOnly;

            //Create the joint type label
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption = "Joint Type";
            tip = "Select the joint type";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_Label_JointType = (PropertyManagerPageLabel)pm_Group.AddControl(Label_Axes_ID, (short)controlType, caption, (short)alignment, (int)options, tip);

            // Create pull down menu for joint type
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Combobox;
            caption = "Joint type";
            tip = "Select the joint type";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            options = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_ComboBox_JointType = (PropertyManagerPageCombobox)pm_Group.AddControl(ComboBox_CoordSys_ID, (short)controlType, caption, (short)alignment, (int)options, tip);
            pm_ComboBox_JointType.Style = (int)swPropMgrPageComboBoxStyle_e.swPropMgrPageComboBoxStyle_EditBoxReadOnly;
            pm_ComboBox_JointType.AddItems(new string[] { "Automatically Detect", "continuous", "revolute", "prismatic", "fixed" });

            //Create the selection box label
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption = "Link Components";
            tip = "Select components associated with this link";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            pm_Label_Selection = (PropertyManagerPageLabel)pm_Group.AddControl(Label_LinkName_ID, (short)controlType, caption, (short)alignment, (int)options, tip);

            //Create selection box
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Selectionbox;
            caption = "Link Components";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            options = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            tip = "Select components associated with this link";
            pm_Selection = (PropertyManagerPageSelectionbox)pm_Group.AddControl(SelectionID, (short)controlType, caption, (short)alignment, (int)options, tip);

            swSelectType_e[] filters = new swSelectType_e[1];
            filters[0] = swSelectType_e.swSelCOMPONENTS;
            object filterObj = null;
            filterObj = filters;

            pm_Selection.AllowSelectInMultipleBoxes = true;
            pm_Selection.SingleEntityOnly = false;
            pm_Selection.AllowMultipleSelectOfSameEntity = false;
            pm_Selection.Height = 50;
            pm_Selection.SetSelectionFilters(filterObj);

            //Create the number box label
            //Create the link name text box label
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption = "Number of child links";
            tip = "Enter the number of child links and they will be automatically added";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            pm_Label_ChildCount = (PropertyManagerPageLabel)pm_Group.AddControl(Label_LinkName_ID, (short)controlType, caption, (short)alignment, (int)options, tip);

            //Create the number box
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Numberbox;
            caption = "";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            tip = "Enter the number of child links and they will be automatically added";
            options = (int)swAddControlOptions_e.swControlOptions_Enabled + (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_NumberBox_ChildCount = pm_Group.AddControl(NumBox_ChildCount_ID, (short)controlType, caption, (short)alignment, (int)options, tip);
            pm_NumberBox_ChildCount.SetRange2((int)swNumberboxUnitType_e.swNumberBox_UnitlessInteger, 0, int.MaxValue, true, 1, 1, 1);
            pm_NumberBox_ChildCount.Value = 0;

            //pm_Button_save = pm_Group.AddControl(Button_save_ID, (short)swPropertyManagerPageControlType_e.swControlType_Button, "Build Link", 0, (int)options, "");
            pm_Button_export = pm_Group.AddControl(Button_export_ID, (short)swPropertyManagerPageControlType_e.swControlType_Button, "Preview and Export...", 0, (int)options, "");

            controlType = (int)swPropertyManagerPageControlType_e.swControlType_WindowFromHandle;
            caption = "Link Tree";
            alignment = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            pm_tree = pm_Page.AddControl(dotNet_tree, (short)swPropertyManagerPageControlType_e.swControlType_WindowFromHandle, caption, 0, (int)options, "");
            pm_tree.Height = 163;
            tree = new TreeView();
            tree.Height = 163;
            tree.Visible = true;
            tree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(tree_AfterSelect);
            tree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(tree_NodeMouseClick);
            tree.KeyDown += new System.Windows.Forms.KeyEventHandler(tree_KeyDown);
            tree.DragDrop += new DragEventHandler(tree_DragDrop);
            tree.DragOver += new DragEventHandler(tree_DragOver);
            tree.DragEnter += new DragEventHandler(tree_DragEnter);
            tree.ItemDrag += new ItemDragEventHandler(tree_ItemDrag);
            tree.AllowDrop = true;
            pm_tree.SetWindowHandlex64(tree.Handle.ToInt64());

            ToolStripMenuItem addChild = new ToolStripMenuItem();
            ToolStripMenuItem removeChild = new ToolStripMenuItem();
            //ToolStripMenuItem renameChild = new ToolStripMenuItem();
            addChild.Text = "Add Child Link";
            addChild.Click += new System.EventHandler(this.addChild_Click);

            removeChild.Text = "Remove";
            removeChild.Click += new System.EventHandler(this.removeChild_Click);
            //renameChild.Text = "Rename";
            //renameChild.Click += new System.EventHandler(this.renameChild_Click);
               //docMenu.Items.AddRange(new ToolStripMenuItem[] { addChild, removeChild, renameChild });
            docMenu.Items.AddRange(new ToolStripMenuItem[] { addChild, removeChild});
            LinkNode node = createEmptyNode(null);
            node.ContextMenuStrip = docMenu;
            tree.Nodes.Add(node);
            tree.SelectedNode = tree.Nodes[0];
            pm_Selection.SetSelectionFocus();
            pm_Page.SetFocus(dotNet_tree);
            //updateNodeNames(tree);
        }
        /// <summary>
        /// Creates the property manager page and populates it with controls
        /// </summary>
        private void SetupPage()
        {
            //Helper variables
            int options;
            short controlType, align;
            int errors = 0;

            //Create a property manager page and throw exceptions if an error occurs
            page = (PropertyManagerPage2)swApp.CreatePropertyManagerPage("Edit Links",
                                                                                   (int)swPropertyManagerPageOptions_e.swPropertyManagerOptions_OkayButton,
                                                                                   this, ref errors);
            if (errors == -1) //Creation failed
                throw new InternalSolidworksException("SldWorks::CreatePropertyManagerPage", "Failed to create property manager page");
            else if (errors == -2) //No open document
                throw new ProgramErrorException("Tried to open a property manager page when no document was open");
            else if (errors == 1) //Invlaid hanlder
                throw new ProgramErrorException("Tried to pass in and invalid page hanlder when creating a property manager page");

            //Sets the page's message
            page.SetMessage3(infoMessage,
                                    (int)swPropertyManagerPageMessageVisibility.swMessageBoxVisible,
                                    (int)swPropertyManagerPageMessageExpanded.swMessageBoxExpand,
                                    "Message");
            linkTab = page.AddTab(linkTabID, "Links", "", 0);
            jointTab = page.AddTab(jointTabID, "Joint", "", 0);
            #region Select Group

            //Setup and create link selection group
            options = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded |
                      (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible;
            selectGroup = (PropertyManagerPageGroup)linkTab.AddGroupBox(selectGroupID, "Select Link", options);

            //Setup and create link colors checkbox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Checkbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            linkColorCheckbox = (PropertyManagerPageCheckbox)selectGroup.AddControl(linkColorCheckboxID, controlType, "Color components by link", align, options, "Check to change all components that are part of links to the color of the link");
            linkColorCheckbox.Checked = false;

            //Setup and create the link selector form handle
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_WindowFromHandle;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            linkSelectorHandle = (PropertyManagerPageWindowFromHandle)selectGroup.AddControl(linkSelectorHandleID, controlType, "Link Selector", align, options, "Select, add, remove, and edit links");
               // linkSelectorControl = new LinkSelector(robot);
            //linkSelectorControl.OnLinkSelectionChanged += this.OnLinkSelectionChanged;
            linkSelectorHandle.Height = 200;
            //linkSelectorHandle.SetWindowHandlex64(linkSelectorControl.Handle.ToInt64());
            //linkSelectorControl.OnEditLink += EditLink;

            #endregion

            #region Link Properties Group

            //Setup and create the link properties group
            options = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded |
                      (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible;
            linkPropertiesGroup = (PropertyManagerPageGroup)linkTab.AddGroupBox(linkPropertiesGroupID, "Link Properties", options);

            //Setup and create the label for the link name texbox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            linkNameLabel = (PropertyManagerPageLabel)linkPropertiesGroup.AddControl(linkNameLabelID, controlType, "Link Name", align, options, "Change the name of this link");

            //Setup and create the link name textbox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Textbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                    (int)swAddControlOptions_e.swControlOptions_Visible;
            linkNameTextbox = (PropertyManagerPageTextbox)linkPropertiesGroup.AddControl(linkNameTextboxID, controlType, "Link Name", align, options, "Enter the name for this link here");

            //Setup and create the label for the link components selection box
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            linkComponentsLabel = (PropertyManagerPageLabel)linkPropertiesGroup.AddControl(linkComponentsLabelID, controlType, "Link Components", align, options, "Use this box to select components that are part of this link");

            //Setup and create the link components selection box
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Selectionbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                    (int)swAddControlOptions_e.swControlOptions_Visible;
            linkComponentsSelectionbox = (PropertyManagerPageSelectionbox)linkPropertiesGroup.AddControl(linkComponentsSelectionboxID, controlType, "Link Components", align, options, "Use this box to select components that are part of this link");
            linkComponentsSelectionbox.Height = 75;
            linkComponentsSelectionbox.Mark = 2;
            int[] filter = { (int)swSelectType_e.swSelCOMPONENTS };
            linkComponentsSelectionbox.SetSelectionFilters(filter);

            #endregion

            #region Joint Properties Group

            //Setup and create the joint properties group
            options = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded |
                      (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible;
            jointPropertiesGroup = (PropertyManagerPageGroup)jointTab.AddGroupBox(jointPropertiesGroupID, "Joint Properties", options);

            //Setup and create the label for the joint type combobox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            jointTypeLabel = (PropertyManagerPageLabel)jointPropertiesGroup.AddControl(linkNameLabelID, controlType, "Joint Type", align, options, "Change the name of this link");

            //Setup and create the label for the joint type combobox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Combobox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            jointTypeCombobox = (PropertyManagerPageCombobox)jointPropertiesGroup.AddControl(linkNameLabelID, controlType, "Joint Type", align, options, "Change the name of this link");
            jointTypeCombobox.AddItems(Joint.JointTypes);

            //Setup and create the label for the joint axis 1 selection box
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            jointAxis1Label = (PropertyManagerPageLabel)jointPropertiesGroup.AddControl(linkNameLabelID, controlType, "Axis 1", align, options, "Select an axis for this joint");

            //Setup and create the joint axis 1 selectionbox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Selectionbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                    (int)swAddControlOptions_e.swControlOptions_Visible;
            jointAxis1Selectionbox = (PropertyManagerPageSelectionbox)jointPropertiesGroup.AddControl(jointAxis1SelectionboxID, controlType, "Axis 1", align, options, "Use this box to select the axis of movment of this joint");
            jointAxis1Selectionbox.AllowSelectInMultipleBoxes = false;
            jointAxis1Selectionbox.SingleEntityOnly = true;
            jointAxis1Selectionbox.SetSelectionColor(true, (int)swUserPreferenceIntegerValue_e.swSystemColorsSelectedItem2);
            jointAxis1Selectionbox.Mark = 4;
            int[] filter2 = {(int) swSelectType_e.swSelDATUMAXES, (int)swSelectType_e.swSelEDGES };
            jointAxis1Selectionbox.SetSelectionFilters(filter2);

            //Setup and create the axis flip checkbox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Checkbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            flipAxisDirectionCheckbox = (PropertyManagerPageCheckbox)jointPropertiesGroup.AddControl(flipAxisDirectionCheckboxID, controlType, "flipAxisDirection", align, options, "Check to flip the direction of movement for this joint");
            flipAxisDirectionCheckbox.Checked = false;

            //Setup and create the joint Movement Limits properties group
            options = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded |
                      (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible;
            jointMovementLimitsGroup = (PropertyManagerPageGroup)jointTab.AddGroupBox(jointMovementLimitsGroupID, "Joint Movement Limits", options);

            //Setup and create joint lower edgelabel
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            jointLinkLowerEdgeLabel = (PropertyManagerPageLabel)jointMovementLimitsGroup.AddControl(linkNameLabelID, controlType, "Lower Link Edge", align, options, "Select a lower edge for this joint");

            //setup and create joint lower edge selection box
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Selectionbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                    (int)swAddControlOptions_e.swControlOptions_Visible;
            jointLinkLowerEdgeSelectionbox = (PropertyManagerPageSelectionbox)jointMovementLimitsGroup.AddControl(jointLinkLowerEdgeSelectionboxID, controlType, "Lower Link Edge", align, options, "Use this box to select the lower edge of the link");
            jointLinkLowerEdgeSelectionbox.AllowSelectInMultipleBoxes = false;
            jointLinkLowerEdgeSelectionbox.SingleEntityOnly = true;
            jointLinkLowerEdgeSelectionbox.SetSelectionColor(true, (int)swUserPreferenceIntegerValue_e.swSystemColorsSelectedItem2);
            jointLinkLowerEdgeSelectionbox.Mark = 8;
            int[] filter3 = { (int)swSelectType_e.swSelDATUMAXES, (int)swSelectType_e.swSelEDGES, (int)swSelectType_e.swSelFACES, (int)swSelectType_e.swSelVERTICES, (int)swSelectType_e.swSelDATUMPLANES, (int)swSelectType_e.swSelDATUMPOINTS };
            jointLinkLowerEdgeSelectionbox.SetSelectionFilters(filter3);

            //Setup and create joint lower limit stop label
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            jointLowerLimitStopLabel = (PropertyManagerPageLabel)jointMovementLimitsGroup.AddControl(linkNameLabelID, controlType, "Lower Motion Limit", align, options, "Select a lower limit for this joint");

            //setup and create joint lower limit selection box
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Selectionbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                    (int)swAddControlOptions_e.swControlOptions_Visible;
            jointLowerLimitStopSelectionbox = (PropertyManagerPageSelectionbox)jointMovementLimitsGroup.AddControl(jointLowerLimitStopSelectionboxID, controlType, "LowerMotionLimit", align, options, "Use this box to select the lower limit of the link");
            jointLowerLimitStopSelectionbox.AllowSelectInMultipleBoxes = false;
            jointLowerLimitStopSelectionbox.SingleEntityOnly = true;
            jointLowerLimitStopSelectionbox.SetSelectionColor(true, (int)swUserPreferenceIntegerValue_e.swSystemColorsSelectedItem3);
            jointLowerLimitStopSelectionbox.Mark = 16;
            jointLowerLimitStopSelectionbox.SetSelectionFilters(filter3);

            //Setup and create joint upper edgelabel
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            jointLinkUpperEdgeLabel = (PropertyManagerPageLabel)jointMovementLimitsGroup.AddControl(linkNameLabelID, controlType, "Upper Link Edge", align, options, "Select a Upper edge for this joint");

            //setup and create joint Upper edge selection box
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Selectionbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                    (int)swAddControlOptions_e.swControlOptions_Visible;
            jointLinkUpperEdgeSelectionbox = (PropertyManagerPageSelectionbox)jointMovementLimitsGroup.AddControl(jointLinkUpperEdgeSelectionboxID, controlType, "Upper Link Edge", align, options, "Use this box to select the upper edge of the link");
            jointLinkUpperEdgeSelectionbox.AllowSelectInMultipleBoxes = false;
            jointLinkUpperEdgeSelectionbox.SingleEntityOnly = true;
            jointLinkUpperEdgeSelectionbox.SetSelectionColor(true, (int)swUserPreferenceIntegerValue_e.swSystemColorsSelectedItem2);
            jointLinkUpperEdgeSelectionbox.Mark = 32;
            jointLinkUpperEdgeSelectionbox.SetSelectionFilters(filter3);

            //Setup and create joint Upper limit stop label
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            jointUpperLimitStopLabel = (PropertyManagerPageLabel)jointMovementLimitsGroup.AddControl(linkNameLabelID, controlType, "Upper Motion Limit", align, options, "Select an Upper limit for this joint");

            //Setup and create joint upper limit selectionbox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Selectionbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                    (int)swAddControlOptions_e.swControlOptions_Visible;
            jointUpperLimitStopSelectionbox = (PropertyManagerPageSelectionbox)jointMovementLimitsGroup.AddControl(jointUpperLimitStopSelectionboxID, controlType, "Upper Motion Limit", align, options, "Use this box to select the upper limit of the joint");
            jointUpperLimitStopSelectionbox.AllowSelectInMultipleBoxes = false;
            jointUpperLimitStopSelectionbox.SingleEntityOnly = true;
            jointUpperLimitStopSelectionbox.SetSelectionColor(true, (int)swUserPreferenceIntegerValue_e.swSystemColorsSelectedItem3);
            jointUpperLimitStopSelectionbox.Mark = 64;
            jointUpperLimitStopSelectionbox.SetSelectionFilters(filter3);

            //Setup and create manual limit checkbox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Checkbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            jointManualLimitsCheckbox = (PropertyManagerPageCheckbox)jointMovementLimitsGroup.AddControl(jointManualLimitsCheckboxID, controlType, "Set manual values for limits", align, options, "Check to manually set limit offsets from current position");
            jointManualLimitsCheckbox.Checked = false;

            //Setup and create joint lower limit label
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Visible;
            jointLowerLimitLabel = (PropertyManagerPageLabel)jointMovementLimitsGroup.AddControl(linkNameLabelID, controlType, "Lower limit", align, options, "Select a lower limit for this joint");

            //Setup and create the joint lower limit Textbox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Textbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Visible;
            jointLowerLimitTextbox = (PropertyManagerPageTextbox)jointMovementLimitsGroup.AddControl(jointLowerLimitTextboxID, controlType, "0.0", align, options, "Enter the lower limit of the joint");

            //Setup and create joint upper limit label
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Visible;
            jointUpperLimitLabel = (PropertyManagerPageLabel)jointMovementLimitsGroup.AddControl(linkNameLabelID, controlType, "Upper limit", align, options, "Select an upper limit for this joint");

            //Setup and create the joint upper limit Textbox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Textbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Visible;
            jointUpperLimitTextbox = (PropertyManagerPageTextbox)jointMovementLimitsGroup.AddControl(jointUpperLimitTextboxID, controlType, "0.0", align, options, "Enter the upper limit of the joint");

            //Create the joint physical properties group
            options = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded |
                      (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible;
            jointPhysicalPropertiesGroup = (PropertyManagerPageGroup)jointTab.AddGroupBox(jointPhysicalPropertiesGroupID, "Joint Physical Properties", options);

            //Setup and create joint effort limit label
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            jointEffortLimitLabel = (PropertyManagerPageLabel)jointPhysicalPropertiesGroup.AddControl(linkNameLabelID, controlType, "Effort limit", align, options, "Select an effort limit for this joint");

            //Setup and create the joint effort limit textbox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Textbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                    (int)swAddControlOptions_e.swControlOptions_Visible;
            jointEffortLimitTextbox = (PropertyManagerPageTextbox)jointPhysicalPropertiesGroup.AddControl(jointEffortLimitTextboxID, controlType, "0.0", align, options, "Enter the effort limit of the joint");

            //Setup and create joint velocity limit label
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            jointVelocityLimitLabel = (PropertyManagerPageLabel)jointPhysicalPropertiesGroup.AddControl(linkNameLabelID, controlType, "Velocity limit", align, options, "Select a velocity limit for this joint");

            //Setup and create the joint velocity limit selectionbox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Textbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                    (int)swAddControlOptions_e.swControlOptions_Visible;
            jointVelocityLimitTextbox = (PropertyManagerPageTextbox)jointPhysicalPropertiesGroup.AddControl(jointVelocityLimitTextboxID, controlType, "0.0", align, options, "Enter the velocity limit of the joint");

            /*
            //Setup and create the label for the joint axis 2 selection box
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            leftAlign = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                       (int)swAddControlOptions_e.swControlOptions_Visible;
            jointAxis2Label = (PropertyManagerPageLabel)jointPropertiesGroup.AddControl(linkNameLabelID, controlType, "Axis 2", leftAlign, options, "Select an axis for this joint");

            //Setup and create the joint axis 2 selection box
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Selectionbox;
            leftAlign = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                    (int)swAddControlOptions_e.swControlOptions_Visible;
            jointAxis2Selectionbox = (PropertyManagerPageSelectionbox)jointPropertiesGroup.AddControl(jointAxis2SelectionboxID, controlType, "Link Components", leftAlign, options, "Use this box to select components that are part of this link");
            jointAxis2Selectionbox.AllowSelectInMultipleBoxes = false;
            jointAxis2Selectionbox.SingleEntityOnly = true;
            jointAxis2Selectionbox.SetSelectionColor(true, (int)swUserPreferenceIntegerValue_e.swSystemColorsSelectedItem4);
            jointAxis2Selectionbox.Mark = 8;
            jointAxis2Selectionbox.SetSelectionFilters(filter2);
            */
            #endregion
        }
Exemplo n.º 9
0
        //A method that sets up the Property Manager Page
        private void setupPropertyManagerPage(ref string caption, ref string tip, ref long options, ref int controlType, ref int alignment)
        {
            //Begin adding the controls to the page
            //Create the group box
            caption  = "Configure and Organize Links";
            options  = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible + (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded;
            pm_Group = (PropertyManagerPageGroup)pm_Page.AddGroupBox(GroupID, caption, (int)options);

            //Create the parent link label (static)
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption     = "Parent Link";
            alignment   = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options     = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            pm_Label_ParentLinkLabel = (PropertyManagerPageLabel)pm_Group.AddControl(Label_LinkName_ID, (short)controlType, caption, (short)alignment, (int)options, "");

            //Create the parent link name label, the one that is updated
            controlType         = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption             = "";
            alignment           = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            options             = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            pm_Label_ParentLink = (PropertyManagerPageLabel)pm_Group.AddControl(Label_LinkName_ID, (short)controlType, caption, (short)alignment, (int)options, "");

            //Create the link name text box label
            controlType       = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption           = "Link Name";
            tip               = "Enter the name of the link";
            alignment         = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options           = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            pm_Label_LinkName = (PropertyManagerPageLabel)pm_Group.AddControl(Label_LinkName_ID, (short)controlType, caption, (short)alignment, (int)options, tip);

            //Create the link name text box
            controlType         = (int)swPropertyManagerPageControlType_e.swControlType_Textbox;
            caption             = "base_link";
            alignment           = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            tip                 = "Enter the name of the link";
            options             = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            pm_TextBox_LinkName = (PropertyManagerPageTextbox)pm_Group.AddControl(TextBox_LinkNameID, (short)(controlType), caption, (short)alignment, (int)options, tip);


            //Create the joint name text box label
            controlType        = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption            = "Joint Name";
            tip                = "Enter the name of the joint";
            alignment          = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options            = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_Label_JointName = (PropertyManagerPageLabel)pm_Group.AddControl(Label_JointName_ID, (short)controlType, caption, (short)alignment, (int)options, tip);

            //Create the joint name text box
            controlType          = (int)swPropertyManagerPageControlType_e.swControlType_Textbox;
            caption              = "";
            alignment            = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            tip                  = "Enter the name of the joint";
            options              = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_TextBox_JointName = (PropertyManagerPageTextbox)pm_Group.AddControl(TextBox_LinkNameID, (short)(controlType), caption, (short)alignment, (int)options, tip);

            //Create the global origin coordinate sys label
            controlType             = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption                 = "Global Origin Coordinate System";
            tip                     = "Select the reference coordinate system for the global origin";
            alignment               = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options                 = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_Label_GlobalCoordsys = (PropertyManagerPageLabel)pm_Group.AddControl(ID_Label_GlobalCoordsys, (short)controlType, caption, (short)alignment, (int)options, tip);


            // Create pull down menu for Coordinate systems
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Combobox;
            caption     = "Global Origin Coordinate System Name";
            tip         = "Select the reference coordinate system for the global origin";
            alignment   = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            options     = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_ComboBox_GlobalCoordsys       = (PropertyManagerPageCombobox)pm_Group.AddControl(ID_GlobalCoordsys, (short)controlType, caption, (short)alignment, (int)options, tip);
            pm_ComboBox_GlobalCoordsys.Style = (int)swPropMgrPageComboBoxStyle_e.swPropMgrPageComboBoxStyle_EditBoxReadOnly;



            //Create the ref coordinate sys label
            controlType       = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption           = "Reference Coordinate System";
            tip               = "Select the reference coordinate system for the joint origin";
            alignment         = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options           = 0;
            pm_Label_CoordSys = (PropertyManagerPageLabel)pm_Group.AddControl(Label_CoordSys_ID, (short)controlType, caption, (short)alignment, (int)options, tip);


            // Create pull down menu for Coordinate systems
            controlType                = (int)swPropertyManagerPageControlType_e.swControlType_Combobox;
            caption                    = "Reference Coordinate System Name";
            tip                        = "Select the reference coordinate system for the joint origin";
            alignment                  = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            options                    = 0;
            pm_ComboBox_CoordSys       = (PropertyManagerPageCombobox)pm_Group.AddControl(ComboBox_CoordSys_ID, (short)controlType, caption, (short)alignment, (int)options, tip);
            pm_ComboBox_CoordSys.Style = (int)swPropMgrPageComboBoxStyle_e.swPropMgrPageComboBoxStyle_EditBoxReadOnly;

            //Create the ref axis label
            controlType   = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption       = "Reference Axis";
            tip           = "Select the reference axis for the joint";
            alignment     = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options       = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_Label_Axes = (PropertyManagerPageLabel)pm_Group.AddControl(Label_Axes_ID, (short)controlType, caption, (short)alignment, (int)options, tip);


            // Create pull down menu for axes
            controlType            = (int)swPropertyManagerPageControlType_e.swControlType_Combobox;
            caption                = "Reference Axis Name";
            tip                    = "Select the reference axis for the joint";
            alignment              = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            options                = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_ComboBox_Axes       = (PropertyManagerPageCombobox)pm_Group.AddControl(ComboBox_CoordSys_ID, (short)controlType, caption, (short)alignment, (int)options, tip);
            pm_ComboBox_Axes.Style = (int)swPropMgrPageComboBoxStyle_e.swPropMgrPageComboBoxStyle_EditBoxReadOnly;

            //Create the joint type label
            controlType        = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption            = "Joint Type";
            tip                = "Select the joint type";
            alignment          = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options            = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_Label_JointType = (PropertyManagerPageLabel)pm_Group.AddControl(Label_Axes_ID, (short)controlType, caption, (short)alignment, (int)options, tip);


            // Create pull down menu for joint type
            controlType                 = (int)swPropertyManagerPageControlType_e.swControlType_Combobox;
            caption                     = "Joint type";
            tip                         = "Select the joint type";
            alignment                   = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            options                     = (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_ComboBox_JointType       = (PropertyManagerPageCombobox)pm_Group.AddControl(ComboBox_CoordSys_ID, (short)controlType, caption, (short)alignment, (int)options, tip);
            pm_ComboBox_JointType.Style = (int)swPropMgrPageComboBoxStyle_e.swPropMgrPageComboBoxStyle_EditBoxReadOnly;
            pm_ComboBox_JointType.AddItems(new string[] { "Automatically Detect", "continuous", "revolute", "prismatic", "fixed" });


            //Create the selection box label
            controlType        = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption            = "Link Components";
            tip                = "Select components associated with this link";
            alignment          = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options            = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            pm_Label_Selection = (PropertyManagerPageLabel)pm_Group.AddControl(Label_LinkName_ID, (short)controlType, caption, (short)alignment, (int)options, tip);

            //Create selection box
            controlType  = (int)swPropertyManagerPageControlType_e.swControlType_Selectionbox;
            caption      = "Link Components";
            alignment    = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            options      = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            tip          = "Select components associated with this link";
            pm_Selection = (PropertyManagerPageSelectionbox)pm_Group.AddControl(SelectionID, (short)controlType, caption, (short)alignment, (int)options, tip);

            swSelectType_e[] filters = new swSelectType_e[1];
            filters[0] = swSelectType_e.swSelCOMPONENTS;
            object filterObj = null;

            filterObj = filters;

            pm_Selection.AllowSelectInMultipleBoxes      = true;
            pm_Selection.SingleEntityOnly                = false;
            pm_Selection.AllowMultipleSelectOfSameEntity = false;
            pm_Selection.Height = 50;
            pm_Selection.SetSelectionFilters(filterObj);

            //Create the number box label
            //Create the link name text box label
            controlType         = (int)swPropertyManagerPageControlType_e.swControlType_Label;
            caption             = "Number of child links";
            tip                 = "Enter the number of child links and they will be automatically added";
            alignment           = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options             = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            pm_Label_ChildCount = (PropertyManagerPageLabel)pm_Group.AddControl(Label_LinkName_ID, (short)controlType, caption, (short)alignment, (int)options, tip);

            //Create the number box
            controlType             = (int)swPropertyManagerPageControlType_e.swControlType_Numberbox;
            caption                 = "";
            alignment               = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            tip                     = "Enter the number of child links and they will be automatically added";
            options                 = (int)swAddControlOptions_e.swControlOptions_Enabled + (int)swAddControlOptions_e.swControlOptions_Visible;
            pm_NumberBox_ChildCount = pm_Group.AddControl(NumBox_ChildCount_ID, (short)controlType, caption, (short)alignment, (int)options, tip);
            pm_NumberBox_ChildCount.SetRange2((int)swNumberboxUnitType_e.swNumberBox_UnitlessInteger, 0, int.MaxValue, true, 1, 1, 1);
            pm_NumberBox_ChildCount.Value = 0;

            //pm_Button_save = pm_Group.AddControl(Button_save_ID, (short)swPropertyManagerPageControlType_e.swControlType_Button, "Build Link", 0, (int)options, "");
            pm_Button_export = pm_Group.AddControl(Button_export_ID, (short)swPropertyManagerPageControlType_e.swControlType_Button, "Preview and Export...", 0, (int)options, "");

            controlType          = (int)swPropertyManagerPageControlType_e.swControlType_WindowFromHandle;
            caption              = "Link Tree";
            alignment            = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options              = (int)swAddControlOptions_e.swControlOptions_Visible + (int)swAddControlOptions_e.swControlOptions_Enabled;
            pm_tree              = pm_Page.AddControl(dotNet_tree, (short)swPropertyManagerPageControlType_e.swControlType_WindowFromHandle, caption, 0, (int)options, "");
            pm_tree.Height       = 163;
            tree                 = new TreeView();
            tree.Height          = 163;
            tree.Visible         = true;
            tree.AfterSelect    += new System.Windows.Forms.TreeViewEventHandler(tree_AfterSelect);
            tree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(tree_NodeMouseClick);
            tree.KeyDown        += new System.Windows.Forms.KeyEventHandler(tree_KeyDown);
            tree.DragDrop       += new DragEventHandler(tree_DragDrop);
            tree.DragOver       += new DragEventHandler(tree_DragOver);
            tree.DragEnter      += new DragEventHandler(tree_DragEnter);
            tree.ItemDrag       += new ItemDragEventHandler(tree_ItemDrag);
            tree.AllowDrop       = true;
            pm_tree.SetWindowHandlex64(tree.Handle.ToInt64());

            ToolStripMenuItem addChild    = new ToolStripMenuItem();
            ToolStripMenuItem removeChild = new ToolStripMenuItem();

            //ToolStripMenuItem renameChild = new ToolStripMenuItem();
            addChild.Text   = "Add Child Link";
            addChild.Click += new System.EventHandler(this.addChild_Click);

            removeChild.Text   = "Remove";
            removeChild.Click += new System.EventHandler(this.removeChild_Click);
            //renameChild.Text = "Rename";
            //renameChild.Click += new System.EventHandler(this.renameChild_Click);
            //docMenu.Items.AddRange(new ToolStripMenuItem[] { addChild, removeChild, renameChild });
            docMenu.Items.AddRange(new ToolStripMenuItem[] { addChild, removeChild });
            LinkNode node = createEmptyNode(null);

            node.ContextMenuStrip = docMenu;
            tree.Nodes.Add(node);
            tree.SelectedNode = tree.Nodes[0];
            pm_Selection.SetSelectionFocus();
            pm_Page.SetFocus(dotNet_tree);
            //updateNodeNames(tree);
        }