From 0a96e014e25d220173a475d55b5ef8ce7415ac68 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Mon, 24 Jun 2019 15:48:11 -0700 Subject: [PATCH] Layout for app settings Multi-tab dialog with tons of controls. Also, fixed WorkProgress owner, and removed debug delay from source gen dialog. --- SourceGenWPF/AsmGen/WpfGui/GenAndAsm.xaml.cs | 4 +- SourceGenWPF/MainController.cs | 10 + SourceGenWPF/SourceGenWPF.csproj | 7 + SourceGenWPF/WpfGui/EditAppSettings.xaml | 364 +++++++++++++++++++ SourceGenWPF/WpfGui/EditAppSettings.xaml.cs | 59 +++ SourceGenWPF/WpfGui/MainWindow.xaml | 5 +- SourceGenWPF/WpfGui/MainWindow.xaml.cs | 4 + SourceGenWPF/WpfGui/WorkProgress.xaml.cs | 2 +- 8 files changed, 451 insertions(+), 4 deletions(-) create mode 100644 SourceGenWPF/WpfGui/EditAppSettings.xaml create mode 100644 SourceGenWPF/WpfGui/EditAppSettings.xaml.cs diff --git a/SourceGenWPF/AsmGen/WpfGui/GenAndAsm.xaml.cs b/SourceGenWPF/AsmGen/WpfGui/GenAndAsm.xaml.cs index d5c70ea..92ef51b 100644 --- a/SourceGenWPF/AsmGen/WpfGui/GenAndAsm.xaml.cs +++ b/SourceGenWPF/AsmGen/WpfGui/GenAndAsm.xaml.cs @@ -250,8 +250,8 @@ namespace SourceGenWPF.AsmGen.WpfGui { mGenerator = gen; } public object DoWork(BackgroundWorker worker) { - worker.ReportProgress(50, "Halfway there!"); - System.Threading.Thread.Sleep(3000); + //worker.ReportProgress(50, "Halfway there!"); + //System.Threading.Thread.Sleep(5000); return mGenerator.GenerateSource(worker); } public void RunWorkerCompleted(object results) { diff --git a/SourceGenWPF/MainController.cs b/SourceGenWPF/MainController.cs index 6f29952..c52435d 100644 --- a/SourceGenWPF/MainController.cs +++ b/SourceGenWPF/MainController.cs @@ -1148,6 +1148,16 @@ namespace SourceGenWPF { dlg.ShowDialog(); } + /// + /// Opens the application settings dialog. All changes to settings are made directly + /// to the AppSettings.Global object. + /// + public void EditSettings() { + EditAppSettings dlg = new EditAppSettings(mMainWin, EditAppSettings.Tab.Unknown, + AsmGen.AssemblerInfo.Id.Unknown); + dlg.ShowDialog(); + } + public void HandleCodeListDoubleClick(int row, int col) { Debug.WriteLine("DCLICK: row=" + row + " col=" + col); diff --git a/SourceGenWPF/SourceGenWPF.csproj b/SourceGenWPF/SourceGenWPF.csproj index d9c3b6f..fc06842 100644 --- a/SourceGenWPF/SourceGenWPF.csproj +++ b/SourceGenWPF/SourceGenWPF.csproj @@ -73,6 +73,9 @@ + + EditAppSettings.xaml + WorkProgress.xaml @@ -164,6 +167,10 @@ + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/SourceGenWPF/WpfGui/EditAppSettings.xaml b/SourceGenWPF/WpfGui/EditAppSettings.xaml new file mode 100644 index 0000000..44ae269 --- /dev/null +++ b/SourceGenWPF/WpfGui/EditAppSettings.xaml @@ -0,0 +1,364 @@ + + + + + + +