Index: Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs =================================================================== diff -u -rbd8291af14687d29a602b64864c37f2e254459f8 -rf606a07e85aaba111fa8e9c6a234d1c70c30a056 --- Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision bd8291af14687d29a602b64864c37f2e254459f8) +++ Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision f606a07e85aaba111fa8e9c6a234d1c70c30a056) @@ -1004,7 +1004,7 @@ private void OnFileOptionsClicked(object sender, RoutedEventArgs e) { - var optionsDialog = new OptionsDialog(Gui.UserSettings); + var optionsDialog = new OptionsDialog(this, Gui.UserSettings); if (optionsDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { SetColorTheme((ColorTheme) Gui.UserSettings["colorTheme"]); Index: Core/Common/src/Core.Common.Gui/Forms/Options/OptionsDialog.Designer.cs =================================================================== diff -u -r0ea17b610f66d122fd9f0c8ef9db30740be455d8 -rf606a07e85aaba111fa8e9c6a234d1c70c30a056 --- Core/Common/src/Core.Common.Gui/Forms/Options/OptionsDialog.Designer.cs (.../OptionsDialog.Designer.cs) (revision 0ea17b610f66d122fd9f0c8ef9db30740be455d8) +++ Core/Common/src/Core.Common.Gui/Forms/Options/OptionsDialog.Designer.cs (.../OptionsDialog.Designer.cs) (revision f606a07e85aaba111fa8e9c6a234d1c70c30a056) @@ -30,11 +30,11 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OptionsDialog)); this.groupBoxUserSettings = new System.Windows.Forms.GroupBox(); - this.buttonCancel = new System.Windows.Forms.Button(); - this.buttonOk = new System.Windows.Forms.Button(); this.comboBoxTheme = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); this.checkBoxStartPage = new System.Windows.Forms.CheckBox(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.buttonOk = new System.Windows.Forms.Button(); this.groupBoxUserSettings.SuspendLayout(); this.SuspendLayout(); // @@ -47,21 +47,6 @@ this.groupBoxUserSettings.Name = "groupBoxUserSettings"; this.groupBoxUserSettings.TabStop = false; // - // buttonCancel - // - resources.ApplyResources(this.buttonCancel, "buttonCancel"); - this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.UseVisualStyleBackColor = true; - // - // buttonOk - // - resources.ApplyResources(this.buttonOk, "buttonOk"); - this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonOk.Name = "buttonOk"; - this.buttonOk.UseVisualStyleBackColor = true; - this.buttonOk.Click += new System.EventHandler(this.ButtonOkClick); - // // comboBoxTheme // this.comboBoxTheme.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -82,20 +67,30 @@ this.checkBoxStartPage.Name = "checkBoxStartPage"; this.checkBoxStartPage.UseVisualStyleBackColor = true; // + // buttonCancel + // + resources.ApplyResources(this.buttonCancel, "buttonCancel"); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // buttonOk + // + resources.ApplyResources(this.buttonOk, "buttonOk"); + this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOk.Name = "buttonOk"; + this.buttonOk.UseVisualStyleBackColor = true; + this.buttonOk.Click += new System.EventHandler(this.ButtonOkClick); + // // OptionsDialog // this.AcceptButton = this.buttonOk; resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.buttonCancel; this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOk); this.Controls.Add(this.groupBoxUserSettings); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; this.Name = "OptionsDialog"; - this.ShowInTaskbar = false; this.groupBoxUserSettings.ResumeLayout(false); this.groupBoxUserSettings.PerformLayout(); this.ResumeLayout(false); Index: Core/Common/src/Core.Common.Gui/Forms/Options/OptionsDialog.cs =================================================================== diff -u -r75aa4fefacf584d5172dc3bdffd348b0aacb05a4 -rf606a07e85aaba111fa8e9c6a234d1c70c30a056 --- Core/Common/src/Core.Common.Gui/Forms/Options/OptionsDialog.cs (.../OptionsDialog.cs) (revision 75aa4fefacf584d5172dc3bdffd348b0aacb05a4) +++ Core/Common/src/Core.Common.Gui/Forms/Options/OptionsDialog.cs (.../OptionsDialog.cs) (revision f606a07e85aaba111fa8e9c6a234d1c70c30a056) @@ -2,28 +2,32 @@ using System.Collections.ObjectModel; using System.Configuration; using System.Windows.Forms; -using Core.Common.Gui.Theme; +using Core.Common.Controls.Dialogs; using Core.Common.Gui.Properties; +using Core.Common.Gui.Theme; using Core.Common.Utils.Reflection; namespace Core.Common.Gui.Forms.Options { - public partial class OptionsDialog : Form + public partial class OptionsDialog : DialogBase { private readonly ApplicationSettingsBase userSettings; - public OptionsDialog(ApplicationSettingsBase userSettings) + public OptionsDialog(IWin32Window owner, ApplicationSettingsBase userSettings) : base(owner, Resources.OptionsHS1) { InitializeComponent(); this.userSettings = userSettings; - Icon = Resources.OptionsHS1; - SetColorThemeOptions(); SetSettingsValuesToControls(); } + protected override Button GetCancelButton() + { + return buttonCancel; + } + private void SetColorThemeOptions() { var colorThemeItems = new Collection(); Index: Core/Common/src/Core.Common.Gui/Forms/Options/OptionsDialog.resx =================================================================== diff -u -re6bde6cf4edff919363190133aee61d3a9cacfd1 -rf606a07e85aaba111fa8e9c6a234d1c70c30a056 --- Core/Common/src/Core.Common.Gui/Forms/Options/OptionsDialog.resx (.../OptionsDialog.resx) (revision e6bde6cf4edff919363190133aee61d3a9cacfd1) +++ Core/Common/src/Core.Common.Gui/Forms/Options/OptionsDialog.resx (.../OptionsDialog.resx) (revision f606a07e85aaba111fa8e9c6a234d1c70c30a056) @@ -232,7 +232,7 @@ NoControl - 333, 87 + 333, 86 75, 23 @@ -285,12 +285,9 @@ 1 - + True - - - 6, 13 - + GrowAndShrink Index: Core/Common/test/Core.Common.Gui.Test/Forms/Options/OptionsDialogTest.cs =================================================================== diff -u -r00561a8c93e3a28b5f0e078fa7219a65408e931b -rf606a07e85aaba111fa8e9c6a234d1c70c30a056 --- Core/Common/test/Core.Common.Gui.Test/Forms/Options/OptionsDialogTest.cs (.../OptionsDialogTest.cs) (revision 00561a8c93e3a28b5f0e078fa7219a65408e931b) +++ Core/Common/test/Core.Common.Gui.Test/Forms/Options/OptionsDialogTest.cs (.../OptionsDialogTest.cs) (revision f606a07e85aaba111fa8e9c6a234d1c70c30a056) @@ -10,7 +10,7 @@ [Test] public void GivenGeneralOptionsControlCreated_WhenRetrievingOptionsItems_ThenOptionsShouldBeTranslated() { - using (var control = new OptionsDialog(null)) + using (var control = new OptionsDialog(null, null)) { var subControl = (ComboBox)control.Controls.Find("comboBoxTheme", true)[0];