protected override PropertyManagerPageNumberBoxEx CreateControl(
            IPropertyManagerPageNumberbox swCtrl, IAttributeSet atts, THandler handler, short height)
        {
            if (height != -1)
            {
                swCtrl.Height = height;
            }

            if (atts.Has <NumberBoxOptionsAttribute>())
            {
                var style = atts.Get <NumberBoxOptionsAttribute>();

                if (style.Style != 0)
                {
                    swCtrl.Style = (int)style.Style;
                }

                if (style.Units != 0)
                {
                    swCtrl.SetRange2((int)style.Units, style.Minimum, style.Maximum,
                                     style.Inclusive, style.Increment, style.FastIncrement, style.SlowIncrement);
                }
            }

            return(new PropertyManagerPageNumberBoxEx(atts.Id, atts.Tag, swCtrl, handler));
        }
Example #2
0
 protected static void ConfigAngleNumberBox(IPropertyManagerPageNumberbox config)
 {
     config.SetRange2((int)swNumberboxUnitType_e.swNumberBox_Angle, -10, 10, true, 0.005, 0.010, 0.001);
     config.DisplayedUnit = (int)swAngleUnit_e.swDEGREES;
 }
Example #3
0
        //Controls are displayed on the page top to bottom in the order
        //in which they are added to the object.
        protected void AddControls()
        {
            short controlType = -1;
            short align       = -1;
            int   options     = -1;

            //Add tabs
            tab1 = (PropertyManagerPageTab)swPropertyPage.AddTab(tab1ID, "Step 1", "", 0);
            tab2 = (PropertyManagerPageTab)swPropertyPage.AddTab(tab2ID, "Step 2", "", 0);

            //Add the groups
            options = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded |
                      (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible;

            group1 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group1ID, "Modify Extrusion", options);

            //options = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Checkbox |
            //          (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible;

            group2 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group2ID, "Rebuild the Model", options);

            //Add the controls to group1

            //button1
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Button;
            align       = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options     = (int)swAddControlOptions_e.swControlOptions_Enabled |
                          (int)swAddControlOptions_e.swControlOptions_Visible;

            button1 = (IPropertyManagerPageButton)group2.AddControl(button1ID, controlType, "Redraw", align, options, "Click to redraw");

            //Add controls to group2
            //selection1
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Selectionbox;
            align       = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options     = (int)swAddControlOptions_e.swControlOptions_Enabled |
                          (int)swAddControlOptions_e.swControlOptions_Visible;

            selection1 = (IPropertyManagerPageSelectionbox)group1.AddControl(selection1ID, controlType,
                                                                             "Selection", align,
                                                                             options,
                                                                             "Select an edge in the main view");

            if (selection1 != null)
            {
                int[] filter = { (int)swSelectType_e.swSelEDGES };
                selection1.Height           = 25;
                selection1.SingleEntityOnly = true;
                selection1.SetSelectionFilters(filter);
            }

            //num1
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Numberbox;
            align       = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options     = (int)swAddControlOptions_e.swControlOptions_Enabled |
                          (int)swAddControlOptions_e.swControlOptions_Visible;

            num1 = (IPropertyManagerPageNumberbox)group1.AddControl(num1ID, controlType,
                                                                    "Edge size", align,
                                                                    options,
                                                                    "Select and edge length");

            if (num1 != null)
            {
                num1.Value = 0;
                num1.SetRange2((int)swNumberboxUnitType_e.swNumberBox_Length, 0.0, 0.1, true, 0.001, 0.005, 0.0001);
                num1.DisplayedUnit = (int)swLengthUnit_e.swMM;
            }

            tab1.AddGroupBox(group1ID, "", 0);
            tab2.AddGroupBox(group2ID, "", 0);
            tab1.Activate();
            DisplayControls(1);
        }
 private static IDisposable ConfigureLinearAxisNumberBox(IPropertyManagerPageNumberbox config, double increment)
 {
     config.SetRange2((int)swNumberboxUnitType_e.swNumberBox_Length, -10, 10, true, increment, increment * 10, increment / 10);
     config.DisplayedUnit = (int)swLengthUnit_e.swMM;
     return Disposable.Empty;
 }
Example #5
0
 private static IDisposable ConfigureLinearAxisNumberBox(IPropertyManagerPageNumberbox config, double increment)
 {
     config.SetRange2((int)swNumberboxUnitType_e.swNumberBox_Length, -10, 10, true, increment, increment * 10, increment / 10);
     config.DisplayedUnit = (int)swLengthUnit_e.swMM;
     return(Disposable.Empty);
 }