예제 #1
0
        public static double GetDouble(string cue = "Please enter a number in the dialog", string title = "Enter Number", string label = "Number Value", double initialValue = 0.0)
        {
            BlockForm form = new BlockForm(cue, title);

            Snap.UI.Block.Double num = new Snap.UI.Block.Double(label, initialValue);
            form.AddBlocks(new General[] { num });
            form.Show(DialogMode.Edit);
            return(num.Value);
        }
예제 #2
0
 //------------------------------------------------------------------------------
 //Callback Name: initialize_cb
 //------------------------------------------------------------------------------
 public void initialize_cb()
 {
     try
     {
         //tabControl = Snap.UI.Block.Group.GetBlock(theDialog,"tabControl");
         tabPage       = Snap.UI.Block.Group.GetBlock(theDialog, "tabPage");
         group5        = Snap.UI.Block.Group.GetBlock(theDialog, "group5");
         enum02        = Snap.UI.Block.Enumeration.GetBlock(theDialog, "enum02");
         group         = Snap.UI.Block.Group.GetBlock(theDialog, "group");
         bodySelect0   = Snap.UI.Block.SelectObject.GetBlock(theDialog, "bodySelect0");
         vector0       = Snap.UI.Block.SpecifyVector.GetBlock(theDialog, "vector0");
         group1        = Snap.UI.Block.Group.GetBlock(theDialog, "group1");
         enum0         = Snap.UI.Block.Enumeration.GetBlock(theDialog, "enum0");
         label01       = Snap.UI.Block.LabelBlock.GetBlock(theDialog, "label01");
         button0       = Snap.UI.Block.Button.GetBlock(theDialog, "button0");
         tabPage1      = Snap.UI.Block.Group.GetBlock(theDialog, "tabPage1");
         group2        = Snap.UI.Block.Group.GetBlock(theDialog, "group2");
         double0       = Snap.UI.Block.Double.GetBlock(theDialog, "double0");
         label0        = Snap.UI.Block.LabelBlock.GetBlock(theDialog, "label0");
         toggle0       = Snap.UI.Block.Toggle.GetBlock(theDialog, "toggle0");
         colorPicker0  = Snap.UI.Block.ColorPicker.GetBlock(theDialog, "colorPicker0");
         toggle01      = Snap.UI.Block.Toggle.GetBlock(theDialog, "toggle01");
         colorPicker01 = Snap.UI.Block.ColorPicker.GetBlock(theDialog, "colorPicker01");
         toggle02      = Snap.UI.Block.Toggle.GetBlock(theDialog, "toggle02");
         colorPicker02 = Snap.UI.Block.ColorPicker.GetBlock(theDialog, "colorPicker02");
         toggle03      = Snap.UI.Block.Toggle.GetBlock(theDialog, "toggle03");
         colorPicker03 = Snap.UI.Block.ColorPicker.GetBlock(theDialog, "colorPicker03");
         toggle04      = Snap.UI.Block.Toggle.GetBlock(theDialog, "toggle04");
         colorPicker04 = Snap.UI.Block.ColorPicker.GetBlock(theDialog, "colorPicker04");
         toggle05      = Snap.UI.Block.Toggle.GetBlock(theDialog, "toggle05");
         colorPicker05 = Snap.UI.Block.ColorPicker.GetBlock(theDialog, "colorPicker05");
         button01      = Snap.UI.Block.Button.GetBlock(theDialog, "button01");
         group4        = Snap.UI.Block.Group.GetBlock(theDialog, "group4");
         label02       = Snap.UI.Block.LabelBlock.GetBlock(theDialog, "label02");
         integer0      = Snap.UI.Block.Integer.GetBlock(theDialog, "integer0");
         label03       = Snap.UI.Block.LabelBlock.GetBlock(theDialog, "label03");
         integer01     = Snap.UI.Block.Integer.GetBlock(theDialog, "integer01");
         group3        = Snap.UI.Block.Group.GetBlock(theDialog, "group3");
         face_select0  = Snap.UI.Block.FaceCollector.GetBlock(theDialog, "face_select0");
         enum01        = Snap.UI.Block.Enumeration.GetBlock(theDialog, "enum01");
         button02      = Snap.UI.Block.Button.GetBlock(theDialog, "button02");
     }
     catch (Exception ex)
     {
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
 }
예제 #3
0
    //------------------------------------------------------------------------------
    //---------------------Block UI Styler Callback Functions--------------------------
    //------------------------------------------------------------------------------

    //------------------------------------------------------------------------------
    //Callback Name: initialize_cb
    //------------------------------------------------------------------------------
    public void initialize_cb()
    {
        try
        {
            group              = Snap.UI.Block.Group.GetBlock(theDialog, "group");
            selectCuprum       = Snap.UI.Block.SelectObject.GetBlock(theDialog, "selectCuprum");
            strElecName        = Snap.UI.Block.String.GetBlock(theDialog, "strElecName");
            stringExp          = Snap.UI.Block.String.GetBlock(theDialog, "stringExp");
            stringExp1         = Snap.UI.Block.String.GetBlock(theDialog, "stringExp1");
            strElecSize        = Snap.UI.Block.String.GetBlock(theDialog, "strElecSize");
            strElecCuttingSize = Snap.UI.Block.String.GetBlock(theDialog, "strElecCuttingSize");
            group1             = Snap.UI.Block.Group.GetBlock(theDialog, "group1");
            //scrolledWindow = (NXOpen.BlockStyler.ScrolledWindow)theDialog.TopBlock.FindBlock("scrolledWindow");
            txtFINISHNUMBER = Snap.UI.Block.Integer.GetBlock(theDialog, "txtFINISHNUMBER");
            txtMIDDLENUMBER = Snap.UI.Block.Integer.GetBlock(theDialog, "txtMIDDLENUMBER");
            txtROUGHNUMBER  = Snap.UI.Block.Integer.GetBlock(theDialog, "txtROUGHNUMBER");
            cboxMATNAME     = Snap.UI.Block.Enumeration.GetBlock(theDialog, "cboxMATNAME");
            cboxMMATNAME    = Snap.UI.Block.Enumeration.GetBlock(theDialog, "cboxMMATNAME");
            cboxRMATNAME    = Snap.UI.Block.Enumeration.GetBlock(theDialog, "cboxRMATNAME");
            cbbProdirection = Snap.UI.Block.Enumeration.GetBlock(theDialog, "cbbProdirection");
            cbbRockShape    = Snap.UI.Block.Enumeration.GetBlock(theDialog, "cbbRockShape");
            cbbShape        = Snap.UI.Block.Enumeration.GetBlock(theDialog, "cbbShape");
            //scrolledWindow1 = (NXOpen.BlockStyler.ScrolledWindow)theDialog.TopBlock.FindBlock("scrolledWindow1");
            txtFINISHSPACE = Snap.UI.Block.Double.GetBlock(theDialog, "txtFINISHSPACE");
            txtMIDDLESPACE = Snap.UI.Block.Double.GetBlock(theDialog, "txtMIDDLESPACE");
            txtROUGHSPACE  = Snap.UI.Block.Double.GetBlock(theDialog, "txtROUGHSPACE");
            cbbElecType    = Snap.UI.Block.Enumeration.GetBlock(theDialog, "cbbElecType");
            cbbRock        = Snap.UI.Block.Enumeration.GetBlock(theDialog, "cbbRock");
            //scrolledWindow11 = (NXOpen.BlockStyler.ScrolledWindow)theDialog.TopBlock.FindBlock("scrolledWindow11");
            cbbFSmoth    = Snap.UI.Block.Enumeration.GetBlock(theDialog, "cbbFSmoth");
            cbbMSmoth    = Snap.UI.Block.Enumeration.GetBlock(theDialog, "cbbMSmoth");
            cbbRSmoth    = Snap.UI.Block.Enumeration.GetBlock(theDialog, "cbbRSmoth");
            cbbChuckType = Snap.UI.Block.Enumeration.GetBlock(theDialog, "cbbChuckType");
            //CAPSET
            cbbCAPSET      = Snap.UI.Block.Enumeration.GetBlock(theDialog, "cbbCAPSET");
            groupSElec     = Snap.UI.Block.Group.GetBlock(theDialog, "groupSElec");                          // Block type: Group
            selectTopFace  = Snap.UI.Block.SelectObject.GetBlock(theDialog, "selectTopFace");                // Block type: Selection
            selectBaseFace = Snap.UI.Block.SelectObject.GetBlock(theDialog, "selectBaseFace");               // Block type: Selection
            //selectBaseFacePoint=Snap.UI.Block.SelectObject.GetBlock(theDialog, "selectBaseFacePoint");// Block type: Selection
            selectBaseFacePointEx = Snap.UI.Block.SpecifyPoint.GetBlock(theDialog, "selectBaseFacePointEx"); // Block type: Selection
        }
        catch (Exception ex)
        {
            //---- Enter your exception handling code here -----
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
        }
    }
예제 #4
0
        public static double[] GetDoubles(string title, string[] labels, double[] initialValues)
        {
            BlockForm form = new BlockForm(title);
            int       num  = System.Math.Min(labels.Length, initialValues.Length);

            Snap.UI.Block.Double[] blocks = new Snap.UI.Block.Double[num];
            for (int i = 0; i < num; i++)
            {
                blocks[i] = new Snap.UI.Block.Double(labels[i], initialValues[i]);
            }
            form.AddBlocks(blocks);
            form.Show(DialogMode.Edit);
            double[] numArray2 = new double[num];
            for (int j = 0; j < num; j++)
            {
                numArray2[j] = blocks[j].Value;
            }
            return(numArray2);
        }
예제 #5
0
    //------------------------------------------------------------------------------
    //---------------------Block UI Styler Callback Functions--------------------------
    //------------------------------------------------------------------------------

    //------------------------------------------------------------------------------
    //Callback Name: initialize_cb
    //------------------------------------------------------------------------------
    public void initialize_cb()
    {
        try
        {
            group3        = Snap.UI.Block.Group.GetBlock(theDialog, "group3");
            button05      = Snap.UI.Block.Button.GetBlock(theDialog, "button05");
            face_select0  = Snap.UI.Block.FaceCollector.GetBlock(theDialog, "face_select0");
            face_select01 = Snap.UI.Block.FaceCollector.GetBlock(theDialog, "face_select01");
            face_select02 = Snap.UI.Block.FaceCollector.GetBlock(theDialog, "face_select02");
            enum01        = Snap.UI.Block.Enumeration.GetBlock(theDialog, "enum01");
            button04      = Snap.UI.Block.Button.GetBlock(theDialog, "button04");
            group1        = Snap.UI.Block.Group.GetBlock(theDialog, "group1");
            enum0         = Snap.UI.Block.Enumeration.GetBlock(theDialog, "enum0");
            group         = Snap.UI.Block.Group.GetBlock(theDialog, "group");
            label04       = Snap.UI.Block.LabelBlock.GetBlock(theDialog, "label04");
            separator02   = Snap.UI.Block.Separator.GetBlock(theDialog, "separator02");
            toggle0       = Snap.UI.Block.Toggle.GetBlock(theDialog, "toggle0");
            double0       = Snap.UI.Block.Double.GetBlock(theDialog, "double0");
            toggle01      = Snap.UI.Block.Toggle.GetBlock(theDialog, "toggle01");
            double01      = Snap.UI.Block.Double.GetBlock(theDialog, "double01");
            toggle02      = Snap.UI.Block.Toggle.GetBlock(theDialog, "toggle02");
            double02      = Snap.UI.Block.Double.GetBlock(theDialog, "double02");
            separator01   = Snap.UI.Block.Separator.GetBlock(theDialog, "separator01");
            enum02        = Snap.UI.Block.Enumeration.GetBlock(theDialog, "enum02");
            enum03        = Snap.UI.Block.Enumeration.GetBlock(theDialog, "enum03");
            double03      = Snap.UI.Block.Double.GetBlock(theDialog, "double03");
            separator0    = Snap.UI.Block.Separator.GetBlock(theDialog, "separator0");
            //tree_control0 = (NXOpen.BlockStyler.Tree)theDialog.TopBlock.FindBlock("tree_control0");
            button0  = Snap.UI.Block.Button.GetBlock(theDialog, "button0");
            button01 = Snap.UI.Block.Button.GetBlock(theDialog, "button01");
            button02 = Snap.UI.Block.Button.GetBlock(theDialog, "button02");
            button03 = Snap.UI.Block.Button.GetBlock(theDialog, "button03");
            button06 = Snap.UI.Block.Button.GetBlock(theDialog, "button06");
            button07 = Snap.UI.Block.Button.GetBlock(theDialog, "button07");
            button08 = Snap.UI.Block.Button.GetBlock(theDialog, "button08");
            //------------------------------------------------------------------------------
            //Registration of Treelist specific callbacks
            //------------------------------------------------------------------------------
            //tree_control0.SetOnExpandHandler(new NXOpen.BlockStyler.Tree.OnExpandCallback(OnExpandCallback));

            //tree_control0.SetOnInsertColumnHandler(new NXOpen.BlockStyler.Tree.OnInsertColumnCallback(OnInsertColumnCallback));

            //tree_control0.SetOnInsertNodeHandler(new NXOpen.BlockStyler.Tree.OnInsertNodeCallback(OnInsertNodecallback));

            //tree_control0.SetOnDeleteNodeHandler(new NXOpen.BlockStyler.Tree.OnDeleteNodeCallback(OnDeleteNodecallback));

            //tree_control0.SetOnPreSelectHandler(new NXOpen.BlockStyler.Tree.OnPreSelectCallback(OnPreSelectcallback));

            //tree_control0.SetOnSelectHandler(new NXOpen.BlockStyler.Tree.OnSelectCallback(OnSelectcallback));

            //tree_control0.SetOnStateChangeHandler(new NXOpen.BlockStyler.Tree.OnStateChangeCallback(OnStateChangecallback));

            //tree_control0.SetToolTipTextHandler(new NXOpen.BlockStyler.Tree.ToolTipTextCallback(ToolTipTextcallback));

            //tree_control0.SetColumnSortHandler(new NXOpen.BlockStyler.Tree.ColumnSortCallback(ColumnSortcallback));

            //tree_control0.SetStateIconNameHandler(new NXOpen.BlockStyler.Tree.StateIconNameCallback(StateIconNameCallback));

            //tree_control0.SetOnBeginLabelEditHandler(new NXOpen.BlockStyler.Tree.OnBeginLabelEditCallback(OnBeginLabelEditCallback));

            //tree_control0.SetOnEndLabelEditHandler(new NXOpen.BlockStyler.Tree.OnEndLabelEditCallback(OnEndLabelEditCallback));

            //tree_control0.SetOnEditOptionSelectedHandler(new NXOpen.BlockStyler.Tree.OnEditOptionSelectedCallback(OnEditOptionSelectedCallback));

            //tree_control0.SetAskEditControlHandler(new NXOpen.BlockStyler.Tree.AskEditControlCallback(AskEditControlCallback));

            //tree_control0.SetOnMenuHandler(new NXOpen.BlockStyler.Tree.OnMenuCallback(OnMenuCallback));;

            //tree_control0.SetOnMenuSelectionHandler(new NXOpen.BlockStyler.Tree.OnMenuSelectionCallback(OnMenuSelectionCallback));;

            //tree_control0.SetIsDropAllowedHandler(new NXOpen.BlockStyler.Tree.IsDropAllowedCallback(IsDropAllowedCallback));;

            //tree_control0.SetIsDragAllowedHandler(new NXOpen.BlockStyler.Tree.IsDragAllowedCallback(IsDragAllowedCallback));;

            //tree_control0.SetOnDropHandler(new NXOpen.BlockStyler.Tree.OnDropCallback(OnDropCallback));;

            //tree_control0.SetOnDropMenuHandler(new NXOpen.BlockStyler.Tree.OnDropMenuCallback(OnDropMenuCallback));

            //tree_control0.SetOnDefaultActionHandler(new NXOpen.BlockStyler.Tree.OnDefaultActionCallback(OnDefaultActionCallback));

            //------------------------------------------------------------------------------
        }
        catch (Exception ex)
        {
            //---- Enter your exception handling code here -----
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
        }
    }