コード例 #1
0
        public Int32IncrementButtonPropertyControl(PropertyControlInfo propInfo)
            : base(propInfo)
        {
            SuspendLayout();

            this.header             = new HeaderLabel();
            this.header.Name        = "header";
            this.header.Text        = this.DisplayName;
            this.header.RightMargin = 0;

            this.incrementButton           = new Button();
            this.incrementButton.Name      = "incrementButton";
            this.incrementButton.AutoSize  = true;
            this.incrementButton.FlatStyle = FlatStyle.System;
            this.incrementButton.Text      = (string)propInfo.ControlProperties[ControlInfoPropertyNames.ButtonText].Value;
            this.incrementButton.Click    += new EventHandler(IncrementButton_Click);

            this.descriptionText          = new Label();
            this.descriptionText.Name     = "descriptionText";
            this.descriptionText.AutoSize = false;
            this.descriptionText.Text     = this.Description;

            this.Controls.AddRange(
                new Control[]
            {
                this.header,
                this.incrementButton,
                this.descriptionText
            });

            ResumeLayout(false);
            PerformLayout();
        }
コード例 #2
0
 public StaticListRadioButtonPropertyControl(PropertyControlInfo propInfo) : base(propInfo)
 {
     base.SuspendLayout();
     this.header             = new HeadingLabel();
     this.header.Name        = "header";
     this.header.RightMargin = 0;
     this.header.Text        = base.DisplayName;
     object[] valueChoices = base.Property.ValueChoices;
     this.radioButtons = new PdnRadioButton[valueChoices.Length];
     for (int i = 0; i < this.radioButtons.Length; i++)
     {
         this.radioButtons[i]                   = new PdnRadioButton();
         this.radioButtons[i].Name              = "radioButton" + i.ToString(CultureInfo.InvariantCulture);
         this.radioButtons[i].IsCheckedChanged += new EventHandler(this.OnRadioButtonCheckedChanged);
         string valueDisplayName = propInfo.GetValueDisplayName(valueChoices[i]);
         this.radioButtons[i].Text = valueDisplayName;
     }
     this.descriptionText          = new PdnLabel();
     this.descriptionText.Name     = "descriptionText";
     this.descriptionText.AutoSize = false;
     this.descriptionText.Text     = base.Description;
     base.Controls.Add(this.header);
     base.Controls.AddRange(this.radioButtons);
     base.Controls.Add(this.descriptionText);
     base.ResumeLayout(false);
     base.PerformLayout();
 }
コード例 #3
0
 private PropertyControlInfo(PropertyControlInfo cloneMe)
     : base(cloneMe)
 {
     this.property          = cloneMe.property;
     this.controlType       = (StaticListChoiceProperty)cloneMe.controlType.Clone();
     this.valueDisplayNames = new Dictionary <object, string>(cloneMe.valueDisplayNames);
 }
コード例 #4
0
        public BooleanCheckBoxPropertyControl(PropertyControlInfo propInfo)
            : base(propInfo)
        {
            SuspendLayout();

            this.header             = new HeaderLabel();
            this.header.Name        = "header";
            this.header.RightMargin = 0;
            this.header.Text        = this.DisplayName;

            this.checkBox                 = new CheckBox();
            this.checkBox.Name            = "checkBox";
            this.checkBox.CheckedChanged += new EventHandler(CheckBox_CheckedChanged);
            this.checkBox.FlatStyle       = FlatStyle.System;
            this.checkBox.Text            = string.IsNullOrEmpty(this.Description) ? this.DisplayName : this.Description;

            this.Controls.AddRange(
                new Control[]
            {
                this.header,
                this.checkBox
            });

            ResumeLayout(false);
        }
コード例 #5
0
        public AngleChooserPropertyControl(PropertyControlInfo propInfo) : base(propInfo)
        {
            AngleChooserPhase offsetByPi;
            DoubleProperty    property = (DoubleProperty)propInfo.Property;

            if ((property.MaxValue - property.MinValue) > 360.0)
            {
                throw new ArgumentException($"The difference between the property's minimum and maximum values cannot exceed 360.0. (Property.MinValue={property.MinValue}, Property.MaxValue={property.MaxValue}, Delta={property.MaxValue - property.MinValue})");
            }
            double minValue = property.MinValue;
            double maxValue = property.MaxValue;

            if ((property.MinValue >= -180.0) && (property.MaxValue <= 180.0))
            {
                offsetByPi = AngleChooserPhase.OffsetByPi;
            }
            else
            {
                if ((property.MinValue < 0.0) || (property.MaxValue > 360.0))
                {
                    throw new ArgumentException($"The property minimum and maximum values must either fall into the range [-180, +180] or [0, +360]. (Property.MinValue={property.MinValue}, Property.MaxValue={property.MaxValue})");
                }
                offsetByPi = AngleChooserPhase.Regular;
            }
            this.header                     = new HeadingLabel();
            this.header.Name                = "header";
            this.header.RightMargin         = 0;
            this.header.Text                = base.DisplayName;
            this.angleChooser               = new AngleChooser();
            this.angleChooser.Name          = "angleChooser";
            this.angleChooser.Phase         = offsetByPi;
            this.angleChooser.MinValue      = minValue;
            this.angleChooser.MaxValue      = maxValue;
            this.angleChooser.ValueChanged += new EventHandler(this.OnAngleChooserValueChanged);
            this.valueNud                   = new PdnNumericUpDown();
            this.valueNud.Name              = "numericUpDown";
            this.valueNud.Minimum           = (decimal)base.Property.MinValue;
            this.valueNud.Maximum           = (decimal)base.Property.MaxValue;
            this.valueNud.DecimalPlaces     = (int)propInfo.ControlProperties[ControlInfoPropertyNames.DecimalPlaces].Value;
            this.valueNud.ValueChanged     += new EventHandler(this.OnValueNudValueChanged);
            this.valueNud.TextAlign         = HorizontalAlignment.Right;
            if ((maxValue - minValue) == 360.0)
            {
                this.valueNud.RangeWraps = true;
            }
            this.resetButton         = new PdnPushButton();
            this.resetButton.Name    = "resetButton";
            this.resetButton.Click  += new EventHandler(this.OnResetButtonClick);
            this.resetButton.Image   = PdnResources.GetImageResource("Icons.ResetIcon.png").Reference;
            this.resetButton.Visible = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.ShowResetButton].Value;
            base.ToolTip.SetToolTip(this.resetButton, PdnResources.GetString("Form.ResetButton.Text").Replace("&", ""));
            this.description          = new PdnLabel();
            this.description.Name     = "descriptionText";
            this.description.AutoSize = false;
            this.description.Text     = base.Description;
            base.SuspendLayout();
            Control[] controls = new Control[] { this.header, this.angleChooser, this.valueNud, this.resetButton, this.description };
            base.Controls.AddRange(controls);
            base.ResumeLayout(false);
        }
