mirror of https://github.com/stella-emu/stella.git
fixed and enhanced TimeMachineDialog
This commit is contained in:
parent
f563ed0870
commit
d38593a821
|
@ -255,10 +255,12 @@ TimeMachineDialog::TimeMachineDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
// Add buttons
|
// Add buttons
|
||||||
myToggleWidget = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
myToggleWidget = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
STOP.data(), BUTTON_W, BUTTON_H, kToggle);
|
STOP.data(), BUTTON_W, BUTTON_H, kToggle);
|
||||||
|
myToggleWidget->setToolTip("Toogle Time Machine mode.");
|
||||||
xpos += buttonWidth + BUTTON_GAP;
|
xpos += buttonWidth + BUTTON_GAP;
|
||||||
|
|
||||||
myExitWidget = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
myExitWidget = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
EXIT.data(), BUTTON_W, BUTTON_H, kExit);
|
EXIT.data(), BUTTON_W, BUTTON_H, kExit);
|
||||||
|
myExitWidget->setToolTip("Exit Time Machine dialog.");
|
||||||
xpos += buttonWidth + BUTTON_GAP * 4;
|
xpos += buttonWidth + BUTTON_GAP * 4;
|
||||||
|
|
||||||
myRewindAllWidget = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
myRewindAllWidget = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
|
@ -271,6 +273,7 @@ TimeMachineDialog::TimeMachineDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
|
|
||||||
myPlayBackWidget = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
myPlayBackWidget = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
PLAYBACK.data(), BUTTON_W, BUTTON_H, kPlayBack);
|
PLAYBACK.data(), BUTTON_W, BUTTON_H, kPlayBack);
|
||||||
|
myPlayBackWidget->setToolTip("Start playback of Time Machine states.");
|
||||||
xpos += buttonWidth + BUTTON_GAP;
|
xpos += buttonWidth + BUTTON_GAP;
|
||||||
|
|
||||||
myUnwind1Widget = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
myUnwind1Widget = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
|
@ -283,15 +286,21 @@ TimeMachineDialog::TimeMachineDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
|
|
||||||
mySaveAllWidget = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
mySaveAllWidget = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
SAVE_ALL.data(), BUTTON_W, BUTTON_H, kSaveAll);
|
SAVE_ALL.data(), BUTTON_W, BUTTON_H, kSaveAll);
|
||||||
|
mySaveAllWidget->setToolTip("Save all Time Machine states.");
|
||||||
xpos = mySaveAllWidget->getRight() + BUTTON_GAP;
|
xpos = mySaveAllWidget->getRight() + BUTTON_GAP;
|
||||||
|
|
||||||
myLoadAllWidget = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
myLoadAllWidget = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
LOAD_ALL.data(), BUTTON_W, BUTTON_H, kLoadAll);
|
LOAD_ALL.data(), BUTTON_W, BUTTON_H, kLoadAll);
|
||||||
|
myLoadAllWidget->setToolTip("Load all Time Machine states.");
|
||||||
xpos = myLoadAllWidget->getRight() + BUTTON_GAP * 4;
|
xpos = myLoadAllWidget->getRight() + BUTTON_GAP * 4;
|
||||||
|
|
||||||
// Add message
|
// Add message
|
||||||
|
int mWidth = (myLastTimeWidget->getLeft() - xpos) / font.getMaxCharWidth();
|
||||||
|
const string blanks = " ";
|
||||||
|
|
||||||
myMessageWidget = new StaticTextWidget(this, font, xpos, ypos_s,
|
myMessageWidget = new StaticTextWidget(this, font, xpos, ypos_s,
|
||||||
" ", TextAlign::Left, kBGColor);
|
blanks.substr(0, mWidth),
|
||||||
|
TextAlign::Left, kBGColor);
|
||||||
myMessageWidget->setFlags(Widget::FLAG_CLEARBG | Widget::FLAG_NOBG);
|
myMessageWidget->setFlags(Widget::FLAG_CLEARBG | Widget::FLAG_NOBG);
|
||||||
myMessageWidget->setTextColor(kColorInfo);
|
myMessageWidget->setTextColor(kColorInfo);
|
||||||
}
|
}
|
||||||
|
@ -328,6 +337,10 @@ void TimeMachineDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeate
|
||||||
|
|
||||||
switch (event)
|
switch (event)
|
||||||
{
|
{
|
||||||
|
case Event::ExitMode:
|
||||||
|
handleCommand(nullptr, kExit, 0, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
case Event::Rewind1Menu:
|
case Event::Rewind1Menu:
|
||||||
handleCommand(nullptr, kRewind1, 0, 0);
|
handleCommand(nullptr, kRewind1, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
@ -352,13 +365,19 @@ void TimeMachineDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeate
|
||||||
handleCommand(nullptr, kUnwindAll, 0, 0);
|
handleCommand(nullptr, kUnwindAll, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Event::TakeSnapshot:
|
case Event::LoadAllStates:
|
||||||
if (!repeated)
|
if(!repeated)
|
||||||
handleCommand(nullptr, kSnapShot, 0, 0);
|
handleCommand(nullptr, kLoadAll, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Event::ExitMode:
|
case Event::SaveAllStates:
|
||||||
handleCommand(nullptr, kExit, 0, 0);
|
if(!repeated)
|
||||||
|
handleCommand(nullptr, kSaveAll, 0, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Event::TakeSnapshot:
|
||||||
|
if(!repeated)
|
||||||
|
handleCommand(nullptr, kSnapShot, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue