Ejemplo n.º 1
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 textctlType = -1;
            short align       = -1;
            int   options     = -1;


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

            group1 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group1ID, "尺寸选择", options);


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

            textctlType = (int)swPropertyManagerPageControlType_e.swControlType_Textbox;

            lbLength      = (IPropertyManagerPageLabel)group1.AddControl(lbLengthID, controlType, "长:", align, options, "阀块基体长度");
            tbLength      = (IPropertyManagerPageTextbox)group1.AddControl(tbLengthID, textctlType, "", align, options, "阀块长度");
            lbWidth       = (IPropertyManagerPageLabel)group1.AddControl(lbWidthID, controlType, "宽:", align, options, "阀块基体宽度");
            tbWidth       = (IPropertyManagerPageTextbox)group1.AddControl(tbWidthID, textctlType, "", align, options, "阀块宽度");
            lbHeight      = (IPropertyManagerPageLabel)group1.AddControl(lbHeightID, controlType, "高:", align, options, "阀块基体高度");
            tbHeight      = (IPropertyManagerPageTextbox)group1.AddControl(tbHeightID, textctlType, "", align, options, "阀块高度");
            tbLength.Text = ValueConst.VALUE_DEFAULT_LENGTH.ToString();
            tbWidth.Text  = ValueConst.VALUE_DEFAULT_WIDTH.ToString();
            tbHeight.Text = ValueConst.VALUE_DEFAULT_HEIGHT.ToString();
        }
Ejemplo n.º 2
0
 protected virtual TControlSw CreateSwControlInGroup(IPropertyManagerPageGroup group,
                                                     ControlOptionsAttribute opts, IAttributeSet atts)
 {
     if (m_App.IsVersionNewerOrEqual(SwVersion_e.Sw2014, 1))
     {
         return(group.AddControl2(atts.Id, (short)m_Type, atts.Name,
                                  (short)opts.Align, (short)opts.Options, atts.Description) as TControlSw);
     }
     else
     {
         return(group.AddControl(atts.Id, (short)m_Type, atts.Name,
                                 (short)opts.Align, (short)opts.Options, atts.Description) as TControlSw);
     }
 }
 protected override PropertyManagerPageOptionBox CreateSwControlInGroup(IPropertyManagerPageGroup group,
                                                                        ControlOptionsAttribute opts, IAttributeSet atts)
 {
     return(CreateOptionBoxControl(opts, atts,
                                   (int id, short controlType, string caption, short leftAlign, int options, string tip) =>
     {
         if (m_App.IsVersionNewerOrEqual(SwVersion_e.Sw2014, 1))
         {
             return group.AddControl2(id, controlType, caption, leftAlign, options, tip) as IPropertyManagerPageOption;
         }
         else
         {
             return group.AddControl(id, controlType, caption, leftAlign, options, tip) as IPropertyManagerPageOption;
         }
     }));
 }
Ejemplo n.º 4
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 the groups
            options = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded |
                      (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible;

            group1 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group1ID, "Window Form", options);

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

            group2 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group2ID, "User Control", options);

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

            group3 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group3ID, "WPF Control", options);

            //Add the controls to group1`
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_WindowFromHandle;
            align       = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options     = (int)swAddControlOptions_e.swControlOptions_Enabled |
                          (int)swAddControlOptions_e.swControlOptions_Visible;

            dotnet1        = (IPropertyManagerPageWindowFromHandle)group1.AddControl(DotNet1ID, controlType, ".Net Windows Form Control", align, options, "This Control is added without COM");
            dotnet1.Height = 150;

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

            dotnet2        = (IPropertyManagerPageWindowFromHandle)group2.AddControl(DotNet2ID, controlType, ".Net User Form Control", align, options, "This Control is added without COM");
            dotnet2.Height = 150;

            dotnet3        = (IPropertyManagerPageWindowFromHandle)group3.AddControl(DotNet3ID, controlType, ".Net WPF Control", align, options, "This Control is added without COM");
            dotnet3.Height = 50;
        }
Ejemplo n.º 5
0
        protected void AddControls()
        {
            short controlType = -1;
            short align       = -1;
            int   options     = -1;

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

            group1 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group1ID, "选择点位草图", options);


            //Add the controls to group1

            //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 = (PropertyManagerPageSelectionbox)group1.AddControl(selection1ID, controlType, "Sample Selection", align, options, "Displays features selected in main view");
            if (selection1 != null)
            {
                int[] filter = { (int)swSelectType_e.swSelSKETCHES };
                selection1.Height = 40;
                selection1.SetSelectionFilters(filter);
                selection1.SingleEntityOnly = true;
            }

            ////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 = (PropertyManagerPageButton)group1.AddControl(button1ID, controlType, "ReDraw", align, options, "Redraw the model");
        }