コード例 #6
0
        public StringTextBoxPropertyControl(PropertyControlInfo propInfo)
            : base(propInfo)
        {
            SuspendLayout();

            this.header      = new HeaderLabel();
            this.textBox     = new TextBox();
            this.description = new Label();

            this.header.Name        = "header";
            this.header.Text        = DisplayName;
            this.header.RightMargin = 0;

            this.description.Name = "description";
            this.description.Text = this.Description;

            this.textBox.Name         = "textBox";
            this.textBox.TextChanged += new EventHandler(TextBox_TextChanged);
            this.textBox.MaxLength    = Property.MaxLength;
            this.baseTextBoxHeight    = this.textBox.Height;
            this.Multiline            = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.Multiline].Value;

            this.Controls.AddRange(
                new Control[]
            {
                this.header,
                this.textBox,
                this.description
            });

            ResumeLayout(false);
        }
コード例 #7
0
 public StaticListDropDownPropertyControl(PropertyControlInfo propInfo) : base(propInfo)
 {
     base.SuspendLayout();
     this.header                         = new HeadingLabel();
     this.header.Name                    = "header";
     this.header.RightMargin             = 0;
     this.header.Text                    = base.DisplayName;
     this.comboBox                       = new PdnDropDownList();
     this.comboBox.Name                  = "comboBox";
     this.comboBox.SelectedIndexChanged += new EventHandler(this.OnComboBoxSelectedIndexChanged);
     this.comboBox.BeginUpdate();
     foreach (object obj2 in base.Property.ValueChoices)
     {
         string valueDisplayName = propInfo.GetValueDisplayName(obj2);
         this.comboBox.Items.Add(valueDisplayName);
     }
     this.comboBox.EndUpdate();
     this.descriptionText          = new PdnLabel();
     this.descriptionText.Name     = "descriptionText";
     this.descriptionText.AutoSize = false;
     this.descriptionText.Text     = base.Description;
     Control[] controls = new Control[] { this.header, this.comboBox, this.descriptionText };
     base.Controls.AddRange(controls);
     base.ResumeLayout(false);
     base.PerformLayout();
 }
コード例 #8
0
 internal PropertyControl(PropertyControlInfo propInfo)
 {
     this.Property = propInfo.Property;
     this.Property.ValueChanged    += new EventHandler(Property_ValueChanged);
     this.Property.ReadOnlyChanged += new EventHandler(Property_ReadOnlyChanged);
     this.displayName = (string)propInfo.ControlProperties[ControlInfoPropertyNames.DisplayName].Value;
     this.description = (string)propInfo.ControlProperties[ControlInfoPropertyNames.Description].Value;
 }
コード例 #9
0
 public Int32SliderPropertyControl(PropertyControlInfo propInfo)
     : base(propInfo)
 {
     SuspendLayout();
     SliderSmallChange = (int)propInfo.ControlProperties[ControlInfoPropertyNames.SliderSmallChange].Value;
     SliderLargeChange = (int)propInfo.ControlProperties[ControlInfoPropertyNames.SliderLargeChange].Value;
     UpDownIncrement   = (int)propInfo.ControlProperties[ControlInfoPropertyNames.UpDownIncrement].Value;
     ResumeLayout(false);
 }
コード例 #10
0
 public Int32SliderPropertyControl(PropertyControlInfo propInfo) : base(propInfo)
 {
     base.SuspendLayout();
     this.SliderSmallChange = (int)propInfo.ControlProperties[ControlInfoPropertyNames.SliderSmallChange].Value;
     this.SliderLargeChange = (int)propInfo.ControlProperties[ControlInfoPropertyNames.SliderLargeChange].Value;
     this.UpDownIncrement   = (int)propInfo.ControlProperties[ControlInfoPropertyNames.UpDownIncrement].Value;
     base.SetSliderDefaultValue(base.Property.DefaultValue);
     base.ResumeLayout(false);
 }
コード例 #11
0
        public AngleChooserPropertyControl(PropertyControlInfo propInfo)
            : base(propInfo)
        {
            DoubleProperty doubleProp = (DoubleProperty)propInfo.Property;

            if (!((doubleProp.MinValue == -180 && doubleProp.MaxValue == +180) ||
                  (doubleProp.MinValue == 0 && doubleProp.MaxValue == 360)))
            {
                throw new ArgumentException("Only two min/max ranges are allowed for the AngleChooser control type: [-180, +180] and [0, 360]");
            }

            this.header             = new HeaderLabel();
            this.header.Name        = "header";
            this.header.RightMargin = 0;
            this.header.Text        = this.DisplayName;

            this.angleChooser               = new AngleChooserControl();
            this.angleChooser.Name          = "angleChooser";
            this.angleChooser.ValueChanged += new EventHandler(AngleChooser_ValueChanged);

            this.valueNud               = new NumericUpDown();
            this.valueNud.Name          = "numericUpDown";
            this.valueNud.Minimum       = (decimal)Property.MinValue;
            this.valueNud.Maximum       = (decimal)Property.MaxValue;
            this.valueNud.DecimalPlaces = 2;
            this.valueNud.ValueChanged += new EventHandler(ValueNud_ValueChanged);
            this.valueNud.TextAlign     = HorizontalAlignment.Right;

            this.resetButton           = new Button();
            this.resetButton.Name      = "resetButton";
            this.resetButton.FlatStyle = FlatStyle.Standard;
            this.resetButton.Click    += new EventHandler(ResetButton_Click);
            this.resetButton.Image     = PdnResources.GetImageResource("Icons.ResetIcon.png").Reference;
            this.resetButton.Visible   = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.ShowResetButton].Value;
            this.ToolTip.SetToolTip(this.resetButton, PdnResources.GetString("Form.ResetButton.Text").Replace("&", ""));

            this.description          = new Label();
            this.description.Name     = "descriptionText";
            this.description.AutoSize = false;
            this.description.Text     = this.Description;

            SuspendLayout();

            this.Controls.AddRange(
                new Control[]
            {
                this.header,
                this.angleChooser,
                this.valueNud,
                this.resetButton,
                this.description
            });

            ResumeLayout(false);
            PerformLayout();
        }
