Esempio n. 1
0
 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();
 }
Esempio n. 2
0
 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();
 }
Esempio n. 3
0
 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();
 }
Esempio n. 4
0
        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();
        }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 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);
 }
Esempio n. 7
0
 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();
 }