Ejemplo n.º 6
0
        //Controls are displayed on the page top to bottom in the order
        //in which they are added to the object.
        /// <summary>
        /// 增加所有控件到页面中
        /// </summary>
        protected void AddControls()
        {
            short controlType = -1;
            short align       = -1;
            int   options     = -1;

            options = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded |
                      (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible;

            group1 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group1ID, "Please select a face", options);
            group2 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group2ID, "", options);

            //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, "Sample Selection", align, options, "Displays features selected in main view");
            if (selection1 != null)
            {
                int[] filter = { (int)swSelectType_e.swSelFACES };
                selection1.Height = 40;
                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;

            numberSize = (IPropertyManagerPageNumberbox)group1.AddControl(num1ID, controlType, "Sample Numberbox", align, options, "Allows for numerical input");
            if (numberSize != null)
            {
                numberSize.Value = 60;
                //输入框 定义 最小值 最大值 ,以及增量
                numberSize.SetRange((int)swNumberboxUnitType_e.swNumberBox_UnitlessDouble, 30, 100, 10, true);
            }

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

            pm_MyPMPControl        = (PropertyManagerPageWindowFromHandle)group2.AddControl(90, controlType, "1122", align, options, "333444");
            pm_MyPMPControl.Height = 90;
            //pm_MyPMPControl.Height = 90;

            //if (b == false)
            //{
            //    MessageBox.Show("Failed to add User control!");
            //}

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

            //combo1 = (IPropertyManagerPageCombobox)group1.AddControl(combo1ID, controlType, "Sample Combobox", align, options, "Combo list");
            //if (combo1 != null)
            //{
            //    string[] items = { "40x40", "60x60", "80x80" };
            //    combo1.AddItems(items);
            //    combo1.Height = 50;
            //}
        }
Ejemplo n.º 7
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 the groups
            options = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded |
                      (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible;

            group1 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group1ID, "Window Form", options);

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

            group2 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group2ID, "User Control", options);

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

            group3 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group3ID, "WPF Control", options);

            //Add the controls to group1`
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_WindowFromHandle;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                      (int)swAddControlOptions_e.swControlOptions_Visible;

            dotnet1 = (IPropertyManagerPageWindowFromHandle)group1.AddControl(DotNet1ID, controlType, ".Net Windows Form Control", align, options, "This Control is added without COM");
            dotnet1.Height = 150;

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

            dotnet2 = (IPropertyManagerPageWindowFromHandle)group2.AddControl(DotNet2ID, controlType, ".Net User Form Control", align, options, "This Control is added without COM");
            dotnet2.Height = 150;

            dotnet3 = (IPropertyManagerPageWindowFromHandle)group3.AddControl(DotNet3ID, controlType, ".Net WPF Control", align, options, "This Control is added without COM");
            dotnet3.Height = 50;


        }
Ejemplo n.º 8
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);
        }
Ejemplo n.º 9
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 the groups
            options = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded |
                      (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible;

            group1 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group1ID, "Sample Group 1", options);

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

            group2 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group2ID, "Sample Group 2", options);

            //Add the controls to group1

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

            textbox1 = (IPropertyManagerPageTextbox)group1.AddControl(textbox1ID, controlType, "Type Here", align, options, "This is an example textbox");

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

            checkbox1 = (IPropertyManagerPageCheckbox)group1.AddControl(checkbox1ID, controlType, "Sample Checkbox", align, options, "This is a sample checkbox");

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

            option1 = (IPropertyManagerPageOption)group1.AddControl(option1ID, controlType, "Option1", align, options, "Radio Buttons");

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

            option2 = (IPropertyManagerPageOption)group1.AddControl(option2ID, controlType, "Option2", align, options, "Radio Buttons");

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

            option3 = (IPropertyManagerPageOption)group1.AddControl(option3ID, controlType, "Option3", align, options, "Radio Buttons");

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

            list1 = (IPropertyManagerPageListbox)group1.AddControl(list1ID, controlType, "Sample Listbox", align, options, "List of selectable items");
            if (list1 != null)
            {
                string[] items = { "One Fish", "Two Fish", "Red Fish", "Blue Fish" };
                list1.Height = 50;
                list1.AddItems(items);
            }

            //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)group2.AddControl(selection1ID, controlType, "Sample Selection", align, options, "Displays features selected in main view");
            if (selection1 != null)
            {
                int[] filter = { (int)swSelectType_e.swSelEDGES, (int)swSelectType_e.swSelVERTICES };
                selection1.Height = 40;
                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)group2.AddControl(num1ID, controlType, "Sample Numberbox", align, options, "Allows for numerical input");
            if (num1 != null)
            {
                num1.Value = 50.0;
                num1.SetRange((int)swNumberboxUnitType_e.swNumberBox_UnitlessDouble, 0.0, 100.0, 0.01, true);
            }

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

            combo1 = (IPropertyManagerPageCombobox)group2.AddControl(combo1ID, controlType, "Sample Combobox", align, options, "Combo list");
            if (combo1 != null)
            {
                string[] items = { "One Fish", "Two Fish", "Red Fish", "Blue Fish" };
                combo1.AddItems(items);
                combo1.Height = 50;
            }
        }
