renamed Menu class into OptionsMenu

This commit is contained in:
Thomas Jentzsch 2021-09-10 22:16:19 +02:00
parent 98828e8368
commit 4ace2c6eea
22 changed files with 69 additions and 70 deletions

View File

@ -4358,7 +4358,7 @@
</tr>
<tr>
<td>Randomize TIA</td>
<td>Randomizes TIA registers on the startup</td>
<td>Randomize TIA registers when loading a ROM</td>
<td>-plr.tiarandom<br/>-dev.tiarandom</td>
</tr>
<tr>

View File

@ -285,7 +285,7 @@ void DebuggerDialog::handleCommand(CommandSender* sender, int cmd,
getDynamicBounds(w, h);
myOptions = make_unique<OptionsDialog>(instance(), parent(), this, w, h,
Menu::AppMode::debugger);
OptionsMenu::AppMode::debugger);
}
myOptions->open();

View File

@ -58,7 +58,7 @@
#include "DebuggerParser.hxx"
#endif
#ifdef GUI_SUPPORT
#include "Menu.hxx"
#include "OptionsMenu.hxx"
#include "CommandMenu.hxx"
#include "HighScoresMenu.hxx"
#include "MessageMenu.hxx"
@ -3034,7 +3034,7 @@ void EventHandler::setState(EventHandlerState state)
#ifdef GUI_SUPPORT
case EventHandlerState::OPTIONSMENU:
myOverlay = &myOSystem.menu();
myOverlay = &myOSystem.optionsMenu();
enableTextEvents(true);
break;
@ -3083,11 +3083,11 @@ void EventHandler::setState(EventHandlerState state)
}
// Inform various subsystems about the new state
myOSystem.stateChanged(myState);
myOSystem.frameBuffer().stateChanged(myState);
myOSystem.frameBuffer().setCursorState();
myOSystem.stateChanged(myState); // does nothing
myOSystem.frameBuffer().stateChanged(myState); // ignores state
myOSystem.frameBuffer().setCursorState(); // en/disables cursor for UI and emulation states
if(myOSystem.hasConsole())
myOSystem.console().stateChanged(myState);
myOSystem.console().stateChanged(myState); // does nothing
// Sometimes an extraneous mouse motion event is generated
// after a state change, which should be supressed

View File

@ -51,7 +51,7 @@
#include "ConsoleFont.hxx"
#include "ConsoleBFont.hxx"
#include "Launcher.hxx"
#include "Menu.hxx"
#include "OptionsMenu.hxx"
#include "CommandMenu.hxx"
#include "HighScoresMenu.hxx"
#include "MessageMenu.hxx"
@ -379,19 +379,19 @@ void FrameBuffer::update(UpdateMode mode)
#ifdef GUI_SUPPORT
case EventHandlerState::OPTIONSMENU:
{
myOSystem.menu().tick();
redraw |= myOSystem.menu().needsRedraw();
myOSystem.optionsMenu().tick();
redraw |= myOSystem.optionsMenu().needsRedraw();
if(redraw)
{
clear();
myTIASurface->render(true);
myOSystem.menu().draw(forceRedraw);
myOSystem.optionsMenu().draw(forceRedraw);
}
else if(rerender)
{
clear();
myTIASurface->render(true);
myOSystem.menu().render();
myOSystem.optionsMenu().render();
}
break; // EventHandlerState::OPTIONSMENU
}

View File

@ -31,7 +31,7 @@
#include "Debugger.hxx"
#endif
#ifdef GUI_SUPPORT
#include "Menu.hxx"
#include "OptionsMenu.hxx"
#include "CommandMenu.hxx"
#include "HighScoresMenu.hxx"
#include "MessageMenu.hxx"
@ -177,7 +177,7 @@ bool OSystem::initialize(const Settings::Options& options)
#ifdef GUI_SUPPORT
// Create various subsystems (menu and launcher GUI objects, etc)
myMenu = make_unique<Menu>(*this);
myOptionsMenu = make_unique<OptionsMenu>(*this);
myCommandMenu = make_unique<CommandMenu>(*this);
myHighScoresManager = make_unique<HighScoresManager>(*this);
myHighScoresMenu = make_unique<HighScoresMenu>(*this);