コード例 #12
0
 public DoubleSliderPropertyControl(PropertyControlInfo propInfo) : base(propInfo)
 {
     base.SuspendLayout();
     this.DecimalPlaces       = (int)propInfo.ControlProperties[ControlInfoPropertyNames.DecimalPlaces].Value;
     this.UseExponentialScale = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.UseExponentialScale].Value;
     this.SliderSmallChange   = (double)propInfo.ControlProperties[ControlInfoPropertyNames.SliderSmallChange].Value;
     this.SliderLargeChange   = (double)propInfo.ControlProperties[ControlInfoPropertyNames.SliderLargeChange].Value;
     this.UpDownIncrement     = (double)propInfo.ControlProperties[ControlInfoPropertyNames.UpDownIncrement].Value;
     base.SetSliderDefaultValue(base.Property.DefaultValue);
     base.ResumeLayout(false);
 }
コード例 #13
0
 public VectorSliderPropertyControl(PropertyControlInfo propInfo) : base(propInfo)
 {
     this.decimalPlaces = 2;
     base.SuspendLayout();
     this.header                       = new HeadingLabel();
     this.sliderX                      = new PdnTrackBar();
     this.numericUpDownX               = new PdnNumericUpDown();
     this.resetButtonX                 = new PdnPushButton();
     this.sliderY                      = new PdnTrackBar();
     this.numericUpDownY               = new PdnNumericUpDown();
     this.resetButtonY                 = new PdnPushButton();
     this.descriptionText              = new PdnLabel();
     this.header.Name                  = "header";
     this.header.RightMargin           = 0;
     this.header.Text                  = base.DisplayName;
     this.sliderX.Name                 = "sliderX";
     this.sliderX.AutoSize             = false;
     this.sliderX.ValueChanged        += new EventHandler(this.OnSliderXValueChanged);
     this.SliderShowTickMarksX         = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.SliderShowTickMarksX].Value;
     this.sliderX.ResetRequested      += new EventHandler(this.OnResetButtonXClick);
     this.numericUpDownX.Name          = "numericUpDownX";
     this.numericUpDownX.ValueChanged += new EventHandler(this.OnNumericUpDownXValueChanged);
     this.numericUpDownX.TextAlign     = HorizontalAlignment.Right;
     this.resetButtonX.Name            = "resetButtonX";
     this.resetButtonX.AutoSize        = false;
     this.resetButtonX.Click          += new EventHandler(this.OnResetButtonXClick);
     this.resetButtonX.Image           = PdnResources.GetImageResource("Icons.ResetIcon.png").Reference;
     this.resetButtonX.Visible         = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.ShowResetButton].Value;
     base.ToolTip.SetToolTip(this.resetButtonX, PdnResources.GetString("Form.ResetButton.Text").Replace("&", ""));
     this.sliderY.Name                 = "sliderY";
     this.sliderY.AutoSize             = false;
     this.sliderY.ValueChanged        += new EventHandler(this.OnSliderYValueChanged);
     this.SliderShowTickMarksY         = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.SliderShowTickMarksY].Value;
     this.sliderY.ResetRequested      += new EventHandler(this.OnResetButtonYClick);
     this.numericUpDownY.Name          = "numericUpDownY";
     this.numericUpDownY.ValueChanged += new EventHandler(this.OnNumericUpDownYValueChanged);
     this.numericUpDownY.TextAlign     = HorizontalAlignment.Right;
     this.resetButtonY.Name            = "resetButtonY";
     this.resetButtonY.AutoSize        = false;
     this.resetButtonY.Click          += new EventHandler(this.OnResetButtonYClick);
     this.resetButtonY.Image           = PdnResources.GetImageResource("Icons.ResetIcon.png").Reference;
     this.resetButtonY.Visible         = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.ShowResetButton].Value;
     base.ToolTip.SetToolTip(this.resetButtonY, PdnResources.GetString("Form.ResetButton.Text").Replace("&", ""));
     this.descriptionText.Name     = "descriptionText";
     this.descriptionText.AutoSize = false;
     this.descriptionText.Text     = base.Description;
     this.ValidateUIRanges();
     this.ResetUIRanges();
     Control[] controls = new Control[] { this.header, this.sliderX, this.numericUpDownX, this.resetButtonX, this.sliderY, this.numericUpDownY, this.resetButtonY, this.descriptionText };
     base.Controls.AddRange(controls);
     base.ResumeLayout(false);
 }
コード例 #14
0
 public DoubleVectorSliderPropertyControl(PropertyControlInfo propInfo)
     : base(propInfo)
 {
     DecimalPlaces       = (int)propInfo.ControlProperties[ControlInfoPropertyNames.DecimalPlaces].Value;
     SliderSmallChangeX  = (double)propInfo.ControlProperties[ControlInfoPropertyNames.SliderSmallChangeX].Value;
     SliderLargeChangeX  = (double)propInfo.ControlProperties[ControlInfoPropertyNames.SliderLargeChangeX].Value;
     UpDownIncrementX    = (double)propInfo.ControlProperties[ControlInfoPropertyNames.UpDownIncrementX].Value;
     SliderSmallChangeY  = (double)propInfo.ControlProperties[ControlInfoPropertyNames.SliderSmallChangeY].Value;
     SliderLargeChangeY  = (double)propInfo.ControlProperties[ControlInfoPropertyNames.SliderLargeChangeY].Value;
     UpDownIncrementY    = (double)propInfo.ControlProperties[ControlInfoPropertyNames.UpDownIncrementY].Value;
     UseExponentialScale = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.UseExponentialScale].Value;
     ResetUIRanges();
 }
コード例 #15
0
 public DoubleVectorSliderPropertyControl(PropertyControlInfo propInfo) : base(propInfo)
 {
     this.DecimalPlaces       = (int)propInfo.ControlProperties[ControlInfoPropertyNames.DecimalPlaces].Value;
     this.SliderSmallChangeX  = (double)propInfo.ControlProperties[ControlInfoPropertyNames.SliderSmallChangeX].Value;
     this.SliderLargeChangeX  = (double)propInfo.ControlProperties[ControlInfoPropertyNames.SliderLargeChangeX].Value;
     this.UpDownIncrementX    = (double)propInfo.ControlProperties[ControlInfoPropertyNames.UpDownIncrementX].Value;
     this.SliderSmallChangeY  = (double)propInfo.ControlProperties[ControlInfoPropertyNames.SliderSmallChangeY].Value;
     this.SliderLargeChangeY  = (double)propInfo.ControlProperties[ControlInfoPropertyNames.SliderLargeChangeY].Value;
     this.UpDownIncrementY    = (double)propInfo.ControlProperties[ControlInfoPropertyNames.UpDownIncrementY].Value;
     this.UseExponentialScale = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.UseExponentialScale].Value;
     base.SetSliderDefaultValueX(base.Property.DefaultValueX);
     base.SetSliderDefaultValueY(base.Property.DefaultValueY);
     base.ResetUIRanges();
 }
コード例 #16
0
        public bool SetPropertyControlType(object propertyName, PropertyControlType newControlType)
        {
            PropertyControlInfo pci = FindControlForPropertyName(propertyName);

            if (pci == null)
            {
                return(false);
            }

            if (-1 == Array.IndexOf(pci.ControlType.ValueChoices, newControlType))
            {
                return(false);
            }

            pci.ControlType.Value = newControlType;
            return(true);
        }
コード例 #17
0
        public bool SetPropertyControlValue(object propertyName, object controlPropertyName, object propertyValue)
        {
            PropertyControlInfo pci = FindControlForPropertyName(propertyName);

            if (pci == null)
            {
                return(false);
            }

            Property prop = pci.ControlProperties[controlPropertyName];

            if (prop == null)
            {
                return(false);
            }

            prop.Value = propertyValue;
            return(true);
        }
コード例 #18
0
 public BooleanCheckBoxPropertyControl(PropertyControlInfo propInfo) : base(propInfo)
 {
     base.SuspendLayout();
     this.header                     = new HeadingLabel();
     this.header.Name                = "header";
     this.header.RightMargin         = 0;
     this.header.Text                = base.DisplayName;
     this.checkBox                   = new PdnCheckBox();
     this.checkBox.Name              = "checkBox";
     this.checkBox.IsCheckedChanged += new EventHandler(this.OnCheckBoxCheckedChanged);
     this.checkBox.Text              = string.IsNullOrEmpty(base.Description) ? base.DisplayName : base.Description;
     this.footnoteLabel              = new PdnLabel();
     this.footnoteLabel.Name         = "footnoteLabel";
     this.footnoteLabel.AutoSize     = false;
     this.footnoteLabel.Text         = (string)propInfo.ControlProperties[ControlInfoPropertyNames.Footnote].Value;
     Control[] controls = new Control[] { this.header, this.checkBox, this.footnoteLabel };
     base.Controls.AddRange(controls);
     base.ResumeLayout(false);
 }
コード例 #19
0
 public SliderPropertyControl(PropertyControlInfo propInfo) : base(propInfo)
 {
     this.header          = new HeadingLabel();
     this.slider          = new PdnTrackBar();
     this.numericUpDown   = new PdnNumericUpDown();
     this.resetButton     = new PdnPushButton();
     this.descriptionText = new PdnLabel();
     this.slider.BeginInit();
     base.SuspendLayout();
     this.header.Name                 = "header";
     this.header.RightMargin          = 0;
     this.header.Text                 = base.DisplayName;
     this.numericUpDown.DecimalPlaces = 0;
     this.numericUpDown.Name          = "numericUpDown";
     this.numericUpDown.TextAlign     = HorizontalAlignment.Right;
     this.numericUpDown.TabIndex      = 1;
     this.RangeWraps             = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.RangeWraps].Value;
     this.slider.Name            = "slider";
     this.slider.AutoSize        = false;
     this.slider.TabIndex        = 0;
     this.SliderShowTickMarks    = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.SliderShowTickMarks].Value;
     this.ControlStyle           = (int)propInfo.ControlProperties[ControlInfoPropertyNames.ControlStyle].Value;
     this.ControlColors          = propInfo.ControlProperties[ControlInfoPropertyNames.ControlColors].Value;
     this.slider.ResetRequested += new EventHandler(this.OnResetButtonClick);
     this.resetButton.AutoSize   = false;
     this.resetButton.Name       = "resetButton";
     this.resetButton.Click     += new EventHandler(this.OnResetButtonClick);
     this.resetButton.Image      = PdnResources.GetImageResource("Icons.ResetIcon.png").Reference;
     this.resetButton.TabIndex   = 2;
     this.resetButton.Visible    = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.ShowResetButton].Value;
     base.ToolTip.SetToolTip(this.resetButton, PdnResources.GetString("Form.ResetButton.Text").Replace("&", ""));
     this.descriptionText.Name     = "descriptionText";
     this.descriptionText.AutoSize = false;
     this.descriptionText.Text     = base.Description;
     this.ValidateUIRanges();
     this.ResetUIRanges();
     Control[] controls = new Control[] { this.header, this.slider, this.numericUpDown, this.resetButton, this.descriptionText };
     base.Controls.AddRange(controls);
     this.slider.EndInit();
     base.ResumeLayout(false);
     this.numericUpDown.ValueChanged += new EventHandler(this.OnNumericUpDownValueChanged);
     this.slider.ValueChanged        += new EventHandler(this.OnSliderValueChanged);
 }