Ejemplo n.º 10
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 the groups
            options = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded |
                      (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible;

            group1 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group1ID, "Sample Group 1", options);

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

            group2 = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(group2ID, "Sample Group 2", options);

            //Add the controls to group1

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

            textbox1 = (IPropertyManagerPageTextbox)group1.AddControl(textbox1ID, controlType, "Type Here", align, options, "This is an example textbox");

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

            checkbox1 = (IPropertyManagerPageCheckbox)group1.AddControl(checkbox1ID, controlType, "Sample Checkbox", align, options, "This is a sample checkbox");

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

            option1 = (IPropertyManagerPageOption)group1.AddControl(option1ID, controlType, "Option1", align, options, "Radio Buttons");

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

            option2 = (IPropertyManagerPageOption)group1.AddControl(option2ID, controlType, "Option2", align, options, "Radio Buttons");

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

            option3 = (IPropertyManagerPageOption)group1.AddControl(option3ID, controlType, "Option3", align, options, "Radio Buttons");

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

            list1 = (IPropertyManagerPageListbox)group1.AddControl(list1ID, controlType, "Sample Listbox", align, options, "List of selectable items");
            if (list1 != null)
            {
                string[] items = { "One Fish", "Two Fish", "Red Fish", "Blue Fish" };
                list1.Height = 50;
                list1.AddItems(items);
            }

            //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)group2.AddControl(selection1ID, controlType, "Sample Selection", align, options, "Displays features selected in main view");
            if (selection1 != null)
            {
                int[] filter = { (int)swSelectType_e.swSelEDGES, (int)swSelectType_e.swSelVERTICES };
                selection1.Height = 40;
                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)group2.AddControl(num1ID, controlType, "Sample Numberbox", align, options, "Allows for numerical input");
            if (num1 != null)
            {
                num1.Value = 50.0;
                num1.SetRange((int)swNumberboxUnitType_e.swNumberBox_UnitlessDouble, 0.0, 100.0, 0.01, true);
            }

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

            combo1 = (IPropertyManagerPageCombobox)group2.AddControl(combo1ID, controlType, "Sample Combobox", align, options, "Combo list");
            if (combo1 != null)
            {
                string[] items = { "One Fish", "Two Fish", "Red Fish", "Blue Fish" };
                combo1.AddItems(items);
                combo1.Height = 50;

            }
        }
Ejemplo n.º 11
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;
            bool  retval;

            //Add Message
            retval = swPropertyPage.SetMessage3("This is a sample message, marked yellow to signify importance.",
                                                (int)swPropertyManagerPageMessageVisibility.swImportantMessageBox,
                                                (int)swPropertyManagerPageMessageExpanded.swMessageBoxExpand,
                                                "Sample Important Caption");

            // Add PropertyManager Page Tabs
            ppagetab1 = swPropertyPage.AddTab(tabID1, "Page Tab 1", "", 0);
            ppagetab2 = swPropertyPage.AddTab(tabID2, "Page Tab 2", "", 0);

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

            group1 = (IPropertyManagerPageGroup)ppagetab1.AddGroupBox(group1ID, "Sample Group 1", options);

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

            group2 = (IPropertyManagerPageGroup)ppagetab1.AddGroupBox(group2ID, "Sample Group 2", options);

            //Add the controls to group1

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

            textbox1 = (IPropertyManagerPageTextbox)group1.AddControl(textbox1ID, controlType, "Type Here", align, options, "This is an example textbox");

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

            checkbox1 = (IPropertyManagerPageCheckbox)group1.AddControl(checkbox1ID, controlType, "Sample Checkbox", align, options, "This is a sample checkbox");

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

            option1 = (IPropertyManagerPageOption)group1.AddControl(option1ID, controlType, "Option1", align, options, "Radio Buttons");

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

            option2 = (IPropertyManagerPageOption)group1.AddControl(option2ID, controlType, "Option2", align, options, "Radio Buttons");

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

            option3 = (IPropertyManagerPageOption)group1.AddControl(option3ID, controlType, "Option3", align, options, "Radio Buttons");

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

            list1 = (IPropertyManagerPageListbox)group1.AddControl(list1ID, controlType, "Sample Listbox", align, options, "List of selectable items");
            if (list1 != null)
            {
                string[] items = { "One Fish", "Two Fish", "Red Fish", "Blue Fish" };
                list1.Height = 50;
                list1.AddItems(items);
            }

            //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)group2.AddControl(selection1ID, controlType, "Sample Selection", align, options, "Displays features selected in main view");
            if (selection1 != null)
            {
                int[] filter = { (int)swSelectType_e.swSelEDGES, (int)swSelectType_e.swSelVERTICES };
                selection1.Height = 40;
                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)group2.AddControl(num1ID, controlType, "Sample Numberbox", align, options, "Allows for numerical input");
            if (num1 != null)
            {
                num1.Value = 50.0;
                num1.SetRange((int)swNumberboxUnitType_e.swNumberBox_UnitlessDouble, 0.0, 100.0, 0.01, true);
            }

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

            combo1 = (IPropertyManagerPageCombobox)group2.AddControl(combo1ID, controlType, "Sample Combobox", align, options, "Combo list");
            if (combo1 != null)
            {
                string[] items = { "One Fish", "Two Fish", "Red Fish", "Blue Fish" };
                combo1.AddItems(items);
                combo1.Height = 50;
            }

            // Button
            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.AddControl2(buttonID1, controlType, "Hide", align, options, "Change the visibility of the control");

            // Textbox2
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Textbox;
            align       = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            options     = (int)swAddControlOptions_e.swControlOptions_Enabled |
                          (int)swAddControlOptions_e.swControlOptions_Visible;

            textbox2 = (IPropertyManagerPageTextbox)group2.AddControl2(textbox2ID, controlType, "Sample Textbox", align, options, "Sample Textbox text");

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

            button2 = (IPropertyManagerPageButton)group2.AddControl2(buttonID2, controlType, "Disable", align, options, "Disable the control");

            // Textbox3
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Textbox;
            align       = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent;
            options     = (int)swAddControlOptions_e.swControlOptions_Enabled |
                          (int)swAddControlOptions_e.swControlOptions_Visible;

            textbox3 = (IPropertyManagerPageTextbox)group2.AddControl2(textbox3ID, controlType, "Another sample Textbox", align, options, "Second Sample Textbox text");
        }
Ejemplo n.º 12
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 the groups
            options = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded |
                      (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible;

            this.SavePDFGroup = (IPropertyManagerPageGroup)this.swPropertyPage.AddGroupBox(group1ID, "Save PDF", options);

            // Add the controls to group1

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

            this.LocationTextbox = (IPropertyManagerPageTextbox)this.SavePDFGroup.AddControl(LocationTextboxId, controlType, "PDF Location", align, options, "The File location where the PDFs will be saved to.");

            // Rev Checkbox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Checkbox;
            align       = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options     = (int)swAddControlOptions_e.swControlOptions_Enabled |
                          (int)swAddControlOptions_e.swControlOptions_Visible;

            this.revisionCheckbox = (IPropertyManagerPageCheckbox)this.SavePDFGroup.AddControl(RevisionCheckboxId, controlType, "Append Revision", align, options, "Append the Revision to the filename");

            // Description Checkbox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Checkbox;
            align       = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options     = (int)swAddControlOptions_e.swControlOptions_Enabled |
                          (int)swAddControlOptions_e.swControlOptions_Visible;

            this.descriptionCheckbox = (IPropertyManagerPageCheckbox)this.SavePDFGroup.AddControl(DescriptionCheckboxId, controlType, "Append Description", align, options, "Append the Description to the filename");

            // Show Checkbox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Checkbox;
            align       = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options     = (int)swAddControlOptions_e.swControlOptions_Enabled |
                          (int)swAddControlOptions_e.swControlOptions_Visible;

            this.showCheckbox = (IPropertyManagerPageCheckbox)SavePDFGroup.AddControl(ShowCheckboxId, controlType, "Show PDF", align, options, "Show the PDF after saving");

            // Remove Previous Checkbox
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Checkbox;
            align       = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options     = (int)swAddControlOptions_e.swControlOptions_Enabled |
                          (int)swAddControlOptions_e.swControlOptions_Visible;

            this.removePrevCheckbox = (IPropertyManagerPageCheckbox)SavePDFGroup.AddControl(RemovePreviousCheckboxId, controlType, "Remove Previous", align, options, "Remove the Previous versions of the pdf");

            // On Close Checkbox
            //controlType = (int)swPropertyManagerPageControlType_e.swControlType_Checkbox;
            //align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            //options = (int)swAddControlOptions_e.swControlOptions_Enabled |
            //          (int)swAddControlOptions_e.swControlOptions_Visible;

            //this.ocCloseCheckbox = (IPropertyManagerPageCheckbox)this.SavePDFGroup.AddControl(OnCloseCheckboxId, controlType, "Save on Close", align, options, "Save the PDF on close");
        }
