X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ide%2Fsrc%2Fide.ec;h=fa2957bf1b1ce8781c4c1ffaf605a735d7ab7b56;hb=3473e15120d1256602c5031c50fa80ea882fce05;hp=535f81ddb5e2a9836069ccc603281de121d78448;hpb=61976be1d5a7508a3449e9f89d146850eccad711;p=sdk diff --git a/ide/src/ide.ec b/ide/src/ide.ec index 535f81d..fa2957b 100644 --- a/ide/src/ide.ec +++ b/ide/src/ide.ec @@ -2066,54 +2066,63 @@ class IDEWorkSpace : Window } } property bool isBreakpointTogglingUnavailable { get { return !project; } } - property bool isDebuggerExecuting { get { if(ide.debugger) return ide.debugger.state == running; return false; } } + property bool isDebuggerRunning { get { if(ide.debugger) return ide.debugger.state == running; return false; } } property bool isDebuggerStopped { get { if(ide.debugger) return ide.debugger.state == stopped; return false; } } void AdjustDebugMenus() { bool unavailable = areDebugMenusUnavailable; + bool running = isDebuggerRunning; + bool stopped = isDebuggerStopped; bool active = debugger.isActive; - bool bpNoToggle = isBreakpointTogglingUnavailable; - bool executing = isDebuggerExecuting; - //bool holding = debugger.state == stopped; + bool noBreakpointToggle = !project; - debugStartResumeItem.disabled = unavailable || executing; + bool isNotRunning = unavailable || !running; + bool isNotNotRunning = unavailable || running; + bool isNotStopped = unavailable || !stopped; + bool isNotActive = unavailable || !active; + + debugStartResumeItem.disabled = isNotNotRunning; debugStartResumeItem.text = active ? $"Resume" : $"Start"; debugStartResumeItem.NotifySelect = active ? MenuDebugResume : MenuDebugStart; if(toolBar) { - toolBar.buttonDebugStartResume.disabled = unavailable || executing; + toolBar.buttonDebugStartResume.disabled = isNotNotRunning; toolBar.buttonDebugStartResume.toolTip = active ? $"Resume" : $"Start"; } - debugBreakItem.disabled = unavailable || !executing; - debugStopItem.disabled = unavailable || !active; - debugRestartItem.disabled = unavailable || !active; + debugBreakItem.disabled = isNotRunning; + debugStopItem.disabled = isNotActive; + debugRestartItem.disabled = isNotActive; if(toolBar) { - toolBar.buttonDebugPause.disabled = unavailable || !executing; - toolBar.buttonDebugStop.disabled = unavailable || !active; - toolBar.buttonDebugRestart.disabled = unavailable || !active; + toolBar.buttonDebugPause.disabled = isNotRunning; + toolBar.buttonDebugStop.disabled = isNotActive; + toolBar.buttonDebugRestart.disabled = isNotActive; } - debugStepIntoItem.disabled = unavailable || executing; - debugStepOverItem.disabled = unavailable || executing; - debugSkipStepOverItem.disabled = unavailable || executing; - debugStepOutItem.disabled = unavailable || executing || !active; - debugSkipStepOutItem.disabled = unavailable || executing || !active; + debugStepIntoItem.disabled = isNotNotRunning; + debugStepOverItem.disabled = isNotNotRunning; + debugSkipStepOverItem.disabled = isNotNotRunning; + debugStepOutItem.disabled = isNotStopped; + debugSkipStepOutItem.disabled = isNotStopped; +#if 0 + debugStepUntilItem.disabled = isNotStopped; + debugSkipStepUntilItem.disabled = isNotStopped; +#endif if(toolBar) { - toolBar.buttonDebugStepInto.disabled = unavailable || executing; - toolBar.buttonDebugStepOver.disabled = unavailable || executing; - toolBar.buttonDebugSkipStepOver.disabled = unavailable || executing; - toolBar.buttonDebugStepOut.disabled = unavailable || executing || !active; - //toolBar.buttonDebugSkipStepOutItem.disabled = unavailable || executing; + toolBar.buttonDebugStepInto.disabled = isNotNotRunning; + toolBar.buttonDebugStepOver.disabled = isNotNotRunning; + toolBar.buttonDebugSkipStepOver.disabled = isNotNotRunning; + toolBar.buttonDebugStepOut.disabled = isNotStopped; + //toolBar.buttonDebugSkipStepOutItem.disabled = isNotNotRunning; } if((Designer)GetActiveDesigner()) { CodeEditor codeEditor = ((Designer)GetActiveDesigner()).codeEditor; if(codeEditor) - codeEditor.AdjustDebugMenus(unavailable, bpNoToggle, executing, isDebuggerStopped); + codeEditor.AdjustDebugMenus(); } }