From d7a34ec7dd973fb7cf4500bd32e3c2ae931242ea Mon Sep 17 00:00:00 2001 From: thrust26 Date: Tue, 19 Dec 2017 09:01:26 +0100 Subject: [PATCH] 'tab' key skips disabled widgets 'ghost' read traps are displayed by 'RTrapG' --- src/emucore/M6502.cxx | 3 ++- src/gui/PopUpWidget.cxx | 1 - src/gui/Widget.cxx | 35 +++++++++++++++++++++-------------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/emucore/M6502.cxx b/src/emucore/M6502.cxx index 184e7affa..bcdeddde7 100644 --- a/src/emucore/M6502.cxx +++ b/src/emucore/M6502.cxx @@ -147,7 +147,8 @@ inline uInt8 M6502::peek(uInt16 address, uInt8 flags) { myJustHitReadTrapFlag = true; stringstream msg; - msg << "RTrap[" << Common::Base::HEX2 << cond << "]" << (myTrapCondNames[cond].empty() ? ": " : "If: {" + myTrapCondNames[cond] + "} "); + msg << "RTrap" << (flags == DISASM_NONE ? "G[" : "[") << Common::Base::HEX2 << cond << "]" + << (myTrapCondNames[cond].empty() ? ": " : "If: {" + myTrapCondNames[cond] + "} "); myHitTrapInfo.message = msg.str(); myHitTrapInfo.address = address; } diff --git a/src/gui/PopUpWidget.cxx b/src/gui/PopUpWidget.cxx index c412c6c96..b2a87c559 100644 --- a/src/gui/PopUpWidget.cxx +++ b/src/gui/PopUpWidget.cxx @@ -248,7 +248,6 @@ void PopUpWidget::drawWidget(bool hilite) // Fill the background s.fillRect(x + 1, _y + 1, w - 17, _h - 2, kWidColor); s.fillRect(x + w - 15, _y + 2, 13, _h - 4, isEnabled() && hilite ? kWidColor : kBGColorHi); - //s.vLine(x + w - 17, _y, _y + _h - 1, kShadowColor); // Draw an arrow pointing down at the right end to signal this is a dropdown/popup s.drawBitmap(down_arrow, x + w - 13, _y + myArrowsY + 1, !isEnabled() ? kColor : kTextColor, 9u, 8u); diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 9c839b363..274b47346 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -241,24 +241,31 @@ Widget* Widget::setFocusForChain(GuiObject* boss, WidgetArray& arr, return nullptr; else { - switch(direction) + int oldPos = pos; + do { - case -1: // previous widget - pos--; - if(pos < 0) - pos = size - 1; - break; + switch(direction) + { + case -1: // previous widget + pos--; + if(pos < 0) + pos = size - 1; + break; - case +1: // next widget - pos++; - if(pos >= size) - pos = 0; - break; + case +1: // next widget + pos++; + if(pos >= size) + pos = 0; + break; - default: - // pos already set + default: + // pos already set + break; + } + // break if all widgets should be disabled + if(oldPos == pos) break; - } + } while(!arr[pos]->isEnabled()); } // Now highlight the active widget