private void InitializeComponent() { this.EnabledCheckBox = new Iocomp.Design.Plugin.EditorControls.CheckBox(); this.VisibleCheckBox = new Iocomp.Design.Plugin.EditorControls.CheckBox(); this.FontButton = new FontButton(); this.focusLabel11 = new FocusLabel(); this.ForeColorPicker = new ColorPicker(); this.TextEditMultiLine = new EditMultiLine(); this.focusLabel2 = new FocusLabel(); this.checkBox1 = new Iocomp.Design.Plugin.EditorControls.CheckBox(); this.UserCanEditCheckBox = new Iocomp.Design.Plugin.EditorControls.CheckBox(); this.UserCanSizeCheckBox = new Iocomp.Design.Plugin.EditorControls.CheckBox(); this.UserCanMoveCheckBox = new Iocomp.Design.Plugin.EditorControls.CheckBox(); this.NameTextBox = new EditBox(); this.focusLabel7 = new FocusLabel(); this.YAxisNameTextBox = new EditBox(); this.focusLabel5 = new FocusLabel(); this.XAxisNameTextBox = new EditBox(); this.focusLabel6 = new FocusLabel(); this.LayerNumericUpDown = new Iocomp.Design.Plugin.EditorControls.NumericUpDown(); this.focusLabel4 = new FocusLabel(); this.RotationTextBox = new EditBox(); this.focusLabel1 = new FocusLabel(); this.YTextBox = new EditBox(); this.label9 = new FocusLabel(); this.XTextBox = new EditBox(); this.label8 = new FocusLabel(); this.WidthTextBox = new EditBox(); this.label7 = new FocusLabel(); this.ContextMenuEnabledCheckBox = new Iocomp.Design.Plugin.EditorControls.CheckBox(); this.ClippingStyleComboBox = new Iocomp.Design.Plugin.EditorControls.ComboBox(); this.focusLabel3 = new FocusLabel(); this.OuterMarginEditBox = new EditBox(); this.focusLabel8 = new FocusLabel(); this.CanFocusCheckBox = new Iocomp.Design.Plugin.EditorControls.CheckBox(); base.SuspendLayout(); this.EnabledCheckBox.Location = new Point(16, 35); this.EnabledCheckBox.Name = "EnabledCheckBox"; this.EnabledCheckBox.PropertyName = "Enabled"; this.EnabledCheckBox.Size = new Size(72, 24); this.EnabledCheckBox.TabIndex = 1; this.EnabledCheckBox.Text = "Enabled"; this.VisibleCheckBox.Location = new Point(16, 11); this.VisibleCheckBox.Name = "VisibleCheckBox"; this.VisibleCheckBox.PropertyName = "Visible"; this.VisibleCheckBox.Size = new Size(72, 24); this.VisibleCheckBox.TabIndex = 0; this.VisibleCheckBox.Text = "Visible"; this.FontButton.Location = new Point(144, 208); this.FontButton.Name = "FontButton"; this.FontButton.PropertyName = "Font"; this.FontButton.Size = new Size(72, 23); this.FontButton.TabIndex = 17; this.focusLabel11.LoadingBegin(); this.focusLabel11.FocusControl = this.ForeColorPicker; this.focusLabel11.Location = new Point(221, 211); this.focusLabel11.Name = "focusLabel11"; this.focusLabel11.Size = new Size(59, 15); this.focusLabel11.Text = "Fore Color"; this.focusLabel11.LoadingEnd(); this.ForeColorPicker.Location = new Point(280, 208); this.ForeColorPicker.Name = "ForeColorPicker"; this.ForeColorPicker.PropertyName = "ForeColor"; this.ForeColorPicker.Size = new Size(49, 21); this.ForeColorPicker.Style = ColorPickerStyle.ColorBox; this.ForeColorPicker.TabIndex = 18; this.TextEditMultiLine.EditFont = null; this.TextEditMultiLine.Location = new Point(144, 176); this.TextEditMultiLine.Name = "TextEditMultiLine"; this.TextEditMultiLine.PropertyName = "Text"; this.TextEditMultiLine.Size = new Size(400, 20); this.TextEditMultiLine.TabIndex = 16; this.focusLabel2.LoadingBegin(); this.focusLabel2.FocusControl = this.TextEditMultiLine; this.focusLabel2.Location = new Point(115, 179); this.focusLabel2.Name = "focusLabel2"; this.focusLabel2.Size = new Size(29, 15); this.focusLabel2.Text = "Text"; this.focusLabel2.LoadingEnd(); this.checkBox1.Location = new Point(344, 208); this.checkBox1.Name = "checkBox1"; this.checkBox1.PropertyName = "FixedSize"; this.checkBox1.Size = new Size(80, 24); this.checkBox1.TabIndex = 19; this.checkBox1.Text = "Fixed Size"; this.UserCanEditCheckBox.Location = new Point(16, 107); this.UserCanEditCheckBox.Name = "UserCanEditCheckBox"; this.UserCanEditCheckBox.PropertyName = "UserCanEdit"; this.UserCanEditCheckBox.Size = new Size(96, 24); this.UserCanEditCheckBox.TabIndex = 4; this.UserCanEditCheckBox.Text = "User Can Edit"; this.UserCanSizeCheckBox.Location = new Point(16, 83); this.UserCanSizeCheckBox.Name = "UserCanSizeCheckBox"; this.UserCanSizeCheckBox.PropertyName = "UserCanSize"; this.UserCanSizeCheckBox.TabIndex = 3; this.UserCanSizeCheckBox.Text = "User Can Size"; this.UserCanMoveCheckBox.Location = new Point(16, 59); this.UserCanMoveCheckBox.Name = "UserCanMoveCheckBox"; this.UserCanMoveCheckBox.PropertyName = "UserCanMove"; this.UserCanMoveCheckBox.TabIndex = 2; this.UserCanMoveCheckBox.Text = "User Can Move"; this.NameTextBox.LoadingBegin(); this.NameTextBox.Location = new Point(232, 16); this.NameTextBox.Name = "NameTextBox"; this.NameTextBox.PropertyName = "Name"; this.NameTextBox.Size = new Size(144, 20); this.NameTextBox.TabIndex = 7; this.NameTextBox.LoadingEnd(); this.focusLabel7.LoadingBegin(); this.focusLabel7.FocusControl = this.NameTextBox; this.focusLabel7.Location = new Point(195, 18); this.focusLabel7.Name = "focusLabel7"; this.focusLabel7.Size = new Size(37, 15); this.focusLabel7.Text = "Name"; this.focusLabel7.LoadingEnd(); this.YAxisNameTextBox.LoadingBegin(); this.YAxisNameTextBox.Location = new Point(232, 64); this.YAxisNameTextBox.Name = "YAxisNameTextBox"; this.YAxisNameTextBox.PropertyName = "YAxisName"; this.YAxisNameTextBox.Size = new Size(144, 20); this.YAxisNameTextBox.TabIndex = 9; this.YAxisNameTextBox.LoadingEnd(); this.focusLabel5.LoadingBegin(); this.focusLabel5.FocusControl = this.YAxisNameTextBox; this.focusLabel5.Location = new Point(160, 66); this.focusLabel5.Name = "focusLabel5"; this.focusLabel5.Size = new Size(72, 15); this.focusLabel5.Text = "Y-Axis Name"; this.focusLabel5.LoadingEnd(); this.XAxisNameTextBox.LoadingBegin(); this.XAxisNameTextBox.Location = new Point(232, 40); this.XAxisNameTextBox.Name = "XAxisNameTextBox"; this.XAxisNameTextBox.PropertyName = "XAxisName"; this.XAxisNameTextBox.Size = new Size(144, 20); this.XAxisNameTextBox.TabIndex = 8; this.XAxisNameTextBox.LoadingEnd(); this.focusLabel6.LoadingBegin(); this.focusLabel6.FocusControl = this.XAxisNameTextBox; this.focusLabel6.Location = new Point(160, 42); this.focusLabel6.Name = "focusLabel6"; this.focusLabel6.Size = new Size(72, 15); this.focusLabel6.Text = "X-Axis Name"; this.focusLabel6.LoadingEnd(); this.LayerNumericUpDown.Location = new Point(320, 88); this.LayerNumericUpDown.Maximum = new decimal(new int[4] { 10000, 0, 0, 0 }); this.LayerNumericUpDown.Minimum = new decimal(new int[4] { 10000, 0, 0, -2147483648 }); this.LayerNumericUpDown.Name = "LayerNumericUpDown"; this.LayerNumericUpDown.PropertyName = "Layer"; this.LayerNumericUpDown.Size = new Size(56, 20); this.LayerNumericUpDown.TabIndex = 11; this.LayerNumericUpDown.TextAlign = HorizontalAlignment.Center; this.focusLabel4.LoadingBegin(); this.focusLabel4.FocusControl = this.LayerNumericUpDown; this.focusLabel4.Location = new Point(285, 89); this.focusLabel4.Name = "focusLabel4"; this.focusLabel4.Size = new Size(35, 15); this.focusLabel4.Text = "Layer"; this.focusLabel4.LoadingEnd(); this.RotationTextBox.LoadingBegin(); this.RotationTextBox.Location = new Point(232, 88); this.RotationTextBox.Name = "RotationTextBox"; this.RotationTextBox.PropertyName = "Rotation"; this.RotationTextBox.Size = new Size(48, 20); this.RotationTextBox.TabIndex = 10; this.RotationTextBox.LoadingEnd(); this.focusLabel1.LoadingBegin(); this.focusLabel1.FocusControl = this.RotationTextBox; this.focusLabel1.Location = new Point(183, 90); this.focusLabel1.Name = "focusLabel1"; this.focusLabel1.Size = new Size(49, 15); this.focusLabel1.Text = "Rotation"; this.focusLabel1.LoadingEnd(); this.YTextBox.LoadingBegin(); this.YTextBox.Location = new Point(432, 40); this.YTextBox.Name = "YTextBox"; this.YTextBox.PropertyName = "Y"; this.YTextBox.Size = new Size(112, 20); this.YTextBox.TabIndex = 14; this.YTextBox.LoadingEnd(); this.label9.LoadingBegin(); this.label9.FocusControl = this.YTextBox; this.label9.Location = new Point(417, 42); this.label9.Name = "label9"; this.label9.Size = new Size(15, 15); this.label9.Text = "Y"; this.label9.LoadingEnd(); this.XTextBox.LoadingBegin(); this.XTextBox.Location = new Point(432, 16); this.XTextBox.Name = "XTextBox"; this.XTextBox.PropertyName = "X"; this.XTextBox.Size = new Size(112, 20); this.XTextBox.TabIndex = 13; this.XTextBox.LoadingEnd(); this.label8.LoadingBegin(); this.label8.FocusControl = this.XTextBox; this.label8.Location = new Point(417, 18); this.label8.Name = "label8"; this.label8.Size = new Size(15, 15); this.label8.Text = "X"; this.label8.LoadingEnd(); this.WidthTextBox.LoadingBegin(); this.WidthTextBox.Location = new Point(432, 64); this.WidthTextBox.Name = "WidthTextBox"; this.WidthTextBox.PropertyName = "Width"; this.WidthTextBox.Size = new Size(112, 20); this.WidthTextBox.TabIndex = 15; this.WidthTextBox.LoadingEnd(); this.label7.LoadingBegin(); this.label7.FocusControl = this.WidthTextBox; this.label7.Location = new Point(396, 66); this.label7.Name = "label7"; this.label7.Size = new Size(36, 15); this.label7.Text = "Width"; this.label7.LoadingEnd(); this.ContextMenuEnabledCheckBox.Location = new Point(16, 132); this.ContextMenuEnabledCheckBox.Name = "ContextMenuEnabledCheckBox"; this.ContextMenuEnabledCheckBox.PropertyName = "ContextMenuEnabled"; this.ContextMenuEnabledCheckBox.Size = new Size(144, 24); this.ContextMenuEnabledCheckBox.TabIndex = 5; this.ContextMenuEnabledCheckBox.Text = "Context Menu Enabled"; this.ClippingStyleComboBox.DropDownStyle = ComboBoxStyle.DropDownList; this.ClippingStyleComboBox.Location = new Point(232, 112); this.ClippingStyleComboBox.MaxDropDownItems = 20; this.ClippingStyleComboBox.Name = "ClippingStyleComboBox"; this.ClippingStyleComboBox.PropertyName = "ClippingStyle"; this.ClippingStyleComboBox.Size = new Size(80, 21); this.ClippingStyleComboBox.TabIndex = 12; this.focusLabel3.LoadingBegin(); this.focusLabel3.FocusControl = this.ClippingStyleComboBox; this.focusLabel3.Location = new Point(157, 114); this.focusLabel3.Name = "focusLabel3"; this.focusLabel3.Size = new Size(75, 15); this.focusLabel3.Text = "Clipping Style"; this.focusLabel3.LoadingEnd(); this.OuterMarginEditBox.LoadingBegin(); this.OuterMarginEditBox.Location = new Point(496, 208); this.OuterMarginEditBox.Name = "OuterMarginEditBox"; this.OuterMarginEditBox.PropertyName = "OuterMargin"; this.OuterMarginEditBox.Size = new Size(48, 20); this.OuterMarginEditBox.TabIndex = 20; this.OuterMarginEditBox.LoadingEnd(); this.focusLabel8.LoadingBegin(); this.focusLabel8.FocusControl = this.OuterMarginEditBox; this.focusLabel8.Location = new Point(424, 210); this.focusLabel8.Name = "focusLabel8"; this.focusLabel8.Size = new Size(72, 15); this.focusLabel8.Text = "Outer Margin"; this.focusLabel8.LoadingEnd(); this.CanFocusCheckBox.Location = new Point(16, 157); this.CanFocusCheckBox.Name = "CanFocusCheckBox"; this.CanFocusCheckBox.PropertyName = "CanFocus"; this.CanFocusCheckBox.Size = new Size(80, 24); this.CanFocusCheckBox.TabIndex = 6; this.CanFocusCheckBox.Text = "Can Focus"; base.Controls.Add(this.CanFocusCheckBox); base.Controls.Add(this.OuterMarginEditBox); base.Controls.Add(this.focusLabel8); base.Controls.Add(this.ClippingStyleComboBox); base.Controls.Add(this.focusLabel3); base.Controls.Add(this.ContextMenuEnabledCheckBox); base.Controls.Add(this.NameTextBox); base.Controls.Add(this.focusLabel7); base.Controls.Add(this.YAxisNameTextBox); base.Controls.Add(this.focusLabel5); base.Controls.Add(this.XAxisNameTextBox); base.Controls.Add(this.focusLabel6); base.Controls.Add(this.LayerNumericUpDown); base.Controls.Add(this.focusLabel4); base.Controls.Add(this.RotationTextBox); base.Controls.Add(this.focusLabel1); base.Controls.Add(this.YTextBox); base.Controls.Add(this.label9); base.Controls.Add(this.XTextBox); base.Controls.Add(this.label8); base.Controls.Add(this.WidthTextBox); base.Controls.Add(this.label7); base.Controls.Add(this.UserCanEditCheckBox); base.Controls.Add(this.UserCanSizeCheckBox); base.Controls.Add(this.UserCanMoveCheckBox); base.Controls.Add(this.checkBox1); base.Controls.Add(this.FontButton); base.Controls.Add(this.focusLabel11); base.Controls.Add(this.ForeColorPicker); base.Controls.Add(this.TextEditMultiLine); base.Controls.Add(this.focusLabel2); base.Controls.Add(this.EnabledCheckBox); base.Controls.Add(this.VisibleCheckBox); base.Location = new Point(10, 20); base.Name = "PlotAnnotationTextBoxEditorPlugIn"; base.Size = new Size(616, 272); base.ResumeLayout(false); }
private void InitializeComponent() { this.label2 = new FocusLabel(); this.DirectionComboBox = new Iocomp.Design.Plugin.EditorControls.ComboBox(); this.label5 = new FocusLabel(); this.MarginNumericUpDown = new Iocomp.Design.Plugin.EditorControls.NumericUpDown(); this.groupBox1 = new GroupBox(); this.label3 = new FocusLabel(); this.TextInactiveForeColorPicker = new ColorPicker(); this.TextInactiveFontButton = new FontButton(); this.groupBox2 = new GroupBox(); this.label4 = new FocusLabel(); this.TextActiveForeColorPicker = new ColorPicker(); this.TextActiveFontButton = new FontButton(); this.TextAlignmentComboBox = new Iocomp.Design.Plugin.EditorControls.ComboBox(); this.VisibleCheckBox = new Iocomp.Design.Plugin.EditorControls.CheckBox(); this.label8 = new FocusLabel(); this.TextMarginNumericUpDown = new Iocomp.Design.Plugin.EditorControls.NumericUpDown(); ((ISupportInitialize)this.MarginNumericUpDown).BeginInit(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); ((ISupportInitialize)this.TextMarginNumericUpDown).BeginInit(); base.SuspendLayout(); this.label2.LoadingBegin(); this.label2.FocusControl = this.DirectionComboBox; this.label2.Location = new Point(45, 74); this.label2.Name = "label2"; this.label2.Size = new Size(51, 15); this.label2.Text = "Direction"; this.label2.LoadingEnd(); this.DirectionComboBox.DropDownStyle = ComboBoxStyle.DropDownList; this.DirectionComboBox.Location = new Point(96, 72); this.DirectionComboBox.Name = "DirectionComboBox"; this.DirectionComboBox.PropertyName = "Direction"; this.DirectionComboBox.Size = new Size(121, 21); this.DirectionComboBox.TabIndex = 2; this.label5.LoadingBegin(); this.label5.FocusControl = this.MarginNumericUpDown; this.label5.Location = new Point(55, 105); this.label5.Name = "label5"; this.label5.Size = new Size(41, 15); this.label5.Text = "Margin"; this.label5.LoadingEnd(); this.MarginNumericUpDown.Location = new Point(96, 104); this.MarginNumericUpDown.Maximum = new decimal(new int[4] { 0, 0, -2147483648, 0 }); this.MarginNumericUpDown.Minimum = new decimal(new int[4] { 2, 0, 0, 0 }); this.MarginNumericUpDown.Name = "MarginNumericUpDown"; this.MarginNumericUpDown.PropertyName = "Margin"; this.MarginNumericUpDown.Size = new Size(48, 20); this.MarginNumericUpDown.TabIndex = 3; this.MarginNumericUpDown.TextAlign = HorizontalAlignment.Center; this.groupBox1.Controls.Add(this.label3); this.groupBox1.Controls.Add(this.TextInactiveForeColorPicker); this.groupBox1.Controls.Add(this.TextInactiveFontButton); this.groupBox1.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.groupBox1.Location = new Point(232, 96); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new Size(224, 80); this.groupBox1.TabIndex = 5; this.groupBox1.TabStop = false; this.groupBox1.Text = "Text Inactive"; this.label3.LoadingBegin(); this.label3.FocusControl = this.TextInactiveForeColorPicker; this.label3.Location = new Point(16, 51); this.label3.Name = "label3"; this.label3.Size = new Size(56, 15); this.label3.Text = "ForeColor"; this.label3.LoadingEnd(); this.TextInactiveForeColorPicker.Location = new Point(72, 48); this.TextInactiveForeColorPicker.Name = "TextInactiveForeColorPicker"; this.TextInactiveForeColorPicker.PropertyName = "TextInactiveForeColor"; this.TextInactiveForeColorPicker.Size = new Size(144, 21); this.TextInactiveForeColorPicker.TabIndex = 1; this.TextInactiveFontButton.Location = new Point(72, 16); this.TextInactiveFontButton.Name = "TextInactiveFontButton"; this.TextInactiveFontButton.PropertyName = "TextInactiveFont"; this.TextInactiveFontButton.Size = new Size(72, 23); this.TextInactiveFontButton.TabIndex = 0; this.groupBox2.Controls.Add(this.label4); this.groupBox2.Controls.Add(this.TextActiveForeColorPicker); this.groupBox2.Controls.Add(this.TextActiveFontButton); this.groupBox2.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.groupBox2.Location = new Point(232, 8); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new Size(224, 80); this.groupBox2.TabIndex = 4; this.groupBox2.TabStop = false; this.groupBox2.Text = "Text Active"; this.label4.LoadingBegin(); this.label4.FocusControl = this.TextActiveForeColorPicker; this.label4.Location = new Point(16, 51); this.label4.Name = "label4"; this.label4.Size = new Size(56, 15); this.label4.Text = "ForeColor"; this.label4.LoadingEnd(); this.TextActiveForeColorPicker.Location = new Point(72, 48); this.TextActiveForeColorPicker.Name = "TextActiveForeColorPicker"; this.TextActiveForeColorPicker.PropertyName = "TextActiveForeColor"; this.TextActiveForeColorPicker.Size = new Size(144, 21); this.TextActiveForeColorPicker.TabIndex = 1; this.TextActiveFontButton.Location = new Point(72, 16); this.TextActiveFontButton.Name = "TextActiveFontButton"; this.TextActiveFontButton.PropertyName = "TextActiveFont"; this.TextActiveFontButton.Size = new Size(72, 23); this.TextActiveFontButton.TabIndex = 0; this.TextAlignmentComboBox.Location = new Point(0, 0); this.TextAlignmentComboBox.Name = "TextAlignmentComboBox"; this.TextAlignmentComboBox.TabIndex = 0; this.VisibleCheckBox.Location = new Point(96, 8); this.VisibleCheckBox.Name = "VisibleCheckBox"; this.VisibleCheckBox.PropertyName = "Visible"; this.VisibleCheckBox.Size = new Size(62, 24); this.VisibleCheckBox.TabIndex = 0; this.VisibleCheckBox.Text = "Visble"; this.label8.LoadingBegin(); this.label8.FocusControl = this.TextMarginNumericUpDown; this.label8.Location = new Point(30, 41); this.label8.Name = "label8"; this.label8.Size = new Size(66, 15); this.label8.Text = "Text Margin"; this.label8.LoadingEnd(); this.TextMarginNumericUpDown.Location = new Point(96, 40); this.TextMarginNumericUpDown.Name = "TextMarginNumericUpDown"; this.TextMarginNumericUpDown.PropertyName = "TextMargin"; this.TextMarginNumericUpDown.Size = new Size(48, 20); this.TextMarginNumericUpDown.TabIndex = 1; this.TextMarginNumericUpDown.TextAlign = HorizontalAlignment.Center; base.Controls.Add(this.label8); base.Controls.Add(this.TextMarginNumericUpDown); base.Controls.Add(this.VisibleCheckBox); base.Controls.Add(this.label5); base.Controls.Add(this.MarginNumericUpDown); base.Controls.Add(this.groupBox1); base.Controls.Add(this.groupBox2); base.Controls.Add(this.DirectionComboBox); base.Controls.Add(this.label2); base.Name = "ScaleDisplayDiscreetLinearEditorPlugIn"; base.Size = new Size(488, 200); base.Title = "Scale Display Editor"; ((ISupportInitialize)this.MarginNumericUpDown).EndInit(); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); ((ISupportInitialize)this.TextMarginNumericUpDown).EndInit(); base.ResumeLayout(false); }
/// <summary> /// Generate and initialise input widget for the given property. /// This involves attaching the appropriate event handlers and /// populating it with an initial value. /// </summary> /// <param name="property">The property to be presented.</param> private Widget GenerateInputWidget(Property property) { Widget component; switch (property.DisplayMethod) { case PropertyType.MultiLineText: TextView editor = new TextView(); editor.SizeAllocated += OnTextViewSizeAllocated; string text = ReflectionUtilities.ObjectToString(property.Value, CultureInfo.CurrentCulture); editor.Buffer.Text = text ?? ""; originalEntryText[property.ID] = text; editor.Name = property.ID.ToString(); Frame outline = new Frame(); outline.Add(editor); component = outline; editor.FocusOutEvent += OnEntryFocusOut; break; case PropertyType.SingleLineText: string entryValue = ReflectionUtilities.ObjectToString(property.Value, CultureInfo.InvariantCulture); Entry textInput = new Entry(entryValue ?? ""); textInput.FocusOutEvent += OnEntryFocusOut; component = textInput; originalEntryText[property.ID] = textInput.Text; break; case PropertyType.Checkbox: CheckButton toggleButton = new CheckButton(); toggleButton.Active = (bool)property.Value; toggleButton.Toggled += OnToggleCheckButton; component = toggleButton; break; case PropertyType.DropDown: // Dropdown list - use a DropDownView (which wraps GtkComboBox). DropDownView dropDown = new DropDownView(this); dropDown.Values = property.DropDownOptions; dropDown.SelectedValue = property.Value?.ToString(); dropDown.Changed += OnDropDownChanged; component = dropDown.MainWidget; break; case PropertyType.File: case PropertyType.Files: case PropertyType.Directory: //case PropertyType.Directories: // Add an Entry and a Button inside a VBox. Entry fileNameInput = new Entry(property.Value?.ToString() ?? ""); fileNameInput.Name = property.ID.ToString(); fileNameInput.FocusOutEvent += OnEntryFocusOut; originalEntryText[property.ID] = fileNameInput.Text; Button fileChooserButton = new Button("..."); fileChooserButton.Name = property.ID.ToString(); if (property.DisplayMethod == PropertyType.File) { fileChooserButton.Clicked += (o, _) => ChooseFile(o as Widget, false, false); } else if (property.DisplayMethod == PropertyType.Files) { fileChooserButton.Clicked += (o, _) => ChooseFile(o as Widget, true, false); } else if (property.DisplayMethod == PropertyType.Directory) { fileChooserButton.Clicked += (o, _) => ChooseFile(o as Widget, false, true); } Box container = new HBox(); container.PackStart(fileNameInput, true, true, 0); container.PackStart(fileChooserButton, false, false, 0); component = container; break; case PropertyType.Colour: ColourDropDownView colourChooser = new ColourDropDownView(this); List <object> colours = new List <object>(); foreach (var colour in ColourUtilities.Colours) { colours.Add(colour); } colourChooser.Values = colours.ToArray(); colourChooser.SelectedValue = property.Value; colourChooser.Changed += OnDropDownChanged; colourChooser.MainWidget.Name = property.ID.ToString(); component = colourChooser.MainWidget; break; case PropertyType.Numeric: SpinButton button = new SpinButton(double.MinValue, double.MaxValue, 1); component = button; if (property.Value == null) { button.Value = 0; // ? } else { button.Value = Convert.ToDouble(property.Value); } button.ValueChanged += OnNumberChanged; break; case PropertyType.Font: FontButton btnFont = new FontButton(property.Value?.ToString()); btnFont.FontSet += OnFontChanged; component = btnFont; break; default: throw new Exception($"Unknown display type {property.DisplayMethod}"); } // Set the widget's name to the property name. // This allows us to provide the property name when firing off // the property changed event, despite the event handlers being // shared by multiple components. return(component); }
private void InitializeComponent() { this.VisibleCheckBox = new Iocomp.Design.Plugin.EditorControls.CheckBox(); this.EnabledCheckBox = new Iocomp.Design.Plugin.EditorControls.CheckBox(); this.NameTextBox = new EditBox(); this.focusLabel1 = new FocusLabel(); this.ColorPicker = new ColorPicker(); this.label8 = new FocusLabel(); this.FontButton = new FontButton(); this.focusLabel11 = new FocusLabel(); this.ForeColorPicker = new ColorPicker(); this.ContextMenuEnabledCheckBox = new Iocomp.Design.Plugin.EditorControls.CheckBox(); this.LayerNumericUpDown = new Iocomp.Design.Plugin.EditorControls.NumericUpDown(); this.label1 = new FocusLabel(); this.MarginOuterTextBox = new EditBox(); this.focusLabel2 = new FocusLabel(); this.UserCanEditCheckBox = new Iocomp.Design.Plugin.EditorControls.CheckBox(); this.ChannelNameEditBox = new EditBox(); this.focusLabel3 = new FocusLabel(); this.GradientWidthNumericUpDown = new Iocomp.Design.Plugin.EditorControls.NumericUpDown(); this.focusLabel4 = new FocusLabel(); this.GradientMinHeightNumericUpDown = new Iocomp.Design.Plugin.EditorControls.NumericUpDown(); this.focusLabel5 = new FocusLabel(); this.TitleTextBox = new EditMultiLine(); this.focusLabel15 = new FocusLabel(); this.CanFocusCheckBox = new Iocomp.Design.Plugin.EditorControls.CheckBox(); base.SuspendLayout(); this.VisibleCheckBox.Location = new Point(288, 11); this.VisibleCheckBox.Name = "VisibleCheckBox"; this.VisibleCheckBox.PropertyName = "Visible"; this.VisibleCheckBox.Size = new Size(72, 24); this.VisibleCheckBox.TabIndex = 10; this.VisibleCheckBox.Text = "Visible"; this.EnabledCheckBox.Location = new Point(288, 35); this.EnabledCheckBox.Name = "EnabledCheckBox"; this.EnabledCheckBox.PropertyName = "Enabled"; this.EnabledCheckBox.Size = new Size(80, 24); this.EnabledCheckBox.TabIndex = 11; this.EnabledCheckBox.Text = "Enabled"; this.NameTextBox.LoadingBegin(); this.NameTextBox.Location = new Point(104, 16); this.NameTextBox.Name = "NameTextBox"; this.NameTextBox.PropertyName = "Name"; this.NameTextBox.Size = new Size(144, 20); this.NameTextBox.TabIndex = 0; this.NameTextBox.LoadingEnd(); this.focusLabel1.LoadingBegin(); this.focusLabel1.FocusControl = this.NameTextBox; this.focusLabel1.Location = new Point(67, 18); this.focusLabel1.Name = "focusLabel1"; this.focusLabel1.Size = new Size(37, 15); this.focusLabel1.Text = "Name"; this.focusLabel1.LoadingEnd(); this.ColorPicker.Location = new Point(104, 80); this.ColorPicker.Name = "ColorPicker"; this.ColorPicker.PropertyName = "Color"; this.ColorPicker.Size = new Size(48, 21); this.ColorPicker.Style = ColorPickerStyle.ColorBox; this.ColorPicker.TabIndex = 2; this.label8.LoadingBegin(); this.label8.FocusControl = this.ColorPicker; this.label8.Location = new Point(70, 83); this.label8.Name = "label8"; this.label8.Size = new Size(34, 15); this.label8.Text = "Color"; this.label8.LoadingEnd(); this.FontButton.Location = new Point(176, 144); this.FontButton.Name = "FontButton"; this.FontButton.PropertyName = "Font"; this.FontButton.Size = new Size(72, 23); this.FontButton.TabIndex = 6; this.focusLabel11.LoadingBegin(); this.focusLabel11.FocusControl = this.ForeColorPicker; this.focusLabel11.Location = new Point(45, 147); this.focusLabel11.Name = "focusLabel11"; this.focusLabel11.Size = new Size(59, 15); this.focusLabel11.Text = "Fore Color"; this.focusLabel11.LoadingEnd(); this.ForeColorPicker.Location = new Point(104, 144); this.ForeColorPicker.Name = "ForeColorPicker"; this.ForeColorPicker.PropertyName = "ForeColor"; this.ForeColorPicker.Size = new Size(49, 21); this.ForeColorPicker.Style = ColorPickerStyle.ColorBox; this.ForeColorPicker.TabIndex = 5; this.ContextMenuEnabledCheckBox.Location = new Point(288, 59); this.ContextMenuEnabledCheckBox.Name = "ContextMenuEnabledCheckBox"; this.ContextMenuEnabledCheckBox.PropertyName = "ContextMenuEnabled"; this.ContextMenuEnabledCheckBox.Size = new Size(152, 24); this.ContextMenuEnabledCheckBox.TabIndex = 12; this.ContextMenuEnabledCheckBox.Text = "Context Menu Enabled"; this.LayerNumericUpDown.Location = new Point(192, 80); this.LayerNumericUpDown.Maximum = new decimal(new int[4] { 10000, 0, 0, 0 }); this.LayerNumericUpDown.Minimum = new decimal(new int[4] { 10000, 0, 0, -2147483648 }); this.LayerNumericUpDown.Name = "LayerNumericUpDown"; this.LayerNumericUpDown.PropertyName = "Layer"; this.LayerNumericUpDown.Size = new Size(56, 20); this.LayerNumericUpDown.TabIndex = 3; this.LayerNumericUpDown.TextAlign = HorizontalAlignment.Center; this.label1.LoadingBegin(); this.label1.FocusControl = this.LayerNumericUpDown; this.label1.Location = new Point(157, 81); this.label1.Name = "label1"; this.label1.Size = new Size(35, 15); this.label1.Text = "Layer"; this.label1.LoadingEnd(); this.MarginOuterTextBox.LoadingBegin(); this.MarginOuterTextBox.Location = new Point(104, 112); this.MarginOuterTextBox.Name = "MarginOuterTextBox"; this.MarginOuterTextBox.PropertyName = "MarginOuter"; this.MarginOuterTextBox.Size = new Size(88, 20); this.MarginOuterTextBox.TabIndex = 4; this.MarginOuterTextBox.LoadingEnd(); this.focusLabel2.LoadingBegin(); this.focusLabel2.FocusControl = this.MarginOuterTextBox; this.focusLabel2.Location = new Point(32, 114); this.focusLabel2.Name = "focusLabel2"; this.focusLabel2.Size = new Size(72, 15); this.focusLabel2.Text = "Margin Outer"; this.focusLabel2.LoadingEnd(); this.UserCanEditCheckBox.Location = new Point(288, 83); this.UserCanEditCheckBox.Name = "UserCanEditCheckBox"; this.UserCanEditCheckBox.PropertyName = "UserCanEdit"; this.UserCanEditCheckBox.Size = new Size(96, 24); this.UserCanEditCheckBox.TabIndex = 13; this.UserCanEditCheckBox.Text = "User Can Edit"; this.ChannelNameEditBox.LoadingBegin(); this.ChannelNameEditBox.Location = new Point(104, 192); this.ChannelNameEditBox.Name = "ChannelNameEditBox"; this.ChannelNameEditBox.PropertyName = "ChannelName"; this.ChannelNameEditBox.Size = new Size(144, 20); this.ChannelNameEditBox.TabIndex = 7; this.ChannelNameEditBox.LoadingEnd(); this.focusLabel3.LoadingBegin(); this.focusLabel3.FocusControl = this.ChannelNameEditBox; this.focusLabel3.Location = new Point(23, 194); this.focusLabel3.Name = "focusLabel3"; this.focusLabel3.Size = new Size(81, 15); this.focusLabel3.Text = "Channel Name"; this.focusLabel3.LoadingEnd(); this.GradientWidthNumericUpDown.Location = new Point(104, 224); this.GradientWidthNumericUpDown.Maximum = new decimal(new int[4] { 10000, 0, 0, 0 }); this.GradientWidthNumericUpDown.Minimum = new decimal(new int[4] { 10000, 0, 0, -2147483648 }); this.GradientWidthNumericUpDown.Name = "GradientWidthNumericUpDown"; this.GradientWidthNumericUpDown.PropertyName = "GradientWidth"; this.GradientWidthNumericUpDown.Size = new Size(56, 20); this.GradientWidthNumericUpDown.TabIndex = 8; this.GradientWidthNumericUpDown.TextAlign = HorizontalAlignment.Center; this.focusLabel4.LoadingBegin(); this.focusLabel4.FocusControl = this.GradientWidthNumericUpDown; this.focusLabel4.Location = new Point(23, 225); this.focusLabel4.Name = "focusLabel4"; this.focusLabel4.Size = new Size(81, 15); this.focusLabel4.Text = "Gradient Width"; this.focusLabel4.LoadingEnd(); this.GradientMinHeightNumericUpDown.Location = new Point(272, 224); this.GradientMinHeightNumericUpDown.Maximum = new decimal(new int[4] { 10000, 0, 0, 0 }); this.GradientMinHeightNumericUpDown.Minimum = new decimal(new int[4] { 10000, 0, 0, -2147483648 }); this.GradientMinHeightNumericUpDown.Name = "GradientMinHeightNumericUpDown"; this.GradientMinHeightNumericUpDown.PropertyName = "GradientMinHeight"; this.GradientMinHeightNumericUpDown.Size = new Size(56, 20); this.GradientMinHeightNumericUpDown.TabIndex = 9; this.GradientMinHeightNumericUpDown.TextAlign = HorizontalAlignment.Center; this.focusLabel5.LoadingBegin(); this.focusLabel5.FocusControl = this.GradientMinHeightNumericUpDown; this.focusLabel5.Location = new Point(167, 225); this.focusLabel5.Name = "focusLabel5"; this.focusLabel5.Size = new Size(105, 15); this.focusLabel5.Text = "Gradient Min Height"; this.focusLabel5.LoadingEnd(); this.TitleTextBox.EditFont = null; this.TitleTextBox.Location = new Point(104, 48); this.TitleTextBox.Name = "TitleTextBox"; this.TitleTextBox.PropertyName = "TitleText"; this.TitleTextBox.Size = new Size(144, 20); this.TitleTextBox.TabIndex = 1; this.focusLabel15.LoadingBegin(); this.focusLabel15.FocusControl = this.TitleTextBox; this.focusLabel15.Location = new Point(51, 51); this.focusLabel15.Name = "focusLabel15"; this.focusLabel15.Size = new Size(53, 15); this.focusLabel15.Text = "Title Text"; this.focusLabel15.LoadingEnd(); this.CanFocusCheckBox.Location = new Point(288, 107); this.CanFocusCheckBox.Name = "CanFocusCheckBox"; this.CanFocusCheckBox.PropertyName = "CanFocus"; this.CanFocusCheckBox.Size = new Size(80, 24); this.CanFocusCheckBox.TabIndex = 14; this.CanFocusCheckBox.Text = "Can Focus"; base.Controls.Add(this.CanFocusCheckBox); base.Controls.Add(this.TitleTextBox); base.Controls.Add(this.focusLabel15); base.Controls.Add(this.GradientMinHeightNumericUpDown); base.Controls.Add(this.focusLabel5); base.Controls.Add(this.GradientWidthNumericUpDown); base.Controls.Add(this.focusLabel4); base.Controls.Add(this.ChannelNameEditBox); base.Controls.Add(this.focusLabel3); base.Controls.Add(this.UserCanEditCheckBox); base.Controls.Add(this.MarginOuterTextBox); base.Controls.Add(this.focusLabel2); base.Controls.Add(this.LayerNumericUpDown); base.Controls.Add(this.label1); base.Controls.Add(this.ContextMenuEnabledCheckBox); base.Controls.Add(this.focusLabel11); base.Controls.Add(this.ForeColorPicker); base.Controls.Add(this.FontButton); base.Controls.Add(this.ColorPicker); base.Controls.Add(this.label8); base.Controls.Add(this.NameTextBox); base.Controls.Add(this.focusLabel1); base.Controls.Add(this.VisibleCheckBox); base.Controls.Add(this.EnabledCheckBox); base.Location = new Point(10, 20); base.Name = "PlotLegendChannelImageEditorPlugIn"; base.Size = new Size(456, 296); base.ResumeLayout(false); }