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); }
public TaskProgressDialog() { base.SuspendLayout(); this.DoubleBuffered = true; base.ResizeRedraw = true; base.AutoHandleGlassRelatedOptimizations = true; base.IsGlassDesired = !OS.IsWin10OrLater; this.dispatcher = new ControlDispatcher(this); this.headerLabel = new PdnLabel(); this.progressBar = new ProgressBar(); this.separator = new PaintDotNet.Controls.SeparatorLine(); this.cancelButton = new PdnPushButton(); this.headerLabel.Name = "headerLabel"; this.progressBar.Name = "progressBar"; this.progressBar.Style = ProgressBarStyle.Marquee; this.progressBar.Minimum = 0; this.progressBar.Maximum = 100; this.separator.Name = "separator"; this.cancelButton.Name = "cancelButton"; this.cancelButton.AutoSize = true; this.cancelButton.Click += new EventHandler(this.OnCancelButtonClick); base.AutoScaleMode = AutoScaleMode.None; base.AcceptButton = null; base.CancelButton = this.cancelButton; base.FormBorderStyle = FormBorderStyle.FixedDialog; base.MinimizeBox = false; base.MaximizeBox = false; base.ShowInTaskbar = false; base.StartPosition = FormStartPosition.CenterParent; Control[] controls = new Control[] { this.headerLabel, this.progressBar, this.separator, this.cancelButton }; base.Controls.AddRange(controls); base.ResumeLayout(false); base.PerformLayout(); }
private void InitializeComponent() { this.baseOkButton = new PdnPushButton(); this.baseCancelButton = new PdnPushButton(); base.SuspendLayout(); this.baseOkButton.Location = new Point(0x4d, 0x80); this.baseOkButton.Name = "baseOkButton"; this.baseOkButton.TabIndex = 1; this.baseOkButton.Click += new EventHandler(this.OnBaseOkButtonClick); this.baseCancelButton.DialogResult = DialogResult.Cancel; this.baseCancelButton.Location = new Point(0xa5, 0x80); this.baseCancelButton.Name = "baseCancelButton"; this.baseCancelButton.TabIndex = 2; this.baseCancelButton.Click += new EventHandler(this.OnBaseCancelButtonClick); base.AcceptButton = this.baseOkButton; base.AutoScaleDimensions = new SizeF(96f, 96f); base.AutoScaleMode = AutoScaleMode.Dpi; base.CancelButton = this.baseCancelButton; base.ClientSize = new Size(0xf8, 0x9e); base.Controls.Add(this.baseCancelButton); base.Controls.Add(this.baseOkButton); base.FormBorderStyle = FormBorderStyle.FixedSingle; base.MinimizeBox = false; base.Name = "PdnBaseDialog"; base.ShowInTaskbar = false; this.Text = "PdnBaseDialog"; base.Controls.SetChildIndex(this.baseOkButton, 0); base.Controls.SetChildIndex(this.baseCancelButton, 0); base.ResumeLayout(false); }
private void InitializeComponent() { this.closeButton = new PdnPushButton(); this.continueButton = new PdnPushButton(); this.progressBar = new ProgressBar(); this.infoText = new PdnLabel(); this.moreInfoLink = new PdnLinkLabel(); this.versionNameLabel = new PdnLabel(); this.separator = new PaintDotNet.Controls.SeparatorLine(); this.progressLabel = new PdnLabel(); base.SuspendLayout(); this.closeButton.AutoSize = true; this.closeButton.Name = "closeButton"; this.closeButton.TabIndex = 0; this.closeButton.Click += new EventHandler(this.OnCloseButtonClick); this.continueButton.AutoSize = true; this.continueButton.AutoScaleImage = false; this.continueButton.Name = "continueButton"; this.continueButton.TabIndex = 3; this.continueButton.Click += new EventHandler(this.OnContinueButtonClick); this.progressBar.MarqueeAnimationSpeed = 40; this.progressBar.Name = "progressBar"; this.progressBar.TabIndex = 4; this.infoText.Name = "infoText"; this.infoText.TabIndex = 2; this.moreInfoLink.Name = "moreInfoLink"; this.moreInfoLink.TabIndex = 5; this.moreInfoLink.TabStop = true; this.moreInfoLink.Click += new EventHandler(this.OnMoreInfoLinkClick); this.versionNameLabel.Name = "versionNameLabel"; this.versionNameLabel.TabIndex = 6; this.separator.Name = "headerLabel"; this.separator.TabIndex = 0; this.separator.TabStop = false; this.progressLabel.Name = "progressLabel"; this.progressLabel.TabIndex = 8; base.AutoScaleDimensions = new SizeF(96f, 96f); base.AutoScaleMode = AutoScaleMode.Dpi; base.CancelButton = this.closeButton; base.ClientSize = new Size(0x157, 0xac); base.Controls.Add(this.progressLabel); base.Controls.Add(this.separator); base.Controls.Add(this.versionNameLabel); base.Controls.Add(this.moreInfoLink); base.Controls.Add(this.continueButton); base.Controls.Add(this.infoText); base.Controls.Add(this.closeButton); base.Controls.Add(this.progressBar); base.FormBorderStyle = FormBorderStyle.FixedDialog; base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "UpdatesDialog"; base.ShowInTaskbar = false; base.StartPosition = FormStartPosition.CenterParent; base.ResumeLayout(false); base.PerformLayout(); }
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); }
private void InitializeComponent() { this.closeButton = new PdnPushButton(); this.copyrightLabel = new PdnLabel(); this.pdnBanner = new PdnBanner(); this.versionLabel = new PdnLabel(); this.separator = new PaintDotNet.Controls.SeparatorLine(); base.SuspendLayout(); this.closeButton.DialogResult = DialogResult.Cancel; this.closeButton.AutoSize = true; this.closeButton.Name = "okButton"; this.closeButton.TabIndex = 0; this.copyrightLabel.BorderStyle = BorderStyle.None; this.copyrightLabel.Location = new Point(10, 0x5f); this.copyrightLabel.Name = "copyrightLabel"; this.copyrightLabel.Size = new Size(0x1e1, 0x24); this.copyrightLabel.TabIndex = 4; this.pdnBanner.Location = new Point(0, 0); this.pdnBanner.Name = "pdnBanner"; this.pdnBanner.Size = new Size(0x1ef, 0x47); this.pdnBanner.TabIndex = 7; this.versionLabel.BorderStyle = BorderStyle.None; this.versionLabel.Location = new Point(10, 0x4d); this.versionLabel.Name = "versionLabel"; this.versionLabel.Size = new Size(0x1e1, 13); this.versionLabel.TabIndex = 8; this.separator.Name = "separator"; base.AcceptButton = this.closeButton; base.AutoScaleDimensions = new SizeF(96f, 96f); base.AutoScaleMode = AutoScaleMode.Dpi; base.CancelButton = this.closeButton; base.ClientSize = new Size(0x1ef, 0xa8); base.Controls.Add(this.versionLabel); base.Controls.Add(this.copyrightLabel); base.Controls.Add(this.pdnBanner); base.Controls.Add(this.separator); base.Controls.Add(this.closeButton); base.FormBorderStyle = FormBorderStyle.FixedDialog; base.Location = new Point(0, 0); base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "AboutDialog"; base.ShowInTaskbar = false; base.SizeGripStyle = SizeGripStyle.Hide; base.StartPosition = FormStartPosition.CenterParent; base.Controls.SetChildIndex(this.closeButton, 0); base.Controls.SetChildIndex(this.pdnBanner, 0); base.Controls.SetChildIndex(this.copyrightLabel, 0); base.Controls.SetChildIndex(this.versionLabel, 0); base.ResumeLayout(false); base.PerformLayout(); }
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); }
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(); }
private void Initialize() { using (new WaitCursorChanger(this)) { base.SuspendLayout(); this.introText = new PdnLabel(); this.defaultToolLabel = new PdnLabel(); this.loadFromToolBarButton = new PdnPushButton(); this.resetButton = new PdnPushButton(); this.toolChooserStrip = new ToolChooserStrip(); this.introText.Name = "introText"; this.introText.TabStop = false; this.introText.Text = PdnResources.GetString("SettingsDialog.Tools.IntroText.Text"); this.defaultToolLabel.Name = "defaultToolLabel"; this.defaultToolLabel.AutoSize = true; this.defaultToolLabel.TabStop = false; this.defaultToolLabel.Text = PdnResources.GetString("SettingsDialog.Tools.DefaultToolLabel.Text"); this.resetButton.Name = "resetButton"; this.resetButton.AutoSize = true; this.resetButton.Click += new EventHandler(this.OnResetButtonClick); this.resetButton.TabIndex = 0; this.resetButton.Text = PdnResources.GetString("SettingsDialog.Tools.ResetButton.Text"); this.loadFromToolBarButton.Name = "loadFromToolBarButton"; this.loadFromToolBarButton.AutoSize = true; this.loadFromToolBarButton.Click += new EventHandler(this.OnLoadFromToolBarButtonClick); this.loadFromToolBarButton.TabIndex = 1; this.loadFromToolBarButton.Text = PdnResources.GetString("SettingsDialog.Tools.LoadFromToolBarButton.Text"); this.toolChooserStrip.Name = "toolChooserStrip"; this.toolChooserStrip.Dock = DockStyle.None; this.toolChooserStrip.GripStyle = ToolStripGripStyle.Hidden; this.toolChooserStrip.UseToolNameForLabel = true; this.toolChooserStrip.ToolClicked += new ToolClickedEventHandler(this.OnToolChooserStripToolClicked); base.Controls.Add(this.loadFromToolBarButton); base.Controls.Add(this.resetButton); base.Controls.Add(this.introText); base.Controls.Add(this.defaultToolLabel); base.Controls.Add(this.toolChooserStrip); base.Location = new Point(0, 0); this.toolConfigRows.Add(new ToolConfigRow(this.toolSettings, ToolBarConfigItems.Brush | ToolBarConfigItems.LineCurveShapeType | ToolBarConfigItems.PenDashStyle | ToolBarConfigItems.PenEndCap | ToolBarConfigItems.PenHardness | ToolBarConfigItems.PenStartCap | ToolBarConfigItems.PenWidth | ToolBarConfigItems.Radius | ToolBarConfigItems.ShapeDrawType | ToolBarConfigItems.ShapeType)); this.toolConfigRows.Add(new ToolConfigRow(this.toolSettings, ToolBarConfigItems.None | ToolBarConfigItems.SelectionCombineMode | ToolBarConfigItems.SelectionDrawMode)); this.toolConfigRows.Add(new ToolConfigRow(this.toolSettings, ToolBarConfigItems.None | ToolBarConfigItems.Text)); this.toolConfigRows.Add(new ToolConfigRow(this.toolSettings, ToolBarConfigItems.Gradient)); this.toolConfigRows.Add(new ToolConfigRow(this.toolSettings, ToolBarConfigItems.FloodMode | ToolBarConfigItems.RecolorToolSamplingMode | ToolBarConfigItems.Tolerance)); this.toolConfigRows.Add(new ToolConfigRow(this.toolSettings, ToolBarConfigItems.None | ToolBarConfigItems.PixelSampleMode | ToolBarConfigItems.SampleImageOrLayer)); this.toolConfigRows.Add(new ToolConfigRow(this.toolSettings, ToolBarConfigItems.ColorPickerBehavior)); this.toolConfigRows.Add(new ToolConfigRow(this.toolSettings, ToolBarConfigItems.None | ToolBarConfigItems.Resampling)); this.toolConfigRows.Add(new ToolConfigRow(this.toolSettings, ToolBarConfigItems.Antialiasing | ToolBarConfigItems.BlendMode | ToolBarConfigItems.SelectionRenderingQuality)); OurToolStripRenderer renderer = new OurToolStripRenderer { DrawToolStripExBackgroundTopSeparatorLine = false }; for (int i = 0; i < this.toolConfigRows.Count; i++) { base.Controls.Add(this.toolConfigRows[i].HeaderLabel); base.Controls.Add(this.toolConfigRows[i].ToolConfigStrip); this.toolConfigRows[i].ToolConfigStrip.Renderer = renderer; this.toolConfigRows[i].ToolConfigStrip.Layout += (s, e) => base.PerformLayout(); } this.toolChooserStrip.Renderer = renderer; this.toolChooserStrip.SetTools(DocumentWorkspace.ToolInfos); this.toolChooserStrip.SelectToolByName(this.toolSettings.ActiveToolName.Value); this.toolSettings.ActiveToolName.ValueChangedT += new ValueChangedEventHandler <string>(this.OnToolSettingsActiveToolNameChanged); UIUtil.SuspendControlPainting(this); foreach (Setting setting in this.toolSettings.Settings) { setting.RaiseValueChangedEvent(); } UIUtil.ResumeControlPainting(this); base.ResumeLayout(false); base.PerformLayout(); } }
public SettingsDialog(IServiceProvider services, AppSettings appSettings, AppSettings.ToolsSection toolBarSettings) { Validate.Begin().IsNotNull <IServiceProvider>(services, "services").IsNotNull <AppSettings>(appSettings, "appSettings").IsNotNull <AppSettings.ToolsSection>(toolBarSettings, "toolBarSettings").Check(); this.services = services; this.appSettings = appSettings; this.toolBarSettings = toolBarSettings; this.components = new Container(); List <SettingsDialogSection> items = new List <SettingsDialogSection> { new UISettingsSection(this.appSettings), new ToolsSettingsSection(this.appSettings, toolBarSettings) }; if (!WinAppModel.HasCurrentPackage) { items.Add(new UpdatesSettingsSection(this, this.appSettings)); } items.Add(new DiagnosticsSettingsSection(this.appSettings)); IPluginErrorService pluginErrorService = services.GetService <IPluginErrorService>(); if (pluginErrorService.GetPluginLoadErrors().Any <PluginErrorInfo>()) { items.Add(new PluginsSettingsSection(this.appSettings, pluginErrorService)); } this.settingsSections = items.ToArrayEx <SettingsDialogSection>(); this.settingsPages = this.settingsSections.Select <SettingsDialogSection, SettingsDialogPage>(ss => ss.CreateUI()).ToArrayEx <SettingsDialogPage>(); if (lastCurrentSection == null) { this.currentSection = this.settingsSections[0]; } else { this.currentSection = this.settingsSections.FirstOrDefault <SettingsDialogSection>(ss => (ss.GetType() == lastCurrentSection)) ?? this.settingsSections[0]; } base.SuspendLayout(); this.DoubleBuffered = true; base.ResizeRedraw = true; base.AutoHandleGlassRelatedOptimizations = true; base.IsGlassDesired = !OS.IsWin10OrLater; this.Font = System.Drawing.SystemFonts.MenuFont; this.sectionsListBox = new FlickerFreeOwnerDrawListBox(); this.sectionPanel = new PanelEx(); this.separator = new PaintDotNet.Controls.SeparatorLine(); this.closeButton = new PdnPushButton(); this.closeButton.Name = "closeButton"; this.closeButton.AutoSize = true; this.closeButton.Text = PdnResources.GetString("Form.CloseButton.Text"); this.sectionPanel.Name = "sectionPanel"; this.sectionPanel.AutoScroll = true; this.sectionPanel.HideHScroll = true; this.sectionPanel.HorizontalScroll.Enabled = false; this.sectionPanel.HorizontalScroll.Visible = false; this.sectionPanel.VerticalScroll.Enabled = true; this.sectionsListBox.Name = "sectionsListBox"; this.sectionsListBox.Items.AddRange(this.settingsSections.ToArrayEx <SettingsDialogSection>()); this.sectionsListBox.DrawMode = DrawMode.OwnerDrawFixed; this.sectionsListBox.ItemHeight = UIUtil.ScaleHeight(0x20); this.sectionsListBox.DrawItem += new DrawItemEventHandler(this.OnSectionsListBoxDrawItem); this.sectionsListBox.IntegralHeight = false; this.sectionsListBox.BorderStyle = BorderStyle.FixedSingle; this.sectionsListBox.MouseEnter += (s, e) => this.UpdateHotTrackIndex(new Point(-1, -1)); this.sectionsListBox.MouseMove += (s, e) => this.UpdateHotTrackIndex(e.Location); this.sectionsListBox.MouseLeave += (s, e) => this.UpdateHotTrackIndex(new Point(-1, -1)); this.sectionsListBox.SelectedIndex = this.settingsSections.IndexOf <SettingsDialogSection>(this.currentSection); this.sectionsListBox.SelectedIndexChanged += new EventHandler(this.OnSectionsListBoxSelectedIndexChanged); this.separator.Name = "separator"; base.Controls.Add(this.sectionsListBox); base.Controls.Add(this.sectionPanel); base.Controls.Add(this.closeButton); base.Controls.Add(this.separator); base.Icon = PdnResources.GetImageResource("Icons.MenuUtilitiesSettingsIcon.png").Reference.ToIcon(); base.AcceptButton = this.closeButton; base.CancelButton = this.closeButton; base.MinimizeBox = false; base.MaximizeBox = false; base.StartPosition = FormStartPosition.CenterParent; base.FormBorderStyle = FormBorderStyle.Sizable; base.ShowInTaskbar = false; this.Text = PdnResources.GetString("SettingsDialog.Text"); base.ClientSize = UIUtil.ScaleSize(600, 450); base.ResumeLayout(false); base.PerformLayout(); }
private void InitializeComponent() { this.separatorLine = new PaintDotNet.Controls.SeparatorLine(); this.visibleCheckBox = new PdnCheckBox(); this.nameBox = new TextBox(); this.nameLabel = new PdnLabel(); this.cancelButton = new PdnPushButton(); this.okButton = new PdnPushButton(); this.generalHeader = new HeadingLabel(); base.SuspendLayout(); this.generalHeader.Location = new Point(6, 8); this.generalHeader.Name = "generalHeader"; this.generalHeader.Margin = new Padding(1, 3, 1, 1); this.generalHeader.Size = new Size(0x10d, 0x11); this.generalHeader.TabIndex = 4; this.generalHeader.TabStop = false; this.nameLabel.Location = new Point(6, 0x1b); this.nameLabel.Name = "nameLabel"; this.nameLabel.Size = new Size(50, 0x10); this.nameLabel.TabIndex = 2; this.nameBox.Location = new Point(0x40, 0x1b); this.nameBox.Name = "nameBox"; this.nameBox.Size = new Size(200, 20); this.nameBox.TabIndex = 2; this.nameBox.Text = ""; this.nameBox.Enter += new EventHandler(this.OnNameBoxEnter); this.visibleCheckBox.Location = new Point(14, 0x2e); this.visibleCheckBox.Name = "visibleCheckBox"; this.visibleCheckBox.Size = new Size(90, 0x10); this.visibleCheckBox.TabIndex = 3; this.visibleCheckBox.IsCheckedChanged += new EventHandler(this.OnVisibleCheckBoxIsCheckedChanged); this.okButton.Anchor = AnchorStyles.Right | AnchorStyles.Bottom; this.okButton.Location = new Point(0x72, 0x48); this.okButton.Name = "okButton"; this.okButton.TabIndex = 0; this.okButton.Click += new EventHandler(this.OnOkButtonClick); this.okButton.AutoSize = true; this.cancelButton.Anchor = AnchorStyles.Right | AnchorStyles.Bottom; this.cancelButton.DialogResult = DialogResult.Cancel; this.cancelButton.Location = new Point(0xc2, 0x48); this.cancelButton.Name = "cancelButton"; this.cancelButton.TabIndex = 1; this.cancelButton.Click += new EventHandler(this.OnCancelButtonClick); this.cancelButton.AutoSize = true; base.AcceptButton = this.okButton; base.AutoScaleDimensions = new SizeF(96f, 96f); base.AutoScaleMode = AutoScaleMode.Dpi; base.CancelButton = this.cancelButton; base.ClientSize = new Size(0x112, 0x60); base.ControlBox = true; base.Controls.Add(this.generalHeader); base.Controls.Add(this.okButton); base.Controls.Add(this.cancelButton); base.Controls.Add(this.nameBox); base.Controls.Add(this.visibleCheckBox); base.Controls.Add(this.nameLabel); base.Controls.Add(this.separatorLine); base.FormBorderStyle = FormBorderStyle.FixedSingle; base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "LayerPropertiesDialog"; base.ShowInTaskbar = false; base.StartPosition = FormStartPosition.CenterParent; base.Controls.SetChildIndex(this.nameLabel, 0); base.Controls.SetChildIndex(this.visibleCheckBox, 0); base.Controls.SetChildIndex(this.nameBox, 0); base.Controls.SetChildIndex(this.cancelButton, 0); base.Controls.SetChildIndex(this.okButton, 0); base.Controls.SetChildIndex(this.generalHeader, 0); base.ResumeLayout(false); }
private void InitializeComponent() { this.typeANameLabel = new PdnLabel(); this.textBox = new TextBox(); this.listBox = new ListBox(); this.saveButton = new PdnPushButton(); this.palettesLabel = new PdnLabel(); this.cancelButton = new PdnPushButton(); base.SuspendLayout(); this.typeANameLabel.AutoSize = true; this.typeANameLabel.Location = new Point(5, 8); this.typeANameLabel.Margin = new Padding(0); this.typeANameLabel.Name = "typeANameLabel"; this.typeANameLabel.Size = new Size(50, 13); this.typeANameLabel.TabIndex = 0; this.typeANameLabel.Text = "infoLabel"; this.textBox.AutoCompleteMode = AutoCompleteMode.Suggest; this.textBox.AutoCompleteSource = AutoCompleteSource.CustomSource; this.textBox.Location = new Point(8, 0x19); this.textBox.Name = "textBox"; this.textBox.Size = new Size(0x120, 20); this.textBox.TabIndex = 2; this.textBox.Validating += new CancelEventHandler(this.OnTextBoxValidating); this.textBox.TextChanged += new EventHandler(this.OnTextBoxTextChanged); this.palettesLabel.AutoSize = true; this.palettesLabel.Location = new Point(5, 50); this.palettesLabel.Margin = new Padding(0); this.palettesLabel.Name = "palettesLabel"; this.palettesLabel.Size = new Size(0x23, 13); this.palettesLabel.TabIndex = 5; this.palettesLabel.Text = "label1"; this.listBox.FormattingEnabled = true; this.listBox.Location = new Point(8, 0x43); this.listBox.Name = "listBox"; this.listBox.Size = new Size(0x121, 0x6c); this.listBox.Sorted = true; this.listBox.TabIndex = 3; this.listBox.SelectedIndexChanged += new EventHandler(this.OnListBoxSelectedIndexChanged); this.saveButton.DialogResult = DialogResult.Cancel; this.saveButton.Location = new Point(8, 0xb9); this.saveButton.Name = "saveButton2"; this.saveButton.Size = new Size(0x4b, 0x17); this.saveButton.TabIndex = 4; this.saveButton.Text = "button1"; this.saveButton.Click += new EventHandler(this.OnSaveButtonClick); this.cancelButton.DialogResult = DialogResult.Cancel; this.cancelButton.Location = new Point(0x59, 0xb9); this.cancelButton.Name = "cancelButton"; this.cancelButton.Size = new Size(0x4b, 0x17); this.cancelButton.TabIndex = 6; this.cancelButton.Text = "button1"; this.cancelButton.Click += new EventHandler(this.OnCancelButtonClick); base.AutoScaleDimensions = new SizeF(96f, 96f); base.AutoScaleMode = AutoScaleMode.Dpi; base.CancelButton = this.cancelButton; base.ClientSize = new Size(310, 0xd9); base.Controls.Add(this.palettesLabel); base.Controls.Add(this.listBox); base.Controls.Add(this.textBox); base.Controls.Add(this.saveButton); base.Controls.Add(this.cancelButton); base.Controls.Add(this.typeANameLabel); base.FormBorderStyle = FormBorderStyle.FixedDialog; base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "SavePaletteDialog"; base.ShowInTaskbar = false; base.StartPosition = FormStartPosition.CenterParent; this.Text = "SavePaletteDialog"; base.Controls.SetChildIndex(this.typeANameLabel, 0); base.Controls.SetChildIndex(this.cancelButton, 0); base.Controls.SetChildIndex(this.saveButton, 0); base.Controls.SetChildIndex(this.textBox, 0); base.Controls.SetChildIndex(this.listBox, 0); base.Controls.SetChildIndex(this.palettesLabel, 0); base.ResumeLayout(false); base.PerformLayout(); }
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); }
private void InitializeComponent() { this.saveConfigPanel = new Panel(); this.defaultsButton = new PdnPushButton(); this.saveConfigWidget = new SaveConfigWidget(); this.previewHeader = new HeadingLabel(); this.canvasControl = new ScrollableCanvasControl(); this.settingsHeader = new HeadingLabel(); this.footerSeparator = new PaintDotNet.Controls.SeparatorLine(); base.SuspendLayout(); base.baseOkButton.Anchor = AnchorStyles.Right | AnchorStyles.Bottom; base.baseOkButton.Name = "baseOkButton"; base.baseOkButton.TabIndex = 2; base.baseOkButton.Click += new EventHandler(this.OnBaseOkButtonClick); base.baseCancelButton.Anchor = AnchorStyles.Right | AnchorStyles.Bottom; base.baseCancelButton.Name = "baseCancelButton"; base.baseCancelButton.TabIndex = 3; base.baseCancelButton.Click += new EventHandler(this.OnBaseCancelButtonClick); this.footerSeparator.Name = "footerSeparator"; this.saveConfigPanel.AutoScroll = true; this.saveConfigPanel.Name = "saveConfigPanel"; this.saveConfigPanel.TabIndex = 0; this.saveConfigPanel.TabStop = false; this.defaultsButton.Name = "defaultsButton"; this.defaultsButton.AutoSize = true; this.defaultsButton.TabIndex = 1; this.defaultsButton.Click += new EventHandler(this.OnDefaultsButtonClick); this.saveConfigWidget.Name = "saveConfigWidget"; this.saveConfigWidget.TabIndex = 9; this.saveConfigWidget.Token = null; this.previewHeader.Name = "previewHeader"; this.previewHeader.RightMargin = 0; this.previewHeader.TabIndex = 11; this.previewHeader.TabStop = false; this.previewHeader.Text = "Header"; this.canvasControl.Name = "documentView"; this.canvasControl.CanvasControl.MouseDown += new MouseEventHandler(this.OnCanvasViewMouseDown); this.canvasControl.CanvasControl.MouseMove += new MouseEventHandler(this.OnCanvasViewMouseMove); this.canvasControl.CanvasControl.MouseUp += new MouseEventHandler(this.OnCanvasViewMouseUp); this.canvasControl.CanvasView.IsCanvasFrameEnabled = false; this.settingsHeader.Name = "settingsHeader"; this.settingsHeader.TabIndex = 13; this.settingsHeader.TabStop = false; this.settingsHeader.Text = "Header"; base.AutoScaleDimensions = new SizeF(96f, 96f); base.AutoScaleMode = AutoScaleMode.Dpi; base.Controls.Add(this.defaultsButton); base.Controls.Add(this.settingsHeader); base.Controls.Add(this.previewHeader); base.Controls.Add(this.canvasControl); base.Controls.Add(this.footerSeparator); base.Controls.Add(this.saveConfigPanel); base.FormBorderStyle = FormBorderStyle.Sizable; base.MinimizeBox = false; base.MaximizeBox = true; base.Name = "SaveConfigDialog"; base.StartPosition = FormStartPosition.Manual; base.Controls.SetChildIndex(this.saveConfigPanel, 0); base.Controls.SetChildIndex(this.canvasControl, 0); base.Controls.SetChildIndex(base.baseOkButton, 0); base.Controls.SetChildIndex(base.baseCancelButton, 0); base.Controls.SetChildIndex(this.previewHeader, 0); base.Controls.SetChildIndex(this.settingsHeader, 0); base.Controls.SetChildIndex(this.defaultsButton, 0); base.ResumeLayout(false); }
public ExceptionDialog() { base.SuspendLayout(); this.toolTip = new ToolTip(); base.Icon = PdnInfo.AppIcon; this.errorIconBox = new PictureBox(); this.errorIconBox.SizeMode = PictureBoxSizeMode.StretchImage; this.errorIconBox.Image = this.GetScaledWarningIcon(); this.messageLabel = new PdnLabel(); this.message2Label = new PdnLabel(); this.bottomSeparator = new PaintDotNet.Controls.SeparatorLine(); this.detailsButton = new PdnPushButton(); this.detailsButton.Click += new EventHandler(this.OnDetailsButtonClick); this.detailsButton.AutoSize = true; this.button1 = new PdnPushButton(); this.button1.AutoSize = true; this.button1.DialogResult = DialogResult.OK; this.button1.Visible = false; this.button2 = new PdnPushButton(); this.button2.Text = PdnResources.GetString("Form.OkButton.Text"); this.button2.AutoSize = true; this.button2.DialogResult = DialogResult.Cancel; this.copyToClipboardButton = new PdnPushButton(); this.copyToClipboardButton.Text = PdnResources.GetString("ExceptionDialog.CopyToClipboardButton.Text"); this.copyToClipboardButton.AutoSize = true; this.copyToClipboardButton.Click += new EventHandler(this.OnCopyToClipboardButtonClick); this.folderIconBox = new PictureBox(); this.folderIconBox.SizeMode = PictureBoxSizeMode.StretchImage; this.folderIconBox.Image = PdnResources.GetImageResource("Icons.FolderShortcut.png").Reference; this.folderIconBox.Visible = false; this.openFolderLink = new PdnLinkLabel(); this.openFolderLink.Text = PdnResources.GetString("ExceptionDialog.OpenFolderLink.Text"); this.openFolderLink.LinkClicked += new LinkLabelLinkClickedEventHandler(this.OnOpenFolderLinkLinkClicked); this.openFolderLink.Visible = false; this.openFolderLink.AutoSize = true; this.crashLogTextBox = new TextBox(); this.crashLogTextBox.Multiline = true; this.crashLogTextBox.ReadOnly = true; this.crashLogTextBox.ScrollBars = ScrollBars.Vertical; this.crashLogTextBox.Font = new Font(FontFamily.GenericMonospace, this.crashLogTextBox.Font.Size); this.crashLogTextBox.Visible = false; this.crashLogTextBox.KeyPress += new KeyPressEventHandler(this.OnCrashLogTextBoxKeyPress); this.detailsButton.Text = this.GetDetailsButtonText(); this.detailsButton.TabIndex = 0; this.button1.TabIndex = 1; this.button2.TabIndex = 2; this.copyToClipboardButton.TabIndex = 3; this.openFolderLink.TabIndex = 4; this.crashLogTextBox.TabIndex = 5; base.Controls.Add(this.errorIconBox); base.Controls.Add(this.messageLabel); base.Controls.Add(this.message2Label); base.Controls.Add(this.bottomSeparator); base.Controls.Add(this.detailsButton); base.Controls.Add(this.button2); base.Controls.Add(this.button1); base.Controls.Add(this.copyToClipboardButton); base.Controls.Add(this.folderIconBox); base.Controls.Add(this.openFolderLink); base.Controls.Add(this.crashLogTextBox); this.Text = PdnInfo.BareProductName; this.BackColor = SystemColors.Window; base.FormBorderStyle = FormBorderStyle.Sizable; base.MaximizeBox = false; base.MinimizeBox = false; base.AcceptButton = this.button1; base.CancelButton = this.button2; base.ClientSize = new Size(UIUtil.ScaleWidth(450), base.ClientSize.Height); base.StartPosition = FormStartPosition.CenterScreen; this.DoubleBuffered = true; base.ShowInTaskbar = false; base.ResumeLayout(false); base.PerformLayout(); this.MinimumSize = base.Size; this.button1.Focus(); }