added missing class

This commit is contained in:
Thomas Jentzsch 2021-08-31 21:26:17 +02:00
parent 46650aad63
commit 3dab800c5e
4 changed files with 154 additions and 2 deletions

View File

@ -61,6 +61,7 @@
#include "CommandMenu.hxx"
#include "HighScoresMenu.hxx"
#include "MessageMenu.hxx"
#include "InputMenu.hxx"
#include "DialogContainer.hxx"
#include "Launcher.hxx"
#include "TimeMachine.hxx"
@ -2154,12 +2155,20 @@ bool EventHandler::changeStateByEvent(Event::Type type)
handled = false;
break;
case Event::InputTextDialogMode:
case Event::InputTextDialogMode: // TODO rename
{
StringList labels;
labels.push_back("Nick");
myOSystem.inputMenu().setTitle("PlusROMs first start setup");
myOSystem.inputMenu().setLabels(labels);
if(myState != EventHandlerState::INPUTMENU)
enterMenuMode(EventHandlerState::INPUTMENU);
else
leaveMenuMode();
break;
}
#endif
case Event::TimeMachineMode:

81
src/gui/InputMenu.cxx Normal file
View File

@ -0,0 +1,81 @@
//============================================================================
//
// SSSS tt lll lll
// SS SS tt ll ll
// SS tttttt eeee ll ll aaaa
// SSSS tt ee ee ll ll aa
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
// SS SS tt ee ll ll aa aa
// SSSS ttt eeeee llll llll aaaaa
//
// Copyright (c) 1995-2021 by Bradford W. Mott, Stephen Anthony
// and the Stella Team
//
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//============================================================================
#include "Dialog.hxx"
#include "OSystem.hxx"
#include "FrameBuffer.hxx"
#include "InputTextDialog.hxx"
#include "InputMenu.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
InputMenu::InputMenu(OSystem& osystem)
: DialogContainer(osystem)
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
InputMenu::~InputMenu()
{
delete myInputTextDialog; myInputTextDialog = nullptr;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Dialog* InputMenu::baseDialog()
{
StringList labels;
labels.push_back("test");
if(myInputTextDialog == nullptr)
myInputTextDialog = new InputTextDialog(myOSystem, *this, myOSystem.frameBuffer().font(), labels);
return myInputTextDialog;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void InputMenu::setTitle(const string& title, bool yesNo)
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void InputMenu::setLabels(const StringList& text, bool yesNo)
{
}
//// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//void InputMenu::setMessage(const string& title, const StringList& text, bool yesNo)
//{
// //myInputTextDialog->setMessage(title);
//}
//
//// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//void InputMenu::setMessage(const string& title, const string& text, bool yesNo)
//{
// //myInputTextDialog->setMessage(title);
//}
//
//// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//bool InputMenu::confirmed()
//{
// //if(myInputTextDialog != nullptr)
// // return myInputTextDialog->confirmed();
//
// return false;
//}

62
src/gui/InputMenu.hxx Normal file
View File

@ -0,0 +1,62 @@
//============================================================================
//
// SSSS tt lll lll
// SS SS tt ll ll
// SS tttttt eeee ll ll aaaa
// SSSS tt ee ee ll ll aa
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
// SS SS tt ee ll ll aa aa
// SSSS ttt eeeee llll llll aaaaa
//
// Copyright (c) 1995-2021 by Bradford W. Mott, Stephen Anthony
// and the Stella Team
//
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//============================================================================
#ifndef INPUT_MENU_HXX
#define INPUT_MENU_HXX
class OSystem;
class InputTextDialog;
#include "DialogContainer.hxx"
/**
The base dialog for all input menus in Stella.
@author Thomas Jentzsch
*/
class InputMenu : public DialogContainer
{
public:
/**
Create a new menu stack
*/
explicit InputMenu(OSystem& osystem);
~InputMenu() override;
void setTitle(const string& title, bool yesNo = false);
void setLabels(const StringList& text, bool yesNo = false);
//bool confirmed();
private:
/**
Return (and possibly create) the bottom-most dialog of this container.
*/
Dialog* baseDialog() override;
private:
InputTextDialog* myInputTextDialog{nullptr};
private:
// Following constructors and assignment operators not supported
InputMenu() = delete;
InputMenu(const InputMenu&) = delete;
InputMenu(InputMenu&&) = delete;
InputMenu& operator=(const InputMenu&) = delete;
InputMenu& operator=(InputMenu&&) = delete;
};
#endif

View File

@ -69,7 +69,7 @@ class InputTextDialog : public Dialog, public CommandSender
vector<EditTextWidget*> myInput;
StaticTextWidget* myMessage{nullptr};
bool myEnableCenter{false};
bool myEnableCenter{true};
bool myErrorFlag{false};
int myCmd{0};