diff --git a/src/debugger/gui/AudioWidget.cxx b/src/debugger/gui/AudioWidget.cxx index 8d2a7315c..b22d74d1a 100644 --- a/src/debugger/gui/AudioWidget.cxx +++ b/src/debugger/gui/AudioWidget.cxx @@ -45,7 +45,7 @@ AudioWidget::AudioWidget(GuiObject* boss, const GUI::Font& lfont, 2, 1, 2, 5, Common::Base::F_16); myAudF->setTarget(this); myAudF->setID(kAUDFID); - myAudF->setEditable(false, true); + myAudF->setEditable(false); addFocusWidget(myAudF); for(int col = 0; col < 2; ++col) @@ -65,7 +65,7 @@ AudioWidget::AudioWidget(GuiObject* boss, const GUI::Font& lfont, 2, 1, 2, 4, Common::Base::F_16); myAudC->setTarget(this); myAudC->setID(kAUDCID); - myAudC->setEditable(false, true); + myAudC->setEditable(false); addFocusWidget(myAudC); // AudV registers @@ -77,7 +77,7 @@ AudioWidget::AudioWidget(GuiObject* boss, const GUI::Font& lfont, 2, 1, 2, 4, Common::Base::F_16); myAudV->setTarget(this); myAudV->setID(kAUDVID); - myAudV->setEditable(false, true); + myAudV->setEditable(false); addFocusWidget(myAudV); } diff --git a/src/debugger/gui/DataGridWidget.cxx b/src/debugger/gui/DataGridWidget.cxx index 4b1d05ae9..3bcee53b0 100644 --- a/src/debugger/gui/DataGridWidget.cxx +++ b/src/debugger/gui/DataGridWidget.cxx @@ -178,6 +178,13 @@ void DataGridWidget::setList(int a, int v) setList(alist, vlist, changed); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void DataGridWidget::setEditable(bool editable, bool hiliteBG) +{ + // Override parent method; enable hilite when widget is not editable + EditableWidget::setEditable(editable, hiliteBG); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void DataGridWidget::setHiliteList(const BoolArray& hilitelist) { diff --git a/src/debugger/gui/DataGridWidget.hxx b/src/debugger/gui/DataGridWidget.hxx index a6e0071a7..2016ce4d6 100644 --- a/src/debugger/gui/DataGridWidget.hxx +++ b/src/debugger/gui/DataGridWidget.hxx @@ -54,6 +54,8 @@ class DataGridWidget : public EditableWidget void setList(int a, int v, bool changed); void setList(int a, int v); // automatically calculate if changed + void setEditable(bool editable, bool hiliteBG = true) override; + void setHiliteList(const BoolArray& hilitelist); void setNumRows(int rows); diff --git a/src/debugger/gui/RiotWidget.cxx b/src/debugger/gui/RiotWidget.cxx index dc93c590b..95a8be853 100644 --- a/src/debugger/gui/RiotWidget.cxx +++ b/src/debugger/gui/RiotWidget.cxx @@ -121,7 +121,7 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont, xpos += t->getWidth() + 5; myTimRead = new DataGridWidget(boss, nfont, xpos, ypos, 1, 4, 8, 32, Common::Base::F_16); myTimRead->setTarget(this); - myTimRead->setEditable(false, true); + myTimRead->setEditable(false); // Controller ports const RiotDebug& riot = instance().debugger().riotDebug(); @@ -143,7 +143,7 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont, xpos += 6*fontWidth + 5; myLeftINPT = new DataGridWidget(boss, nfont, xpos, ypos, 1, 3, 2, 8, Common::Base::F_16); myLeftINPT->setTarget(this); - myLeftINPT->setEditable(false, true); + myLeftINPT->setEditable(false); // TIA INPTx registers (R), right port const char* contRightReadNames[] = { "INPT2:", "INPT3:", "INPT5:" }; @@ -156,7 +156,7 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont, xpos += 6*fontWidth + 5; myRightINPT = new DataGridWidget(boss, nfont, xpos, ypos, 1, 3, 2, 8, Common::Base::F_16); myRightINPT->setTarget(this); - myRightINPT->setEditable(false, true); + myRightINPT->setEditable(false); // TIA INPTx VBLANK bits (D6-latch, D7-dump) (R) xpos = col + 20; ypos += myLeftINPT->getHeight() + lineHeight; diff --git a/src/gui/EditableWidget.hxx b/src/gui/EditableWidget.hxx index 3fb35c5dd..a25de9bb6 100644 --- a/src/gui/EditableWidget.hxx +++ b/src/gui/EditableWidget.hxx @@ -52,7 +52,7 @@ class EditableWidget : public Widget, public CommandSender const string& getText() const { return _editString; } bool isEditable() const { return _editable; } - void setEditable(bool editable, bool hiliteBG = false); + virtual void setEditable(bool editable, bool hiliteBG = false); bool handleText(char text) override; bool handleKeyDown(StellaKey key, StellaMod mod) override;