Ejemplo n.º 13
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 the groups
            options = (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded |
                      (int)swAddGroupBoxOptions_e.swGroupBoxOptions_Visible;

            groupDimensions = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(groupDimensionsID, Lang.DIMENSIONS, options);
            groupObjects = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(groupObjectsID, Lang.POINTS, options);
            groupEvents = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(groupEventsID, Lang.EVENTS, options);
            groupOptions = (IPropertyManagerPageGroup)swPropertyPage.AddGroupBox(groupOptionsID, Lang.OPTIONS, options);

            //Selection of dimensions
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Selectionbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                (int)swAddControlOptions_e.swControlOptions_Visible;

            selectionDimensions = (IPropertyManagerPageSelectionbox)groupDimensions.AddControl(selectionDimensionsID, controlType, Lang.RECORD_DIMENSIONS, align, options, Lang.RECORD_DIMENSIONS_HINT);
            if (selectionDimensions != null)
            {
                selectionDimensions.Height = 40;
                selectionDimensions.SetSelectionFilters(Target.dimensionFilters);
            }

            //Selection of objects
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Selectionbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                (int)swAddControlOptions_e.swControlOptions_Visible;

            selectionObjects = (IPropertyManagerPageSelectionbox)groupObjects.AddControl(selectionObjectsID, controlType, Lang.RECORD_POSITIONS, align, options, Lang.RECORD_POSITIONS_HINT);
            if (selectionObjects != null)
            {
                selectionObjects.Height = 40;
                selectionObjects.SetSelectionFilters(Target.objectFilters);
            }

            //Trace options
            traceDialog = null;
            traceDrag = null;
            traceSketch = null;
            traceRegen = null;

            // Trace drag events
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Checkbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
            (int)swAddControlOptions_e.swControlOptions_Visible;

            traceDrag = (IPropertyManagerPageCheckbox)groupEvents.AddControl(cb_idDrag, controlType, Lang.DRAG, align, options, Lang.DRAG_HINT);

            // Trace dimension change events
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Checkbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                (int)swAddControlOptions_e.swControlOptions_Visible;

            traceDialog = (IPropertyManagerPageCheckbox)groupEvents.AddControl(cb_idDialog, controlType, Lang.CHANGE_DIMENSION, align, options, Lang.CHANGE_DIMENSION_HINT);

            // Trace Sketch change events
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Checkbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                (int)swAddControlOptions_e.swControlOptions_Visible;

            traceSketch = (IPropertyManagerPageCheckbox)groupEvents.AddControl(cb_idSketch, controlType, Lang.SKETCH_SOLVE, align, options, Lang.SKETCH_SOLVE_HINT);

            // Regenerate events
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Checkbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
                (int)swAddControlOptions_e.swControlOptions_Visible;

            traceRegen = (IPropertyManagerPageCheckbox)groupEvents.AddControl(cb_idRegen, controlType, Lang.MODEL_REGENERATION, align, options, Lang.MODEL_REGENERATION_HINT);

            // Other Options
            // do not record double
            controlType = (int)swPropertyManagerPageControlType_e.swControlType_Checkbox;
            align = (int)swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge;
            options = (int)swAddControlOptions_e.swControlOptions_Enabled |
            (int)swAddControlOptions_e.swControlOptions_Visible;

            supprDouble = (IPropertyManagerPageCheckbox)groupOptions.AddControl(optionDropDoubleID, controlType, Lang.DROP_DOUBLE, align, options, Lang.DROP_DOUBLE_HINT);
        }