コード例 #20
0
 public Int32IncrementButtonPropertyControl(PropertyControlInfo propInfo) : base(propInfo)
 {
     base.SuspendLayout();
     this.header                   = new HeadingLabel();
     this.header.Name              = "header";
     this.header.Text              = base.DisplayName;
     this.header.RightMargin       = 0;
     this.incrementButton          = new PdnPushButton();
     this.incrementButton.Name     = "incrementButton";
     this.incrementButton.AutoSize = true;
     this.incrementButton.Text     = (string)propInfo.ControlProperties[ControlInfoPropertyNames.ButtonText].Value;
     this.incrementButton.Click   += new EventHandler(this.OnIncrementButtonClick);
     this.descriptionText          = new PdnLabel();
     this.descriptionText.Name     = "descriptionText";
     this.descriptionText.AutoSize = false;
     this.descriptionText.Text     = base.Description;
     Control[] controls = new Control[] { this.header, this.incrementButton, this.descriptionText };
     base.Controls.AddRange(controls);
     base.ResumeLayout(false);
     base.PerformLayout();
 }
 public DoubleVector3RollBallAndSliderPropertyControl(PropertyControlInfo propInfo) : base(propInfo)
 {
     base.SuspendLayout();
     this.header                    = new HeadingLabel();
     this.header.Name               = "header";
     this.header.RightMargin        = 0;
     this.header.Text               = base.DisplayName;
     this.rollControl               = new RollControl();
     this.rollControl.Name          = "rollControl";
     this.rollControl.ValueChanged += new EventHandler(this.OnRollControlValueChanged);
     this.rollControl.Size          = new Size(1, 1);
     this.sliders                   = new DoubleVector3SliderPropertyControl(propInfo);
     this.sliders.Name              = "sliders";
     this.sliders.DisplayName       = "";
     this.sliders.Description       = "";
     this.textDescription           = new PdnLabel();
     this.textDescription.Name      = "textDescription";
     this.textDescription.Text      = base.Description;
     Control[] controls = new Control[] { this.header, this.rollControl, this.sliders, this.textDescription };
     base.Controls.AddRange(controls);
     base.ResumeLayout(false);
 }
コード例 #22
0
        public StaticListDropDownPropertyControl(PropertyControlInfo propInfo)
            : base(propInfo)
        {
            SuspendLayout();

            this.header             = new HeaderLabel();
            this.header.Name        = "header";
            this.header.RightMargin = 0;
            this.header.Text        = this.DisplayName;

            this.comboBox                       = new ComboBox();
            this.comboBox.Name                  = "comboBox";
            this.comboBox.FlatStyle             = FlatStyle.System;
            this.comboBox.SelectedIndexChanged += new EventHandler(ComboBox_SelectedIndexChanged);
            this.comboBox.DropDownStyle         = ComboBoxStyle.DropDownList;

            foreach (object choice in Property.ValueChoices)
            {
                string valueText = propInfo.GetValueDisplayName(choice);
                this.comboBox.Items.Add(valueText);
            }

            this.descriptionText          = new Label();
            this.descriptionText.Name     = "descriptionText";
            this.descriptionText.AutoSize = false;
            this.descriptionText.Text     = this.Description;

            this.Controls.AddRange(
                new Control[]
            {
                this.header,
                this.comboBox,
                this.descriptionText
            });

            ResumeLayout(false);
            PerformLayout();
        }
コード例 #23
0
        private static PropertyControlInfo FindControlForPropertyName(object propertyName, ControlInfo control)
        {
            PropertyControlInfo asPCI = control as PropertyControlInfo;

            if (asPCI != null && asPCI.Property.Name == propertyName.ToString())
            {
                return(asPCI);
            }
            else
            {
                foreach (ControlInfo childControl in control.GetChildControlsCore())
                {
                    PropertyControlInfo pci = FindControlForPropertyName(propertyName, childControl);

                    if (pci != null)
                    {
                        return(pci);
                    }
                }
            }

            return(null);
        }
コード例 #24
0
 public DoubleVectorPanAndSliderPropertyControl(PropertyControlInfo propInfo) : base(propInfo)
 {
     base.SuspendLayout();
     this.header                         = new HeadingLabel();
     this.header.Name                    = "header";
     this.header.RightMargin             = 0;
     this.header.Text                    = base.DisplayName;
     this.panControl                     = new PanControl();
     this.panControl.Name                = "panControl";
     this.panControl.StaticImageUnderlay = (ImageResource)propInfo.ControlProperties[ControlInfoPropertyNames.StaticImageUnderlay].Value;
     this.panControl.PositionChanged    += new EventHandler(this.OnPanControlPositionChanged);
     this.panControl.Size                = new Size(1, 1);
     this.sliders                        = new DoubleVectorSliderPropertyControl(propInfo);
     this.sliders.Name                   = "sliders";
     this.sliders.DisplayName            = "";
     this.sliders.Description            = "";
     this.textDescription                = new PdnLabel();
     this.textDescription.Name           = "textDescription";
     this.textDescription.Text           = base.Description;
     Control[] controls = new Control[] { this.header, this.panControl, this.sliders, this.textDescription };
     base.Controls.AddRange(controls);
     base.ResumeLayout(false);
 }
コード例 #25
0
        public StaticListRadioButtonPropertyControl(PropertyControlInfo propInfo)
            : base(propInfo)
        {
            SuspendLayout();

            this.header             = new HeaderLabel();
            this.header.Name        = "header";
            this.header.RightMargin = 0;
            this.header.Text        = this.DisplayName;

            object[] valueChoices = Property.ValueChoices; // cache this to avoid making N copies
            this.radioButtons = new RadioButton[valueChoices.Length];

            for (int i = 0; i < this.radioButtons.Length; ++i)
            {
                this.radioButtons[i]                 = new RadioButton();
                this.radioButtons[i].Name            = "radioButton" + i.ToString(CultureInfo.InvariantCulture);
                this.radioButtons[i].FlatStyle       = FlatStyle.System;
                this.radioButtons[i].CheckedChanged += new EventHandler(RadioButton_CheckedChanged);

                string valueText = propInfo.GetValueDisplayName(valueChoices[i]);
                this.radioButtons[i].Text = valueText;
            }

            this.descriptionText          = new Label();
            this.descriptionText.Name     = "descriptionText";
            this.descriptionText.AutoSize = false;
            this.descriptionText.Text     = this.Description;

            this.Controls.Add(this.header);
            this.Controls.AddRange(this.radioButtons);
            this.Controls.Add(this.descriptionText);

            ResumeLayout(false);
            PerformLayout();
        }
コード例 #26
0
        public Int32ColorWheelPropertyControl(PropertyControlInfo propInfo)
            : base(propInfo)
        {
            if (Property.MinValue != requiredMin || Property.MaxValue != requiredMax)
            {
                throw new ArgumentException("The only range allowed for this control is [" + requiredMin + ", " + requiredMax + "]");
            }

            SuspendLayout();

            this.header             = new HeaderLabel();
            this.header.Name        = "header";
            this.header.RightMargin = 0;
            this.header.Text        = this.DisplayName;

            this.colorRectangle          = new ColorRectangleControl();
            this.colorRectangle.Name     = "colorRectangle";
            this.colorRectangle.TabStop  = false;
            this.colorRectangle.TabIndex = 0;

            this.hsvColorWheel               = new ColorWheel();
            this.hsvColorWheel.Name          = "hsvColorWheel";
            this.hsvColorWheel.ColorChanged += new EventHandler(HsvColorWheel_ColorChanged);
            this.hsvColorWheel.TabStop       = false;
            this.hsvColorWheel.TabIndex      = 1;

            this.saturationSlider               = new ColorGradientControl();
            this.saturationSlider.Name          = "saturationSlider";
            this.saturationSlider.Orientation   = Orientation.Vertical;
            this.saturationSlider.ValueChanged += new IndexEventHandler(SaturationSlider_ValueChanged);
            this.saturationSlider.TabStop       = false;
            this.saturationSlider.TabIndex      = 2;

            this.valueSlider               = new ColorGradientControl();
            this.valueSlider.Name          = "valueSlider";
            this.valueSlider.Orientation   = Orientation.Vertical;
            this.valueSlider.ValueChanged += new IndexEventHandler(ValueSlider_ValueChanged);
            this.valueSlider.TabStop       = false;
            this.valueSlider.TabIndex      = 3;

            this.redLabel          = new Label();
            this.redLabel.Name     = "redLabel";
            this.redLabel.AutoSize = true;
            this.redLabel.Text     = PdnResources.GetString("ColorsForm.RedLabel.Text");

            this.redNud               = new PdnNumericUpDown();
            this.redNud.Name          = "redNud";
            this.redNud.Minimum       = 0;
            this.redNud.Maximum       = 255;
            this.redNud.TextAlign     = HorizontalAlignment.Right;
            this.redNud.ValueChanged += new EventHandler(RedNud_ValueChanged);
            this.redNud.TabIndex      = 4;

            this.greenLabel          = new Label();
            this.greenLabel.Name     = "greenLabel";
            this.greenLabel.AutoSize = true;
            this.greenLabel.Text     = PdnResources.GetString("ColorsForm.GreenLabel.Text");

            this.greenNud               = new PdnNumericUpDown();
            this.greenNud.Name          = "greenNud";
            this.greenNud.Minimum       = 0;
            this.greenNud.Maximum       = 255;
            this.greenNud.TextAlign     = HorizontalAlignment.Right;
            this.greenNud.ValueChanged += new EventHandler(GreenNud_ValueChanged);
            this.greenNud.TabIndex      = 5;

            this.blueLabel          = new Label();
            this.blueLabel.Name     = "blueLabel";
            this.blueLabel.AutoSize = true;
            this.blueLabel.Text     = PdnResources.GetString("ColorsForm.BlueLabel.Text");

            this.blueNud               = new PdnNumericUpDown();
            this.blueNud.Name          = "blueNud";
            this.blueNud.Minimum       = 0;
            this.blueNud.Maximum       = 255;
            this.blueNud.TextAlign     = HorizontalAlignment.Right;
            this.blueNud.ValueChanged += new EventHandler(BlueNud_ValueChanged);
            this.blueNud.TabIndex      = 6;

            this.resetButton           = new Button();
            this.resetButton.AutoSize  = true;
            this.resetButton.Name      = "resetButton";
            this.resetButton.FlatStyle = FlatStyle.Standard;
            this.resetButton.Click    += new EventHandler(ResetButton_Click);
            this.resetButton.Image     = PdnResources.GetImage("Icons.ResetIcon.png");
            this.resetButton.Width     = 1;
            this.resetButton.Visible   = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.ShowResetButton].Value;
            this.ToolTip.SetToolTip(this.resetButton, PdnResources.GetString("Form.ResetButton.Text").Replace("&", ""));
            this.resetButton.TabIndex = 7;

            this.description      = new Label();
            this.description.Name = "description";
            this.description.Text = this.Description;

            this.Controls.AddRange(
                new Control[]
            {
                this.header,
                this.hsvColorWheel,
                this.saturationSlider,
                this.valueSlider,
                this.colorRectangle,
                this.redLabel,
                this.redNud,
                this.greenLabel,
                this.greenNud,
                this.blueLabel,
                this.blueNud,
                this.resetButton,
                this.description
            });

            ResumeLayout(false);
        }
