does NOT compile!

This commit is contained in:
Thomas Jentzsch 2021-08-31 17:04:27 +02:00
parent 79d40d52f8
commit 6c6cd52e42
10 changed files with 96 additions and 1 deletions

View File

@ -169,6 +169,7 @@ class Event
SALeftAxis0Value, SALeftAxis1Value, SARightAxis0Value, SARightAxis1Value, SALeftAxis0Value, SALeftAxis1Value, SARightAxis0Value, SARightAxis1Value,
QTPaddle3AFire, QTPaddle3BFire, QTPaddle4AFire, QTPaddle4BFire, QTPaddle3AFire, QTPaddle3BFire, QTPaddle4AFire, QTPaddle4BFire,
UIHelp, UIHelp,
InputTextDialogMode,
LastType LastType
}; };

View File

@ -2153,6 +2153,13 @@ bool EventHandler::changeStateByEvent(Event::Type type)
else else
handled = false; handled = false;
break; break;
case Event::InputTextDialogMode:
if(myState != EventHandlerState::INPUTMENU)
enterMenuMode(EventHandlerState::INPUTMENU);
else
leaveMenuMode();
break;
#endif #endif
case Event::TimeMachineMode: case Event::TimeMachineMode:
@ -2998,6 +3005,11 @@ void EventHandler::setState(EventHandlerState state)
enableTextEvents(true); enableTextEvents(true);
break; break;
case EventHandlerState::INPUTMENU:
myOverlay = &myOSystem.inputMenu();
enableTextEvents(true);
break;
case EventHandlerState::TIMEMACHINE: case EventHandlerState::TIMEMACHINE:
myOSystem.timeMachine().requestResize(); myOSystem.timeMachine().requestResize();
myOverlay = &myOSystem.timeMachine(); myOverlay = &myOSystem.timeMachine();

View File

@ -29,6 +29,7 @@ enum class EventHandlerState {
CMDMENU, CMDMENU,
HIGHSCORESMENU, HIGHSCORESMENU,
MESSAGEMENU, MESSAGEMENU,
INPUTMENU,
DEBUGGER, DEBUGGER,
NONE NONE
}; };

View File

@ -55,6 +55,7 @@
#include "CommandMenu.hxx" #include "CommandMenu.hxx"
#include "HighScoresMenu.hxx" #include "HighScoresMenu.hxx"
#include "MessageMenu.hxx" #include "MessageMenu.hxx"
#include "InputMenu.hxx"
#include "TimeMachine.hxx" #include "TimeMachine.hxx"
#endif #endif
@ -446,6 +447,19 @@ void FrameBuffer::update(UpdateMode mode)
break; // EventHandlerState::MESSAGEMENU break; // EventHandlerState::MESSAGEMENU
} }
case EventHandlerState::INPUTMENU:
{
myOSystem.inputMenu().tick();
redraw |= myOSystem.inputMenu().needsRedraw();
if(redraw)
{
clear();
myTIASurface->render(true);
myOSystem.inputMenu().draw(forceRedraw);
}
break; // EventHandlerState::INPUTMENU
}
case EventHandlerState::TIMEMACHINE: case EventHandlerState::TIMEMACHINE:
{ {
myOSystem.timeMachine().tick(); myOSystem.timeMachine().tick();

View File

@ -35,6 +35,7 @@
#include "CommandMenu.hxx" #include "CommandMenu.hxx"
#include "HighScoresMenu.hxx" #include "HighScoresMenu.hxx"
#include "MessageMenu.hxx" #include "MessageMenu.hxx"
#include "InputMenu.hxx"
#include "Launcher.hxx" #include "Launcher.hxx"
#include "TimeMachine.hxx" #include "TimeMachine.hxx"
#include "Widget.hxx" #include "Widget.hxx"
@ -181,6 +182,7 @@ bool OSystem::initialize(const Settings::Options& options)
myHighScoresManager = make_unique<HighScoresManager>(*this); myHighScoresManager = make_unique<HighScoresManager>(*this);
myHighScoresMenu = make_unique<HighScoresMenu>(*this); myHighScoresMenu = make_unique<HighScoresMenu>(*this);
myMessageMenu = make_unique<MessageMenu>(*this); myMessageMenu = make_unique<MessageMenu>(*this);
myInputMenu = make_unique<InputMenu>(*this);
myTimeMachine = make_unique<TimeMachine>(*this); myTimeMachine = make_unique<TimeMachine>(*this);
myLauncher = make_unique<Launcher>(*this); myLauncher = make_unique<Launcher>(*this);
@ -506,6 +508,39 @@ string OSystem::createConsole(const FilesystemNode& rom, const string& md5sum,
<< " - " << myConsole->getFormatString(); << " - " << myConsole->getFormatString();
myFrameBuffer->showTextMessage(msg.str()); myFrameBuffer->showTextMessage(msg.str());
} }
// Check for first PlusROM start
if(true)
// myConsole->cartridge().plusROM().isvalid() && Settings
{
//myEventHandler->changeStateByEvent(Event::OptionsMenuMode);
myEventHandler->changeStateByEvent(Event::InputTextDialogMode);
//TODO: Event::InputTextDialogMode
/*
// Inputbox which will pop up when searching RAM
StringList labels = {"Value"};
myInputBox = make_unique<InputTextDialog>(boss, lfont, nfont, labels, " ");
myInputBox->setTarget(this);
// Add inputbox in the middle of the RAM widget
uInt32 x = getAbsX() + ((getWidth() - myInputBox->getWidth()) >> 1);
uInt32 y = getAbsY() + ((getHeight() - myInputBox->getHeight()) >> 1);
myInputBox->show(x, y, dialog().surface().dstRect());
myInputBox->setText("");
myInputBox->setMessage("");
myInputBox->setToolTip(cmd == kSValEntered
? "Enter search value (leave blank for all)."
: "Enter relative or absolute value\nto compare with searched values.");
myInputBox->setFocus(0);
myInputBox->setEmitSignal(cmd);
myInputBox->setTitle(cmd == kSValEntered ? "Search" : "Compare");
*/
}
} }
return EmptyString; return EmptyString;

