1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-06-25 05:29:31 +00:00

Show a wait cursor when refreshing larger projects

Fiddled with the status bar, but that'll probably require async.
This commit is contained in:
Andy McFadden 2019-07-19 11:41:18 -07:00
parent 1044b9d479
commit 84f4075ad4
6 changed files with 22 additions and 21 deletions

View File

@ -341,7 +341,8 @@ namespace Asm65 {
}
public override string ToString() {
return Name + " (has16=" + HasAddr16 + ", hasEmu=" + HasEmuFlag + ")";
return Name + " (has16=" + HasAddr16 + ", hasEmu=" + HasEmuFlag + ", hasUndoc=" +
HasUndocumented + ")";
}
/// <summary>

View File

@ -27,6 +27,7 @@ using CommonUtil;
using CommonWPF;
using SourceGenWPF.Sandbox;
using SourceGenWPF.WpfGui;
using System.Windows.Input;
namespace SourceGenWPF {
/// <summary>
@ -779,31 +780,16 @@ namespace SourceGenWPF {
mOutputFormatterCpuDef = mProject.CpuDef;
}
#if false
if (mDisplayList.Count > 200000) {
string prevStatus = toolStripStatusLabel.Text;
// The Windows stuff can take 50-100ms, potentially longer than the actual
// work, so don't bother unless the file is very large.
if (CodeLineList.Count > 40000) {
try {
mReanalysisTimer.StartTask("Do Windows stuff");
Application.UseWaitCursor = true;
Cursor.Current = Cursors.WaitCursor;
toolStripStatusLabel.Text = Res.Strings.STATUS_RECALCULATING;
Refresh(); // redraw status label
mReanalysisTimer.EndTask("Do Windows stuff");
Mouse.OverrideCursor = Cursors.Wait;
DoRefreshProject(reanalysisRequired);
} finally {
Application.UseWaitCursor = false;
toolStripStatusLabel.Text = prevStatus;
Mouse.OverrideCursor = null;
}
} else {
#endif
DoRefreshProject(reanalysisRequired);
#if false
}
#endif
}
if (FormatDescriptor.DebugCreateCount != 0) {
Debug.WriteLine("FormatDescriptor total=" + FormatDescriptor.DebugCreateCount +

View File

@ -110,6 +110,7 @@ limitations under the License.
<system:String x:Key="str_SaveBeforeAsmCaption">Save Project First</system:String>
<system:String x:Key="str_SetupSystemSummaryFmt">{1} CPU @ {2} MHz</system:String>
<system:String x:Key="str_ShowCol">Show</system:String>
<system:String x:Key="str_StatusReady">Ready</system:String>
<system:String x:Key="str_SymbolImportCaption">Symbol Import</system:String>
<system:String x:Key="str_SymbolImportGoodFmt">Imported {0} global symbols.</system:String>
<system:String x:Key="str_SymbolImportNone">No global+export symbols were found.</system:String>

View File

@ -201,6 +201,8 @@ namespace SourceGenWPF.Res {
(string)Application.Current.FindResource("str_SetupSystemSummaryFmt");
public static string SHOW_COL =
(string)Application.Current.FindResource("str_ShowCol");
public static string STATUS_READY =
(string)Application.Current.FindResource("str_StatusReady");
public static string SYMBOL_IMPORT_CAPTION =
(string)Application.Current.FindResource("str_SymbolImportCaption");
public static string SYMBOL_IMPORT_GOOD_FMT =

View File

@ -396,7 +396,7 @@ limitations under the License.
</ToolBarTray>
<StatusBar Name="mainStatusBar" DockPanel.Dock="Bottom">
<TextBlock Text="Ready"/>
<TextBlock Text="{Binding StatusBarText, FallbackValue=Ready}"/>
</StatusBar>
<!-- Main part of the window. Three side-by-side panels, only the middle of which changes

View File

@ -49,6 +49,15 @@ namespace SourceGenWPF.WpfGui {
get { return App.ProgramVersion.ToString(); }
}
/// <summary>
/// Text for status bar at bottom of window.
/// </summary>
public string StatusBarText {
get { return mStatusBarText; }
set { mStatusBarText = value; OnPropertyChanged(); }
}
private string mStatusBarText;
/// <summary>
/// Width of long comment fields.
/// </summary>
@ -169,6 +178,8 @@ namespace SourceGenWPF.WpfGui {
mMainCtrl = new MainController(this);
StatusBarText = Res.Strings.STATUS_READY;
AddMultiKeyGestures();
// Get an event when the splitters move. Because of the way things are set up, it's