コード例 #27
0
        public SliderPropertyControl(PropertyControlInfo propInfo)
            : base(propInfo)
        {
            this.header          = new HeaderLabel();
            this.slider          = new TrackBar();
            this.numericUpDown   = new PdnNumericUpDown();
            this.resetButton     = new Button();
            this.descriptionText = new Label();

            this.slider.BeginInit();

            SuspendLayout();

            this.header.Name        = "header";
            this.header.RightMargin = 0;
            this.header.Text        = this.DisplayName;

            this.numericUpDown.DecimalPlaces = 0;
            this.numericUpDown.Name          = "numericUpDown";
            this.numericUpDown.TextAlign     = HorizontalAlignment.Right;
            this.numericUpDown.TabIndex      = 1;

            this.slider.Name         = "slider";
            this.slider.AutoSize     = false;
            this.slider.Orientation  = Orientation.Horizontal;
            this.slider.TabIndex     = 0;
            this.SliderShowTickMarks = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.SliderShowTickMarks].Value;

            this.resetButton.AutoSize  = false;
            this.resetButton.Name      = "resetButton";
            this.resetButton.FlatStyle = FlatStyle.Standard;
            this.resetButton.Click    += new EventHandler(ResetButton_Click);
            this.resetButton.Image     = PdnResources.GetImageResource("Icons.ResetIcon.png").Reference;
            this.resetButton.TabIndex  = 2;
            this.resetButton.Visible   = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.ShowResetButton].Value;
            this.ToolTip.SetToolTip(this.resetButton, PdnResources.GetString("Form.ResetButton.Text").Replace("&", ""));

            this.descriptionText.Name     = "descriptionText";
            this.descriptionText.AutoSize = false;
            this.descriptionText.Text     = this.Description;

            // In order to make sure that setting the ranges on the controls doesn't affect the property in weird ways,
            // we don't set up our ValueChanged handlers until after we set up the controls.
            ValidateUIRanges();
            ResetUIRanges();

            this.numericUpDown.ValueChanged += new EventHandler(NumericUpDown_ValueChanged);
            this.slider.ValueChanged        += new EventHandler(Slider_ValueChanged);

            Controls.AddRange(
                new Control[]
            {
                this.header,
                this.slider,
                this.numericUpDown,
                this.resetButton,
                this.descriptionText
            });

            this.slider.EndInit();

            ResumeLayout(false);
        }
コード例 #28
0
 internal PropertyControl(PropertyControlInfo propInfo) : base(propInfo)
 {
 }
コード例 #29
0
 public Int32ColorWheelPropertyControl(PropertyControlInfo propInfo) : base(propInfo)
 {
     if ((base.Property.MinValue != 0) || (base.Property.MaxValue != 0xffffff))
     {
         object[] objArray1 = new object[] { "The only range allowed for this control is [", 0, ", ", 0xffffff, "]" };
         throw new ArgumentException(string.Concat(objArray1));
     }
     base.SuspendLayout();
     this.header                         = new HeadingLabel();
     this.header.Name                    = "header";
     this.header.RightMargin             = 0;
     this.header.Text                    = base.DisplayName;
     this.colorRectangle                 = new ColorRectangleControl();
     this.colorRectangle.Name            = "colorRectangle";
     this.colorRectangle.TabStop         = false;
     this.colorRectangle.TabIndex        = 0;
     this.hsvColorWheel                  = new ColorWheel();
     this.hsvColorWheel.Name             = "hsvColorWheel";
     this.hsvColorWheel.ColorChanged    += new EventHandler(this.OnHsvColorWheelColorChanged);
     this.hsvColorWheel.TabStop          = false;
     this.hsvColorWheel.TabIndex         = 1;
     this.saturationSlider               = new ColorGradientControl();
     this.saturationSlider.Name          = "saturationSlider";
     this.saturationSlider.Orientation   = Orientation.Vertical;
     this.saturationSlider.ValueChanged += new IndexEventHandler(this.OnSaturationSliderValueChanged);
     this.saturationSlider.TabStop       = false;
     this.saturationSlider.TabIndex      = 2;
     this.valueSlider                    = new ColorGradientControl();
     this.valueSlider.Name               = "valueSlider";
     this.valueSlider.Orientation        = Orientation.Vertical;
     this.valueSlider.ValueChanged      += new IndexEventHandler(this.OnValueSliderValueChanged);
     this.valueSlider.TabStop            = false;
     this.valueSlider.TabIndex           = 3;
     this.redLabel                       = new PdnLabel();
     this.redLabel.Name                  = "redLabel";
     this.redLabel.AutoSize              = true;
     this.redLabel.Text                  = PdnResources.GetString("ColorsForm.RedLabel.Text");
     this.redNud                         = new PdnNumericUpDown();
     this.redNud.Name                    = "redNud";
     this.redNud.Minimum                 = decimal.Zero;
     this.redNud.Maximum                 = 255M;
     this.redNud.TextAlign               = HorizontalAlignment.Right;
     this.redNud.ValueChanged           += new EventHandler(this.OnRedNudValueChanged);
     this.redNud.TabIndex                = 4;
     this.greenLabel                     = new PdnLabel();
     this.greenLabel.Name                = "greenLabel";
     this.greenLabel.AutoSize            = true;
     this.greenLabel.Text                = PdnResources.GetString("ColorsForm.GreenLabel.Text");
     this.greenNud                       = new PdnNumericUpDown();
     this.greenNud.Name                  = "greenNud";
     this.greenNud.Minimum               = decimal.Zero;
     this.greenNud.Maximum               = 255M;
     this.greenNud.TextAlign             = HorizontalAlignment.Right;
     this.greenNud.ValueChanged         += new EventHandler(this.OnGreenNudValueChanged);
     this.greenNud.TabIndex              = 5;
     this.blueLabel                      = new PdnLabel();
     this.blueLabel.Name                 = "blueLabel";
     this.blueLabel.AutoSize             = true;
     this.blueLabel.Text                 = PdnResources.GetString("ColorsForm.BlueLabel.Text");
     this.blueNud                        = new PdnNumericUpDown();
     this.blueNud.Name                   = "blueNud";
     this.blueNud.Minimum                = decimal.Zero;
     this.blueNud.Maximum                = 255M;
     this.blueNud.TextAlign              = HorizontalAlignment.Right;
     this.blueNud.ValueChanged          += new EventHandler(this.OnBlueNudValueChanged);
     this.blueNud.TabIndex               = 6;
     this.resetButton                    = new PdnPushButton();
     this.resetButton.AutoSize           = true;
     this.resetButton.Name               = "resetButton";
     this.resetButton.Click             += new EventHandler(this.OnResetButtonClick);
     this.resetButton.Image              = PdnResources.GetImage("Icons.ResetIcon.png");
     this.resetButton.Width              = 1;
     this.resetButton.Visible            = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.ShowResetButton].Value;
     base.ToolTip.SetToolTip(this.resetButton, PdnResources.GetString("Form.ResetButton.Text").Replace("&", ""));
     this.resetButton.TabIndex = 7;
     this.description          = new PdnLabel();
     this.description.Name     = "description";
     this.description.Text     = base.Description;
     Control[] controls = new Control[] { this.header, this.hsvColorWheel, this.saturationSlider, this.valueSlider, this.colorRectangle, this.redLabel, this.redNud, this.greenLabel, this.greenNud, this.blueLabel, this.blueNud, this.resetButton, this.description };
     base.Controls.AddRange(controls);
     base.ResumeLayout(false);
 }
