diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx index 5cfbb87a1..bd6aadc51 100644 --- a/src/debugger/gui/DebuggerDialog.cxx +++ b/src/debugger/gui/DebuggerDialog.cxx @@ -66,7 +66,8 @@ DebuggerDialog::DebuggerDialog(OSystem& osystem, DialogContainer& parent, // Inform the TIA output widget about its associated zoom widget myTiaOutput->setZoomWidget(myTiaZoom); - myOptions = make_unique(osystem, parent, this, w, h, OptionsDialog::debugger); + myOptions = make_unique(osystem, parent, this, w, h, + OptionsDialog::AppMode::debugger); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/debugger/gui/RomListWidget.cxx b/src/debugger/gui/RomListWidget.cxx index 0d3f91f96..9e16eca4a 100644 --- a/src/debugger/gui/RomListWidget.cxx +++ b/src/debugger/gui/RomListWidget.cxx @@ -86,7 +86,7 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& lfont, CheckboxWidget::kCheckActionCmd); t->setTarget(this); t->setID(i); - t->setFill(CheckboxWidget::Circle); + t->setFill(CheckboxWidget::FillType::Circle); t->setTextColor(kTextColorEm); ypos += _fontHeight; diff --git a/src/gui/CheckListWidget.hxx b/src/gui/CheckListWidget.hxx index 964f80d6c..c1568e7a4 100644 --- a/src/gui/CheckListWidget.hxx +++ b/src/gui/CheckListWidget.hxx @@ -30,7 +30,6 @@ class CheckListWidget : public ListWidget { public: enum { kListItemChecked = 'LIct' /* checkbox toggled on current line*/ }; - enum CheckStyle { XFill, SolidFill }; public: CheckListWidget(GuiObject* boss, const GUI::Font& font, diff --git a/src/gui/DeveloperDialog.hxx b/src/gui/DeveloperDialog.hxx index 44201f325..b327a7697 100644 --- a/src/gui/DeveloperDialog.hxx +++ b/src/gui/DeveloperDialog.hxx @@ -78,11 +78,7 @@ class DeveloperDialog : public Dialog kDFontSizeChanged = 'UIfs', #endif }; - enum SettingsSet - { - player, - developer - }; + enum SettingsSet { player = 0, developer = 1 }; // MUST be aligned with RewindManager! static const int NUM_INTERVALS = 7; diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 32061b1a3..6d131133c 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -205,7 +205,8 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent, mySelectedItem = 0; // Highlight 'Rom Listing' // Create an options dialog, similar to the in-game one - myOptions = make_unique(osystem, parent, this, w, h, OptionsDialog::launcher); + myOptions = make_unique(osystem, parent, this, w, h, + OptionsDialog::AppMode::launcher); // Create a game list, which contains all the information about a ROM that // the launcher needs diff --git a/src/gui/Menu.cxx b/src/gui/Menu.cxx index a970b9a7d..d8baa83f0 100644 --- a/src/gui/Menu.cxx +++ b/src/gui/Menu.cxx @@ -26,5 +26,5 @@ Menu::Menu(OSystem& osystem) : DialogContainer(osystem) { myBaseDialog = new OptionsDialog(myOSystem, *this, nullptr, - FBMinimum::Width, FBMinimum::Height, OptionsDialog::emulator); + FBMinimum::Width, FBMinimum::Height, OptionsDialog::AppMode::emulator); } diff --git a/src/gui/OptionsDialog.cxx b/src/gui/OptionsDialog.cxx index efd7f3fd5..cb71b79e3 100644 --- a/src/gui/OptionsDialog.cxx +++ b/src/gui/OptionsDialog.cxx @@ -46,7 +46,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent, - GuiObject* boss, int max_w, int max_h, stellaMode mode) + GuiObject* boss, int max_w, int max_h, AppMode mode) : Dialog(osystem, parent, osystem.frameBuffer().font(), "Options"), myMode(mode) { @@ -139,7 +139,7 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent, addToFocusList(wid); // Certain buttons are disabled depending on mode - if(myMode == launcher) + if(myMode == AppMode::launcher) { myCheatCodeButton->clearFlags(WIDGET_ENABLED); } @@ -301,7 +301,7 @@ void OptionsDialog::handleCommand(CommandSender* sender, int cmd, break; case kExitCmd: - if(myMode != emulator) + if(myMode != AppMode::emulator) close(); else instance().eventHandler().leaveMenuMode(); diff --git a/src/gui/OptionsDialog.hxx b/src/gui/OptionsDialog.hxx index bcf20b139..2c4898754 100644 --- a/src/gui/OptionsDialog.hxx +++ b/src/gui/OptionsDialog.hxx @@ -44,15 +44,10 @@ class OptionsDialog : public Dialog { public: // Current Stella mode - enum stellaMode - { - launcher, - emulator, - debugger - }; + enum class AppMode { launcher, emulator, debugger }; OptionsDialog(OSystem& osystem, DialogContainer& parent, GuiObject* boss, - int max_w, int max_h, stellaMode mode); + int max_w, int max_h, AppMode mode); virtual ~OptionsDialog(); private: @@ -80,7 +75,7 @@ class OptionsDialog : public Dialog ButtonWidget* myCheatCodeButton; // Indicates if this dialog is used for global (vs. in-game) settings - stellaMode myMode; + AppMode myMode; enum { kVidCmd = 'VIDO', diff --git a/src/gui/RadioButtonWidget.cxx b/src/gui/RadioButtonWidget.cxx index 3d115e53b..3a94d80ab 100644 --- a/src/gui/RadioButtonWidget.cxx +++ b/src/gui/RadioButtonWidget.cxx @@ -110,7 +110,7 @@ RadioButtonWidget::RadioButtonWidget(GuiObject* boss, const GUI::Font& font, else // center text _textY = (14 - _font.getFontHeight()) / 2; - setFill(CheckboxWidget::Normal); + setFill(CheckboxWidget::FillType::Normal); myGroup->addWidget(this); } @@ -143,10 +143,10 @@ void RadioButtonWidget::setFill(FillType type) { switch(type) { - case CheckboxWidget::Normal: + case CheckboxWidget::FillType::Normal: _img = radio_img_active; break; - case CheckboxWidget::Inactive: + case CheckboxWidget::FillType::Inactive: _img = radio_img_inactive; break; default: diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 8acdbae4e..6889e456b 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -561,7 +561,7 @@ CheckboxWidget::CheckboxWidget(GuiObject* boss, const GUI::Font& font, else // center text _textY = (14 - _font.getFontHeight()) / 2; - setFill(CheckboxWidget::Normal); + setFill(CheckboxWidget::FillType::Normal); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -599,7 +599,7 @@ void CheckboxWidget::setEditable(bool editable) else { _bgcolor = kBGColorHi; - setFill(CheckboxWidget::Inactive); + setFill(CheckboxWidget::FillType::Inactive); } setDirty(); } @@ -609,15 +609,15 @@ void CheckboxWidget::setFill(FillType type) { switch(type) { - case CheckboxWidget::Normal: + case CheckboxWidget::FillType::Normal: _img = checked_img_active; _drawBox = true; break; - case CheckboxWidget::Inactive: + case CheckboxWidget::FillType::Inactive: _img = checked_img_inactive; _drawBox = true; break; - case CheckboxWidget::Circle: + case CheckboxWidget::FillType::Circle: _img = checked_img_circle; _drawBox = false; break; diff --git a/src/gui/Widget.hxx b/src/gui/Widget.hxx index 703d204bb..4a89b0744 100644 --- a/src/gui/Widget.hxx +++ b/src/gui/Widget.hxx @@ -264,7 +264,7 @@ class CheckboxWidget : public ButtonWidget { public: enum { kCheckActionCmd = 'CBAC' }; - enum FillType { Normal, Inactive, Circle }; + enum class FillType { Normal, Inactive, Circle }; public: CheckboxWidget(GuiObject* boss, const GUI::Font& font, int x, int y,