View File

@ -40,7 +40,7 @@ class AudioSettings;
class CommandMenu;
class HighScoresMenu;
class Launcher;
class Menu;
class OptionsMenu;
class MessageMenu;
class PlusRomsMenu;
class TimeMachine;
@ -200,11 +200,11 @@ class OSystem
#ifdef GUI_SUPPORT
/**
Get the settings menu of the system.
Get the option menu of the system.
@return The settings menu object
@return The option menu object
*/
Menu& menu() const { return *myMenu; }
OptionsMenu& optionsMenu() const { return *myOptionsMenu; }
/**
Get the command menu of the system.
@ -516,8 +516,8 @@ class OSystem
#endif
#ifdef GUI_SUPPORT
// Pointer to the Menu object
unique_ptr<Menu> myMenu;
// Pointer to the OptionMenu object
unique_ptr<OptionsMenu> myOptionsMenu;
// Pointer to the CommandMenu object
unique_ptr<CommandMenu> myCommandMenu;

View File

@ -23,7 +23,7 @@
#include "FrameBuffer.hxx"
#include "FBSurface.hxx"
#include "Font.hxx"
#include "Menu.hxx"
#include "OptionsMenu.hxx"
#include "Dialog.hxx"
#include "Widget.hxx"
#include "TabWidget.hxx"

View File

@ -98,7 +98,7 @@ static constexpr std::array<uInt32, BUTTON_GFX_H_LARGE> NEXT_GFX_LARGE = {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
HighScoresDialog::HighScoresDialog(OSystem& osystem, DialogContainer& parent,
int max_w, int max_h,
Menu::AppMode mode)
OptionsMenu::AppMode mode)
: Dialog(osystem, parent, osystem.frameBuffer().font(), "High Scores"),
_max_w{max_w},
_max_h{max_h},
@ -219,7 +219,7 @@ HighScoresDialog::~HighScoresDialog()
void HighScoresDialog::loadConfig()
{
// Enable blending (only once is necessary)
if (myMode == Menu::AppMode::emulator && !surface().attributes().blending)
if (myMode == OptionsMenu::AppMode::emulator && !surface().attributes().blending)
{
surface().attributes().blending = true;
surface().attributes().blendalpha = 90;
@ -314,7 +314,7 @@ void HighScoresDialog::handleCommand(CommandSender* sender, int cmd, int data, i
saveConfig();
[[fallthrough]];
case kCloseCmd:
if(myMode != Menu::AppMode::emulator)
if(myMode != OptionsMenu::AppMode::emulator)
close();
else
instance().eventHandler().leaveMenuMode();

View File

@ -28,7 +28,7 @@ namespace GUI {
}
class Serializer;
#include "Menu.hxx"
#include "OptionsMenu.hxx"
#include "Dialog.hxx"
#include "HighScoresManager.hxx"
#include "json_lib.hxx"
@ -47,7 +47,7 @@ class HighScoresDialog : public Dialog
static constexpr uInt32 NUM_RANKS = 10;
HighScoresDialog(OSystem& osystem, DialogContainer& parent,
int max_w, int max_h, Menu::AppMode mode);
int max_w, int max_h, OptionsMenu::AppMode mode);
~HighScoresDialog() override;
protected:
@ -110,7 +110,7 @@ class HighScoresDialog : public Dialog
StaticTextWidget* myMD5Widget{nullptr};
StaticTextWidget* myCheckSumWidget{nullptr};
Menu::AppMode myMode{Menu::AppMode::emulator};
OptionsMenu::AppMode myMode{OptionsMenu::AppMode::emulator};
private:
// Following constructors and assignment operators not supported

View File

@ -38,7 +38,7 @@ Dialog* HighScoresMenu::baseDialog()
if (myHighScoresDialog == nullptr)
myHighScoresDialog = new HighScoresDialog(myOSystem, *this,
FBMinimum::Width, FBMinimum::Height,
Menu::AppMode::emulator);
OptionsMenu::AppMode::emulator);
return myHighScoresDialog;
}

View File

@ -926,10 +926,10 @@ void LauncherDialog::openSettings()
// Create an options dialog, similar to the in-game one
if (instance().settings().getBool("basic_settings"))
myDialog = make_unique<StellaSettingsDialog>(instance(), parent(),
_w, _h, Menu::AppMode::launcher);
_w, _h, OptionsMenu::AppMode::launcher);
else
myDialog = make_unique<OptionsDialog>(instance(), parent(), this, _w, _h,
Menu::AppMode::launcher);
OptionsMenu::AppMode::launcher);
myDialog->open();
}
@ -938,7 +938,7 @@ void LauncherDialog::openHighScores()
{
// Create an high scores dialog, similar to the in-game one
myDialog = make_unique<HighScoresDialog>(instance(), parent(), _w, _h,
Menu::AppMode::launcher);
OptionsMenu::AppMode::launcher);
myDialog->open();
}

View File

@ -321,14 +321,14 @@ void MinUICommandDialog::openSettings()
if (instance().settings().getBool("basic_settings"))
{
myDialog = make_unique<StellaSettingsDialog>(instance(), parent(),
1280, 720, Menu::AppMode::launcher);
1280, 720, OptionsMenu::AppMode::launcher);
myDialog->open();
}
else
{
myDialog = make_unique<OptionsDialog>(instance(), parent(), this,
FBMinimum::Width, FBMinimum::Height,
Menu::AppMode::launcher);
OptionsMenu::AppMode::launcher);
myDialog->open();
}
}
@ -337,6 +337,6 @@ void MinUICommandDialog::openSettings()
void MinUICommandDialog::openHighscores()
{
myDialog = make_unique<HighScoresDialog>(instance(), parent(),
1280, 720, Menu::AppMode::emulator);
1280, 720, OptionsMenu::AppMode::emulator);
myDialog->open();
}

View File

@ -37,7 +37,7 @@
#include "OptionsDialog.hxx"
#include "Launcher.hxx"
#include "Settings.hxx"
#include "Menu.hxx"
#include "OptionsMenu.hxx"
#ifdef CHEATCODE_SUPPORT
#include "CheatCodeDialog.hxx"
@ -47,13 +47,13 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
GuiObject* boss, int max_w, int max_h, Menu::AppMode mode)
GuiObject* boss, int max_w, int max_h, OptionsMenu::AppMode mode)
: Dialog(osystem, parent, osystem.frameBuffer().font(), "Options"),
myBoss{boss},
myMode{mode}
{
// do not show basic settings options in debugger
bool minSettings = osystem.settings().getBool("minimal_ui") && mode != Menu::AppMode::debugger;
bool minSettings = osystem.settings().getBool("minimal_ui") && mode != OptionsMenu::AppMode::debugger;
const int buttonHeight = Dialog::buttonHeight(),
VBORDER = Dialog::vBorder(),
HBORDER = Dialog::hBorder(),
@ -138,7 +138,7 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
addToFocusList(wid);
// Certain buttons are disabled depending on mode
if(myMode == Menu::AppMode::launcher)
if(myMode == OptionsMenu::AppMode::launcher)
{
myCheatCodeButton->clearFlags(Widget::FLAG_ENABLED);
}
@ -186,7 +186,7 @@ void OptionsDialog::handleCommand(CommandSender* sender, int cmd,
case kBasSetCmd:
// enable basic settings
instance().settings().setValue("basic_settings", true);
if (myMode != Menu::AppMode::emulator)
if (myMode != OptionsMenu::AppMode::emulator)
close();
else
instance().eventHandler().leaveMenuMode();
@ -297,7 +297,7 @@ void OptionsDialog::handleCommand(CommandSender* sender, int cmd,
break;
case kExitCmd:
if(myMode != Menu::AppMode::emulator)
if(myMode != OptionsMenu::AppMode::emulator)
close();
else
instance().eventHandler().leaveMenuMode();

View File

@ -23,14 +23,14 @@ class DialogContainer;
class GuiObject;
class OSystem;
#include "Menu.hxx"
#include "OptionsMenu.hxx"
#include "Dialog.hxx"
class OptionsDialog : public Dialog
{
public:
OptionsDialog(OSystem& osystem, DialogContainer& parent, GuiObject* boss,
int max_w, int max_h, Menu::AppMode mode);
int max_w, int max_h, OptionsMenu::AppMode mode);
~OptionsDialog() override;
private:
@ -46,7 +46,7 @@ class OptionsDialog : public Dialog
GuiObject* myBoss{nullptr};
// Indicates if this dialog is used for global (vs. in-game) settings
Menu::AppMode myMode{Menu::AppMode::emulator};
OptionsMenu::AppMode myMode{OptionsMenu::AppMode::emulator};
enum {
kBasSetCmd = 'BAST',

View File

@ -22,23 +22,23 @@
#include "OSystem.hxx"
#include "FrameBuffer.hxx"
#include "bspf.hxx"
#include "Menu.hxx"
#include "OptionsMenu.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Menu::Menu(OSystem& osystem)
OptionsMenu::OptionsMenu(OSystem& osystem)
: DialogContainer(osystem)
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Menu::~Menu()
OptionsMenu::~OptionsMenu()
{
delete stellaSettingDialog; stellaSettingDialog = nullptr;
delete optionsDialog; optionsDialog = nullptr;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Dialog* Menu::baseDialog()
Dialog* OptionsMenu::baseDialog()
{
if (myOSystem.settings().getBool("basic_settings"))
{

View File

@ -15,8 +15,8 @@
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//============================================================================
#ifndef MENU_HXX
#define MENU_HXX
#ifndef OPTIONS_MENU_HXX
#define OPTIONS_MENU_HXX
class OSystem;
class StellaSettingsDialog;
@ -29,7 +29,7 @@ class OptionsDialog;
@author Stephen Anthony
*/
class Menu : public DialogContainer
class OptionsMenu : public DialogContainer
{
public:
// Current Stella mode
@ -38,8 +38,8 @@ class Menu : public DialogContainer
/**
Create a new menu stack
*/
explicit Menu(OSystem& osystem);
~Menu() override;
explicit OptionsMenu(OSystem& osystem);
~OptionsMenu() override;
private:
Dialog* baseDialog() override;
@ -48,11 +48,11 @@ class Menu : public DialogContainer
private:
// Following constructors and assignment operators not supported
Menu() = delete;
Menu(const Menu&) = delete;
Menu(Menu&&) = delete;
Menu& operator=(const Menu&) = delete;
Menu& operator=(Menu&&) = delete;
OptionsMenu() = delete;
OptionsMenu(const OptionsMenu&) = delete;
OptionsMenu(OptionsMenu&&) = delete;
OptionsMenu& operator=(const OptionsMenu&) = delete;
OptionsMenu& operator=(OptionsMenu&&) = delete;
};
#endif

View File

@ -30,7 +30,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StellaSettingsDialog::StellaSettingsDialog(OSystem& osystem, DialogContainer& parent,
int max_w, int max_h, Menu::AppMode mode)
int max_w, int max_h, OptionsMenu::AppMode mode)
: Dialog(osystem, parent, osystem.frameBuffer().font(), "Basic settings"),
myMode{mode}
{
@ -351,7 +351,7 @@ void StellaSettingsDialog::handleCommand(CommandSender* sender, int cmd,
saveConfig();
[[fallthrough]];
case GuiObject::kCloseCmd:
if (myMode != Menu::AppMode::emulator)
if (myMode != OptionsMenu::AppMode::emulator)
close();
else
instance().eventHandler().leaveMenuMode();
@ -363,7 +363,7 @@ void StellaSettingsDialog::handleCommand(CommandSender* sender, int cmd,
case kConfirmSwitchCmd:
instance().settings().setValue("basic_settings", false);
if (myMode != Menu::AppMode::emulator)
if (myMode != OptionsMenu::AppMode::emulator)
close();
else
instance().eventHandler().leaveMenuMode();

View File

@ -21,7 +21,7 @@
class PopUpWidget;
#include "Props.hxx"
#include "Menu.hxx"
#include "OptionsMenu.hxx"
#include "Dialog.hxx"
#if defined(RETRON77)
@ -39,7 +39,7 @@ class StellaSettingsDialog : public Dialog
{
public:
StellaSettingsDialog(OSystem& osystem, DialogContainer& parent,
int max_w, int max_h, Menu::AppMode mode);
int max_w, int max_h, OptionsMenu::AppMode mode);
~StellaSettingsDialog() override;
private:
@ -103,7 +103,7 @@ class StellaSettingsDialog : public Dialog
#endif
// Indicates if this dialog is used for global (vs. in-game) settings
Menu::AppMode myMode{Menu::AppMode::emulator};
OptionsMenu::AppMode myMode{OptionsMenu::AppMode::emulator};
enum {
kAdvancedSettings = 'SSad',

View File

@ -23,7 +23,6 @@
#include "Cart.hxx"
#include "CartDPC.hxx"
#include "Dialog.hxx"
#include "Menu.hxx"
#include "OSystem.hxx"
#include "EditTextWidget.hxx"
#include "PopUpWidget.hxx"

View File

@ -30,12 +30,12 @@ MODULE_OBJS := \
src/gui/Launcher.o \
src/gui/ListWidget.o \
src/gui/LoggerDialog.o \
src/gui/Menu.o \
src/gui/MessageBox.o \
src/gui/MessageDialog.o \
src/gui/MessageMenu.o \
src/gui/MinUICommandDialog.o\
src/gui/OptionsDialog.o \
src/gui/OptionMenu.o \
src/gui/PlusRomsMenu.o\
src/gui/PlusRomsSetupDialog.o\
src/gui/PopUpWidget.o \

View File

@ -981,7 +981,7 @@
<ClCompile Include="..\gui\Launcher.cxx" />
<ClCompile Include="..\gui\LauncherDialog.cxx" />
<ClCompile Include="..\gui\ListWidget.cxx" />
<ClCompile Include="..\gui\Menu.cxx" />
<ClCompile Include="..\gui\OptionsMenu.cxx" />
<ClCompile Include="..\gui\MessageBox.cxx" />
<ClCompile Include="..\gui\OptionsDialog.cxx" />
<ClCompile Include="..\gui\PopUpWidget.cxx" />
@ -2096,7 +2096,7 @@
<ClInclude Include="..\gui\Launcher.hxx" />
<ClInclude Include="..\gui\LauncherDialog.hxx" />
<ClInclude Include="..\gui\ListWidget.hxx" />
<ClInclude Include="..\gui\Menu.hxx" />
<ClInclude Include="..\gui\OptionsMenu.hxx" />
<ClInclude Include="..\gui\MessageBox.hxx" />
<ClInclude Include="..\gui\OptionsDialog.hxx" />
<ClInclude Include="..\gui\PopUpWidget.hxx" />

View File

@ -423,7 +423,7 @@
<ClCompile Include="..\gui\ListWidget.cxx">
<Filter>Source Files\gui</Filter>
</ClCompile>
<ClCompile Include="..\gui\Menu.cxx">
<ClCompile Include="..\gui\OptionsMenu.cxx">
<Filter>Source Files\gui</Filter>
</ClCompile>
<ClCompile Include="..\gui\MessageBox.cxx">
@ -1505,7 +1505,7 @@
<ClInclude Include="..\gui\ListWidget.hxx">
<Filter>Header Files\gui</Filter>
</ClInclude>
<ClInclude Include="..\gui\Menu.hxx">
<ClInclude Include="..\gui\OptionsMenu.hxx">
<Filter>Header Files\gui</Filter>
</ClInclude>
<ClInclude Include="..\gui\MessageBox.hxx">