From 1685e37c020873526c0d4af1fbcf648f450185ce Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Sun, 7 Jul 2019 14:28:35 -0700 Subject: [PATCH] Implement "go to" feature --- SourceGenWPF/MainController.cs | 8 ++ SourceGenWPF/SourceGenWPF.csproj | 7 + SourceGenWPF/WpfGui/GotoBox.xaml | 68 ++++++++++ SourceGenWPF/WpfGui/GotoBox.xaml.cs | 173 +++++++++++++++++++++++++ SourceGenWPF/WpfGui/MainWindow.xaml | 13 +- SourceGenWPF/WpfGui/MainWindow.xaml.cs | 4 + 6 files changed, 270 insertions(+), 3 deletions(-) create mode 100644 SourceGenWPF/WpfGui/GotoBox.xaml create mode 100644 SourceGenWPF/WpfGui/GotoBox.xaml.cs diff --git a/SourceGenWPF/MainController.cs b/SourceGenWPF/MainController.cs index cd34d00..d59accd 100644 --- a/SourceGenWPF/MainController.cs +++ b/SourceGenWPF/MainController.cs @@ -1506,6 +1506,14 @@ namespace SourceGenWPF { mMainWin.CodeListView_Focus(); } + public void Goto() { + GotoBox dlg = new GotoBox(mMainWin, mProject, mOutputFormatter); + if (dlg.ShowDialog() == true) { + GoToOffset(dlg.TargetOffset, false, true); + mMainWin.CodeListView_Focus(); + } + } + /// /// Moves the view and selection to the specified offset. We want to select stuff /// differently if we're jumping to a note vs. jumping to an instruction. diff --git a/SourceGenWPF/SourceGenWPF.csproj b/SourceGenWPF/SourceGenWPF.csproj index 272f840..d85b673 100644 --- a/SourceGenWPF/SourceGenWPF.csproj +++ b/SourceGenWPF/SourceGenWPF.csproj @@ -99,6 +99,9 @@ FontPicker.xaml + + GotoBox.xaml + WorkProgress.xaml @@ -222,6 +225,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/SourceGenWPF/WpfGui/GotoBox.xaml b/SourceGenWPF/WpfGui/GotoBox.xaml new file mode 100644 index 0000000..64eab2e --- /dev/null +++ b/SourceGenWPF/WpfGui/GotoBox.xaml @@ -0,0 +1,68 @@ + + + + + + + + + + + +