コード例 #30
0
        public VectorSliderPropertyControl(PropertyControlInfo propInfo)
            : base(propInfo)
        {
            SuspendLayout();

            this.header          = new HeaderLabel();
            this.sliderX         = new TrackBar();
            this.numericUpDownX  = new PdnNumericUpDown();
            this.resetButtonX    = new Button();
            this.sliderY         = new TrackBar();
            this.numericUpDownY  = new PdnNumericUpDown();
            this.resetButtonY    = new Button();
            this.descriptionText = new Label();

            this.header.Name        = "header";
            this.header.RightMargin = 0;
            this.header.Text        = this.DisplayName;

            this.sliderX.Name          = "sliderX";
            this.sliderX.AutoSize      = false;
            this.sliderX.ValueChanged += new EventHandler(SliderX_ValueChanged);
            this.sliderX.Orientation   = Orientation.Horizontal;
            this.SliderShowTickMarksX  = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.SliderShowTickMarksX].Value;

            this.numericUpDownX.Name          = "numericUpDownX";
            this.numericUpDownX.ValueChanged += new EventHandler(NumericUpDownX_ValueChanged);
            this.numericUpDownX.TextAlign     = HorizontalAlignment.Right;

            this.resetButtonX.Name      = "resetButtonX";
            this.resetButtonX.AutoSize  = false;
            this.resetButtonX.FlatStyle = FlatStyle.Standard;
            this.resetButtonX.Click    += new EventHandler(ResetButtonX_Click);
            this.resetButtonX.Image     = PdnResources.GetImageResource("Icons.ResetIcon.png").Reference;
            this.resetButtonX.Visible   = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.ShowResetButton].Value;
            this.ToolTip.SetToolTip(this.resetButtonX, PdnResources.GetString("Form.ResetButton.Text").Replace("&", ""));

            this.sliderY.Name          = "sliderY";
            this.sliderY.AutoSize      = false;
            this.sliderY.ValueChanged += new EventHandler(SliderY_ValueChanged);
            this.sliderY.Orientation   = Orientation.Horizontal;
            this.SliderShowTickMarksY  = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.SliderShowTickMarksY].Value;

            this.numericUpDownY.Name          = "numericUpDownY";
            this.numericUpDownY.ValueChanged += new EventHandler(NumericUpDownY_ValueChanged);
            this.numericUpDownY.TextAlign     = HorizontalAlignment.Right;

            this.resetButtonY.Name      = "resetButtonY";
            this.resetButtonY.AutoSize  = false;
            this.resetButtonY.FlatStyle = FlatStyle.Standard;
            this.resetButtonY.Click    += new EventHandler(ResetButtonY_Click);
            this.resetButtonY.Image     = PdnResources.GetImageResource("Icons.ResetIcon.png").Reference;
            this.resetButtonY.Visible   = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.ShowResetButton].Value;
            this.ToolTip.SetToolTip(this.resetButtonY, PdnResources.GetString("Form.ResetButton.Text").Replace("&", ""));

            this.descriptionText.Name     = "descriptionText";
            this.descriptionText.AutoSize = false;
            this.descriptionText.Text     = this.Description;

            ValidateUIRanges();

            ResetUIRanges();

            Controls.AddRange(
                new Control[]
            {
                this.header,
                this.sliderX,
                this.numericUpDownX,
                this.resetButtonX,
                this.sliderY,
                this.numericUpDownY,
                this.resetButtonY,
                this.descriptionText
            });

            ResumeLayout(false);
        }
コード例 #31
0
ファイル: PropertyControl.cs プロジェクト: metadeta96/openpdn
 internal PropertyControl(PropertyControlInfo propInfo)
 {
     this.property = propInfo.Property;
     this.property.ValueChanged += new EventHandler(Property_ValueChanged);
     this.property.ReadOnlyChanged += new EventHandler(Property_ReadOnlyChanged);
     this.displayName = (string)propInfo.ControlProperties[ControlInfoPropertyNames.DisplayName].Value;
     this.description = (string)propInfo.ControlProperties[ControlInfoPropertyNames.Description].Value;
 }
コード例 #32
0
 private PropertyControlInfo(PropertyControlInfo cloneMe)
     : base(cloneMe)
 {
     this.property = cloneMe.property;
     this.controlType = (StaticListChoiceProperty)cloneMe.controlType.Clone();
     this.valueDisplayNames = new Dictionary<object, string>(cloneMe.valueDisplayNames);
 }