View File

@ -42,6 +42,7 @@ class AudioSettings;
class Launcher; class Launcher;
class Menu; class Menu;
class MessageMenu; class MessageMenu;
class InputMenu;
class TimeMachine; class TimeMachine;
class VideoAudioDialog; class VideoAudioDialog;
#endif #endif
@ -226,6 +227,13 @@ class OSystem
*/ */
MessageMenu& messageMenu() const { return *myMessageMenu; } MessageMenu& messageMenu() const { return *myMessageMenu; }
/**
Get the input menu of the system.
@return The input menu object
*/
InputMenu& inputMenu() const { return *myInputMenu; }
/** /**
Get the ROM launcher of the system. Get the ROM launcher of the system.
@ -523,6 +531,9 @@ class OSystem
// Pointer to the MessageMenu object // Pointer to the MessageMenu object
unique_ptr<MessageMenu> myMessageMenu; unique_ptr<MessageMenu> myMessageMenu;
// Pointer to the InputMenu object
unique_ptr<InputMenu> myInputMenu;
// Pointer to the TimeMachine object // Pointer to the TimeMachine object
unique_ptr<TimeMachine> myTimeMachine; unique_ptr<TimeMachine> myTimeMachine;
#endif #endif

View File

@ -46,6 +46,16 @@ InputTextDialog::InputTextDialog(GuiObject* boss, const GUI::Font& lfont,
initialize(lfont, nfont, labels); initialize(lfont, nfont, labels);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
InputTextDialog::InputTextDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, const StringList& labels, const string& title)
: Dialog(osystem, parent, font, title),
CommandSender(nullptr)
{
initialize(font, font, labels);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void InputTextDialog::initialize(const GUI::Font& lfont, const GUI::Font& nfont, void InputTextDialog::initialize(const GUI::Font& lfont, const GUI::Font& nfont,
const StringList& labels) const StringList& labels)

View File

@ -34,6 +34,9 @@ class InputTextDialog : public Dialog, public CommandSender
InputTextDialog(GuiObject* boss, const GUI::Font& lfont, InputTextDialog(GuiObject* boss, const GUI::Font& lfont,
const GUI::Font& nfont, const StringList& labels, const GUI::Font& nfont, const StringList& labels,
const string& title = ""); const string& title = "");
InputTextDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font,
const StringList& labels, const string& title = "");
~InputTextDialog() override = default; ~InputTextDialog() override = default;
/** Place the input dialog onscreen and center it */ /** Place the input dialog onscreen and center it */

View File

@ -797,6 +797,7 @@
<ClCompile Include="..\gui\FileListWidget.cxx" /> <ClCompile Include="..\gui\FileListWidget.cxx" />
<ClCompile Include="..\gui\HighScoresDialog.cxx" /> <ClCompile Include="..\gui\HighScoresDialog.cxx" />
<ClCompile Include="..\gui\HighScoresMenu.cxx" /> <ClCompile Include="..\gui\HighScoresMenu.cxx" />
<ClCompile Include="..\gui\InputMenu.cxx" />
<ClCompile Include="..\gui\JoystickDialog.cxx" /> <ClCompile Include="..\gui\JoystickDialog.cxx" />
<ClCompile Include="..\gui\LoggerDialog.cxx" /> <ClCompile Include="..\gui\LoggerDialog.cxx" />
<ClCompile Include="..\gui\MessageDialog.cxx" /> <ClCompile Include="..\gui\MessageDialog.cxx" />
@ -1885,6 +1886,7 @@
<ClInclude Include="..\gui\FileListWidget.hxx" /> <ClInclude Include="..\gui\FileListWidget.hxx" />
<ClInclude Include="..\gui\HighScoresDialog.hxx" /> <ClInclude Include="..\gui\HighScoresDialog.hxx" />
<ClInclude Include="..\gui\HighScoresMenu.hxx" /> <ClInclude Include="..\gui\HighScoresMenu.hxx" />
<ClInclude Include="..\gui\InputMenu.hxx" />
<ClInclude Include="..\gui\JoystickDialog.hxx" /> <ClInclude Include="..\gui\JoystickDialog.hxx" />
<ClInclude Include="..\gui\LoggerDialog.hxx" /> <ClInclude Include="..\gui\LoggerDialog.hxx" />
<ClInclude Include="..\gui\MessageDialog.hxx" /> <ClInclude Include="..\gui\MessageDialog.hxx" />

View File

@ -1119,6 +1119,9 @@
<ClCompile Include="..\debugger\gui\CartARMWidget.cxx"> <ClCompile Include="..\debugger\gui\CartARMWidget.cxx">
<Filter>Source Files\debugger</Filter> <Filter>Source Files\debugger</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\gui\InputMenu.cxx">
<Filter>Source Files\gui</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\common\bspf.hxx"> <ClInclude Include="..\common\bspf.hxx">
@ -2300,6 +2303,9 @@
<ClInclude Include="..\debugger\gui\CartARMWidget.hxx"> <ClInclude Include="..\debugger\gui\CartARMWidget.hxx">
<Filter>Header Files\debugger</Filter> <Filter>Header Files\debugger</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\gui\InputMenu.hxx">
<Filter>Header Files\gui</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="stella.ico"> <None Include="stella.ico">