diff --git a/src/debugger/DebuggerParser.hxx b/src/debugger/DebuggerParser.hxx index 69926e544..30234bcbc 100644 --- a/src/debugger/DebuggerParser.hxx +++ b/src/debugger/DebuggerParser.hxx @@ -51,7 +51,7 @@ class DebuggerParser static inline string red(const string& msg = "") { - return char(kDbgChangedColor) + msg; + return char(kDbgColorRed) + msg; } static inline string inverse(const string& msg = "") { diff --git a/src/debugger/gui/DataGridWidget.cxx b/src/debugger/gui/DataGridWidget.cxx index 7d6f710b0..c4bbf0d6d 100644 --- a/src/debugger/gui/DataGridWidget.cxx +++ b/src/debugger/gui/DataGridWidget.cxx @@ -15,7 +15,6 @@ // this file, and for a DISCLAIMER OF ALL WARRANTIES. //============================================================================ -#include "OSystem.hxx" #include "Widget.hxx" #include "Dialog.hxx" #include "Font.hxx" @@ -599,22 +598,20 @@ void DataGridWidget::drawWidget(bool hilite) int x = _x + 4 + (col * _colWidth); int y = _y + 2 + (row * _rowHeight); int pos = row*_cols + col; - uInt32 color = kTextColor; + uInt32 textColor = kTextColor; // Draw the selected item inverted, on a highlighted background. if (_currentRow == row && _currentCol == col && _hasFocus && !_editMode) { s.fillRect(x - 4, y - 2, _colWidth+1, _rowHeight+1, kTextColorHi); -#ifdef FLAT_UI - color = kWidColor; -#endif + textColor = kTextColorInv; } if (_selectedItem == pos && _editMode) { adjustOffset(); - s.drawString(_font, editString(), x, y, _colWidth, color, + s.drawString(_font, editString(), x, y, _colWidth, textColor, TextAlign::Left, -_editScrollOffset, false); } else @@ -624,14 +621,14 @@ void DataGridWidget::drawWidget(bool hilite) s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, kDbgChangedColor); if(_hiliteList[pos]) - color = kDbgColorHi; + textColor = kDbgColorHi; else - color = kDbgChangedTextColor; + textColor = kDbgChangedTextColor; } else if(_hiliteList[pos]) - color = kDbgColorHi; + textColor = kDbgColorHi; - s.drawString(_font, _valueStringList[pos], x, y, _colWidth, color); + s.drawString(_font, _valueStringList[pos], x, y, _colWidth, textColor); } } } diff --git a/src/debugger/gui/RomListWidget.cxx b/src/debugger/gui/RomListWidget.cxx index a99987f16..e20c28841 100644 --- a/src/debugger/gui/RomListWidget.cxx +++ b/src/debugger/gui/RomListWidget.cxx @@ -474,6 +474,8 @@ void RomListWidget::drawWidget(bool hilite) xpos = _x + CheckboxWidget::boxSize() + 10; ypos = _y + 2; for (i = 0, pos = _currentPos; i < _rows && pos < len; i++, pos++, ypos += _fontHeight) { + uInt32 bytesColor = kTextColor; + // Draw checkboxes for correct lines (takes scrolling into account) myCheckList[i]->setState(myBPState->isSet(dlist[pos].address)); myCheckList[i]->setDirty(); @@ -484,10 +486,13 @@ void RomListWidget::drawWidget(bool hilite) s.frameRect(_x + l.x() - 3, ypos - 1, _w - l.x(), _fontHeight, kTextColorHi); // Draw the selected item inverted, on a highlighted background. - if (_selectedItem == pos && _hasFocus) + if(_selectedItem == pos && _hasFocus) { - if (!_editMode) + if(!_editMode) + { s.fillRect(_x + r.x() - 3, ypos - 1, r.width(), _fontHeight, kTextColorHi); + bytesColor = kTextColorInv; + } else s.frameRect(_x + r.x() - 3, ypos - 1, r.width(), _fontHeight, kTextColorHi); } @@ -535,7 +540,7 @@ void RomListWidget::drawWidget(bool hilite) } else { - s.drawString(_font, dlist[pos].bytes, _x + r.x(), ypos, r.width(), kTextColor); + s.drawString(_font, dlist[pos].bytes, _x + r.x(), ypos, r.width(), bytesColor); } } } diff --git a/src/debugger/gui/ToggleBitWidget.cxx b/src/debugger/gui/ToggleBitWidget.cxx index ef0c5c089..b42d98563 100644 --- a/src/debugger/gui/ToggleBitWidget.cxx +++ b/src/debugger/gui/ToggleBitWidget.cxx @@ -89,13 +89,17 @@ void ToggleBitWidget::drawWidget(bool hilite) { for (col = 0; col < _cols; col++) { + uInt32 textColor = kTextColor; int x = _x + 4 + (col * _colWidth); int y = _y + 2 + (row * _rowHeight); int pos = row*_cols + col; // Draw the selected item inverted, on a highlighted background. - if (_currentRow == row && _currentCol == col && _hasFocus) - s.fillRect(x - 4, y - 2, _colWidth+1, _rowHeight+1, kTextColorHi); + if(_currentRow == row && _currentCol == col && _hasFocus) + { + s.fillRect(x - 4, y - 2, _colWidth + 1, _rowHeight + 1, kTextColorHi); + textColor = kTextColorInv; + } if(_stateList[pos]) buffer = _onList[pos]; @@ -111,7 +115,7 @@ void ToggleBitWidget::drawWidget(bool hilite) s.drawString(_font, buffer, x, y, _colWidth, kDbgChangedTextColor); } else - s.drawString(_font, buffer, x, y, _colWidth, kTextColor); + s.drawString(_font, buffer, x, y, _colWidth, textColor); } else { diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index c444fc0e3..e2fd2afa5 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -913,71 +913,71 @@ void FrameBuffer::VideoModeList::setZoom(uInt32 zoom) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* Palette is defined as follows: - // Base colors + *** Base colors *** kColor Normal foreground color (non-text) kBGColor Normal background color (non-text) kBGColorLo Disabled background color dark (non-text) kBGColorHi Disabled background color light (non-text) kShadowColor Item is disabled + *** Text colors *** kTextColor Normal text color kTextColorHi Highlighted text color kTextColorEm Emphasized text color - - // UI elements (dialog and widgets) + kTextColorSel Color for selected text + *** UI elements (dialog and widgets) *** kDlgColor Dialog background kWidColor Widget background kWidFrameColor Border for currently selected widget - - // Button colors + *** Button colors *** kBtnColor Normal button background kBtnColorHi Highlighted button background kBtnTextColor Normal button font color kBtnTextColorHi Highlighted button font color - - // Checkbox colors + *** Checkbox colors *** kCheckColor Color of 'X' in checkbox - - // Scrollbar colors + *** Scrollbar colors *** kScrollColor Normal scrollbar color kScrollColorHi Highlighted scrollbar color - - // Slider colors + *** Slider colors *** kSliderColor, kSliderColorHi - - // Debugger colors + *** Debugger colors *** kDbgChangedColor Background color for changed cells kDbgChangedTextColor Text color for changed cells kDbgColorHi Highlighted color in debugger data cells + kDbgColorRed Red color in debugger */ uInt32 FrameBuffer::ourGUIColors[3][kNumColors-256] = { // Standard - { 0x686868, 0x000000, 0xa38c61, 0xdccfa5, 0x404040, 0x000000, 0x62a108, 0x9f0000, + { 0x686868, 0x000000, 0xa38c61, 0xdccfa5, 0x404040, + 0x000000, 0x62a108, 0x9f0000, 0x000000, 0xc9af7c, 0xf0f0cf, 0xc80000, 0xac3410, 0xd55941, 0xffffff, 0xffd652, 0xac3410, 0xac3410, 0xd55941, 0xac3410, 0xd55941, - 0xc80000, 0x00ff00, 0xc8c8ff + 0xc80000, 0x00ff00, 0xc8c8ff, 0xc80000, }, // Classic - { 0x686868, 0x000000, 0x404040, 0x404040, 0x404040, 0x20a020, 0x00ff00, 0xc80000, + { 0x686868, 0x000000, 0x404040, 0x404040, 0x404040, + 0x20a020, 0x00ff00, 0xc80000, 0x20a020, 0x000000, 0x000000, 0xc80000, 0x000000, 0x000000, 0x20a020, 0x00ff00, 0x20a020, 0x20a020, 0x00ff00, 0x20a020, 0x00ff00, - 0xc80000, 0x00ff00, 0xc8c8ff + 0xc80000, 0x00ff00, 0xc8c8ff, 0xc80000 }, // Light { - 0x686868, 0x000000, 0xc0c0c0, 0xe1e1e1, 0x333333, 0x000000, 0x0078d7, 0x0078d7, // base - 0xf0f0f0, 0xffffff, 0x0f0f0f, // elements - 0xe1e1e1, 0xe5f1fb, 0x202020, 0x000000, // buttons - 0x333333, // checkbox - 0x808080, 0x0078d7, // scrollbar - 0x333333, 0x0078d7, // slider - 0x800000, 0xffff80, 0x00e0e0 // debugger + 0x686868, 0x000000, 0xc0c0c0, 0xe1e1e1, 0x333333, // base + 0x000000, 0x0078d7, 0x0078d7, 0xffffff, // text + 0xf0f0f0, 0xffffff, 0x0f0f0f, // elements + 0xe1e1e1, 0xe5f1fb, 0x202020, 0x000000, // buttons + 0x333333, // checkbox + 0x808080, 0x0078d7, // scrollbar + 0x333333, 0x0078d7, // slider + 0xffc0c0, 0x000000, 0xe00000, 0x800000 // debugger } }; diff --git a/src/emucore/FrameBufferConstants.hxx b/src/emucore/FrameBufferConstants.hxx index dee88fdd0..769e25f14 100644 --- a/src/emucore/FrameBufferConstants.hxx +++ b/src/emucore/FrameBufferConstants.hxx @@ -50,6 +50,7 @@ enum { kTextColor, kTextColorHi, kTextColorEm, + kTextColorInv, kDlgColor, kWidColor, kWidFrameColor, @@ -65,6 +66,7 @@ enum { kDbgChangedColor, kDbgChangedTextColor, kDbgColorHi, + kDbgColorRed, kNumColors }; diff --git a/src/gui/CheckListWidget.cxx b/src/gui/CheckListWidget.cxx index b50ef9699..0836b5a1c 100644 --- a/src/gui/CheckListWidget.cxx +++ b/src/gui/CheckListWidget.cxx @@ -100,15 +100,19 @@ void CheckListWidget::drawWidget(bool hilite) _checkList[i]->draw(); const int y = _y + 2 + _fontHeight * i + 2; + uInt32 textColor = kTextColor; GUI::Rect r(getEditRect()); // Draw the selected item inverted, on a highlighted background. if (_selectedItem == pos) { - if (_hasFocus && !_editMode) + if(_hasFocus && !_editMode) + { s.fillRect(_x + r.left - 3, _y + 1 + _fontHeight * i, _w - r.left, _fontHeight, kTextColorHi); + textColor = kTextColorInv; + } else s.frameRect(_x + r.left - 3, _y + 1 + _fontHeight * i, _w - r.left, _fontHeight, kTextColorHi); @@ -117,20 +121,11 @@ void CheckListWidget::drawWidget(bool hilite) if (_selectedItem == pos && _editMode) { adjustOffset(); -#ifndef FLAT_UI s.drawString(_font, editString(), _x + r.left, y, r.width(), kTextColor, TextAlign::Left, -_editScrollOffset, false); } else - s.drawString(_font, _list[pos], _x + r.left, y, r.width(), kTextColor); -#else - s.drawString(_font, editString(), _x + r.left, y, r.width(), kTextColor, - TextAlign::Left, -_editScrollOffset, false); - } - else - s.drawString(_font, _list[pos], _x + r.left, y, r.width(), - _selectedItem == pos && hilite && _hasFocus && !_editMode ? kWidColor : kTextColor); -#endif + s.drawString(_font, _list[pos], _x + r.left, y, r.width(), textColor); } // Only draw the caret while editing, and if it's in the current viewport diff --git a/src/gui/StringListWidget.cxx b/src/gui/StringListWidget.cxx index a2161e101..44b9e5f4f 100644 --- a/src/gui/StringListWidget.cxx +++ b/src/gui/StringListWidget.cxx @@ -54,12 +54,16 @@ void StringListWidget::drawWidget(bool hilite) for (i = 0, pos = _currentPos; i < _rows && pos < len; i++, pos++) { const int y = _y + 2 + _fontHeight * i; + uInt32 textColor = kTextColor; // Draw the selected item inverted, on a highlighted background. if (_selectedItem == pos && _hilite) { - if (_hasFocus && !_editMode) + if(_hasFocus && !_editMode) + { s.fillRect(_x + 1, _y + 1 + _fontHeight * i, _w - 1, _fontHeight, kTextColorHi); + textColor = kTextColorInv; + } else s.frameRect(_x + 1, _y + 1 + _fontHeight * i, _w - 1, _fontHeight, kTextColorHi); } @@ -68,20 +72,12 @@ void StringListWidget::drawWidget(bool hilite) if (_selectedItem == pos && _editMode) { adjustOffset(); -#ifndef FLAT_UI - s.drawString(_font, editString(), _x + r.left, y, r.width(), kTextColor, + + s.drawString(_font, editString(), _x + r.left, y, r.width(), textColor, TextAlign::Left, -_editScrollOffset, false); } else - s.drawString(_font, _list[pos], _x + r.left, y, r.width(), kTextColor); -#else - s.drawString(_font, editString(), _x + r.left, y, r.width(), kTextColor, - TextAlign::Left, -_editScrollOffset, false); - } - else - s.drawString(_font, _list[pos], _x + r.left, y, r.width(), - _selectedItem == pos && _hilite && _hasFocus && !_editMode ? kWidColor : kTextColor); -#endif + s.drawString(_font, _list[pos], _x + r.left, y, r.width(), textColor); } // Only draw the caret while editing, and if it's in the current viewport diff --git a/src/windows/Stella.vcxproj b/src/windows/Stella.vcxproj index c63e35bdd..37c361957 100644 --- a/src/windows/Stella.vcxproj +++ b/src/windows/Stella.vcxproj @@ -111,7 +111,7 @@ /MP /std:c++latest %(AdditionalOptions) Disabled ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories) - FLAT_UI;BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) + BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDLL @@ -142,7 +142,7 @@ /MP /std:c++latest %(AdditionalOptions) Disabled ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories) - FLAT_UI;BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) + BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDLL @@ -171,7 +171,7 @@ true false ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories) - FLAT_UI;BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) + BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) MultiThreadedDLL false @@ -204,7 +204,7 @@ Default true ..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories) - FLAT_UI;BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) + BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions) MultiThreadedDLL false