mirror of https://github.com/stella-emu/stella.git
Various UI classes now have their commands prefixed by class name.
This commit is contained in:
parent
90a6c35061
commit
29e53093ba
|
@ -196,12 +196,12 @@ void CheatCodeDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
saveConfig();
|
||||
close();
|
||||
break;
|
||||
|
||||
case kCloseCmd:
|
||||
case GuiObject::kCloseCmd:
|
||||
close();
|
||||
break;
|
||||
|
||||
|
|
|
@ -33,39 +33,46 @@ BoosterWidget::BoosterWidget(GuiObject* boss, const GUI::Font& font,
|
|||
t = new StaticTextWidget(boss, font, xpos, ypos+2, lwidth,
|
||||
fontHeight, label, kTextAlignLeft);
|
||||
xpos += t->getWidth()/2 - 5; ypos += t->getHeight() + 10;
|
||||
myPins[kJUp] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||
myPins[kJUp] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJUp]->setID(kJUp);
|
||||
myPins[kJUp]->setTarget(this);
|
||||
|
||||
ypos += myPins[kJUp]->getHeight() * 2 + 10;
|
||||
myPins[kJDown] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||
myPins[kJDown] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJDown]->setID(kJDown);
|
||||
myPins[kJDown]->setTarget(this);
|
||||
|
||||
xpos -= myPins[kJUp]->getWidth() + 5;
|
||||
ypos -= myPins[kJUp]->getHeight() + 5;
|
||||
myPins[kJLeft] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||
myPins[kJLeft] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJLeft]->setID(kJLeft);
|
||||
myPins[kJLeft]->setTarget(this);
|
||||
|
||||
xpos += (myPins[kJUp]->getWidth() + 5) * 2;
|
||||
myPins[kJRight] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||
myPins[kJRight] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJRight]->setID(kJRight);
|
||||
myPins[kJRight]->setTarget(this);
|
||||
|
||||
xpos -= (myPins[kJUp]->getWidth() + 5) * 2;
|
||||
ypos = 20 + (myPins[kJUp]->getHeight() + 10) * 3;
|
||||
myPins[kJFire] = new CheckboxWidget(boss, font, xpos, ypos, "Fire", kCheckActionCmd);
|
||||
myPins[kJFire] = new CheckboxWidget(boss, font, xpos, ypos, "Fire",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJFire]->setID(kJFire);
|
||||
myPins[kJFire]->setTarget(this);
|
||||
|
||||
ypos += myPins[kJFire]->getHeight() + 5;
|
||||
myPins[kJBooster] = new CheckboxWidget(boss, font, xpos, ypos, "Booster", kCheckActionCmd);
|
||||
myPins[kJBooster] = new CheckboxWidget(boss, font, xpos, ypos, "Booster",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJBooster]->setID(kJBooster);
|
||||
myPins[kJBooster]->setTarget(this);
|
||||
|
||||
ypos += myPins[kJBooster]->getHeight() + 5;
|
||||
myPins[kJTrigger] = new CheckboxWidget(boss, font, xpos, ypos, "Trigger", kCheckActionCmd);
|
||||
myPins[kJTrigger] = new CheckboxWidget(boss, font, xpos, ypos, "Trigger",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJTrigger]->setID(kJTrigger);
|
||||
myPins[kJTrigger]->setTarget(this);
|
||||
}
|
||||
|
@ -89,7 +96,7 @@ void BoosterWidget::loadConfig()
|
|||
void BoosterWidget::handleCommand(
|
||||
CommandSender* sender, int cmd, int data, int id)
|
||||
{
|
||||
if(cmd == kCheckActionCmd)
|
||||
if(cmd == CheckboxWidget::kCheckActionCmd)
|
||||
{
|
||||
switch(id)
|
||||
{
|
||||
|
|
|
@ -540,9 +540,9 @@ void DataGridWidget::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kSetPositionCmd:
|
||||
case GuiObject::kSetPositionCmd:
|
||||
// Chain access; pass to parent
|
||||
sendCommand(kSetPositionCmd, data, _id);
|
||||
sendCommand(GuiObject::kSetPositionCmd, data, _id);
|
||||
break;
|
||||
|
||||
case kDGZeroCmd:
|
||||
|
|
|
@ -24,7 +24,7 @@ GenesisWidget::GenesisWidget(GuiObject* boss, const GUI::Font& font,
|
|||
int x, int y, Controller& controller)
|
||||
: ControllerWidget(boss, font, x, y, controller)
|
||||
{
|
||||
const string& label = getHeader();
|
||||
const string& label = getHeader();
|
||||
|
||||
const int fontHeight = font.getFontHeight();
|
||||
int xpos = x, ypos = y, lwidth = font.getStringWidth("Right (Genesis)");
|
||||
|
@ -33,34 +33,40 @@ GenesisWidget::GenesisWidget(GuiObject* boss, const GUI::Font& font,
|
|||
t = new StaticTextWidget(boss, font, xpos, ypos+2, lwidth,
|
||||
fontHeight, label, kTextAlignLeft);
|
||||
xpos += t->getWidth()/2 - 5; ypos += t->getHeight() + 20;
|
||||
myPins[kJUp] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||
myPins[kJUp] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJUp]->setID(kJUp);
|
||||
myPins[kJUp]->setTarget(this);
|
||||
|
||||
ypos += myPins[kJUp]->getHeight() * 2 + 10;
|
||||
myPins[kJDown] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||
myPins[kJDown] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJDown]->setID(kJDown);
|
||||
myPins[kJDown]->setTarget(this);
|
||||
|
||||
xpos -= myPins[kJUp]->getWidth() + 5;
|
||||
ypos -= myPins[kJUp]->getHeight() + 5;
|
||||
myPins[kJLeft] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||
myPins[kJLeft] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJLeft]->setID(kJLeft);
|
||||
myPins[kJLeft]->setTarget(this);
|
||||
|
||||
xpos += (myPins[kJUp]->getWidth() + 5) * 2;
|
||||
myPins[kJRight] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||
myPins[kJRight] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJRight]->setID(kJRight);
|
||||
myPins[kJRight]->setTarget(this);
|
||||
|
||||
xpos -= (myPins[kJUp]->getWidth() + 5) * 2;
|
||||
ypos = 30 + (myPins[kJUp]->getHeight() + 10) * 3;
|
||||
myPins[kJBbtn] = new CheckboxWidget(boss, font, xpos, ypos, "B button", kCheckActionCmd);
|
||||
myPins[kJBbtn] = new CheckboxWidget(boss, font, xpos, ypos, "B button",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJBbtn]->setID(kJBbtn);
|
||||
myPins[kJBbtn]->setTarget(this);
|
||||
|
||||
ypos += myPins[kJBbtn]->getHeight() + 5;
|
||||
myPins[kJCbtn] = new CheckboxWidget(boss, font, xpos, ypos, "C button", kCheckActionCmd);
|
||||
myPins[kJCbtn] = new CheckboxWidget(boss, font, xpos, ypos, "C button",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJCbtn]->setID(kJCbtn);
|
||||
myPins[kJCbtn]->setTarget(this);
|
||||
}
|
||||
|
@ -82,7 +88,7 @@ void GenesisWidget::loadConfig()
|
|||
void GenesisWidget::handleCommand(
|
||||
CommandSender* sender, int cmd, int data, int id)
|
||||
{
|
||||
if(cmd == kCheckActionCmd)
|
||||
if(cmd == CheckboxWidget::kCheckActionCmd)
|
||||
{
|
||||
switch(id)
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ JoystickWidget::JoystickWidget(GuiObject* boss, const GUI::Font& font,
|
|||
int x, int y, Controller& controller)
|
||||
: ControllerWidget(boss, font, x, y, controller)
|
||||
{
|
||||
const string& label = getHeader();
|
||||
const string& label = getHeader();
|
||||
const int fontHeight = font.getFontHeight();
|
||||
int xpos = x, ypos = y, lwidth = font.getStringWidth("Right (Joystick)");
|
||||
StaticTextWidget* t;
|
||||
|
@ -32,29 +32,34 @@ JoystickWidget::JoystickWidget(GuiObject* boss, const GUI::Font& font,
|
|||
t = new StaticTextWidget(boss, font, xpos, ypos+2, lwidth,
|
||||
fontHeight, label, kTextAlignLeft);
|
||||
xpos += t->getWidth()/2 - 5; ypos += t->getHeight() + 20;
|
||||
myPins[kJUp] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||
myPins[kJUp] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJUp]->setID(kJUp);
|
||||
myPins[kJUp]->setTarget(this);
|
||||
|
||||
ypos += myPins[kJUp]->getHeight() * 2 + 10;
|
||||
myPins[kJDown] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||
myPins[kJDown] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJDown]->setID(kJDown);
|
||||
myPins[kJDown]->setTarget(this);
|
||||
|
||||
xpos -= myPins[kJUp]->getWidth() + 5;
|
||||
ypos -= myPins[kJUp]->getHeight() + 5;
|
||||
myPins[kJLeft] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||
myPins[kJLeft] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJLeft]->setID(kJLeft);
|
||||
myPins[kJLeft]->setTarget(this);
|
||||
|
||||
xpos += (myPins[kJUp]->getWidth() + 5) * 2;
|
||||
myPins[kJRight] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||
myPins[kJRight] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJRight]->setID(kJRight);
|
||||
myPins[kJRight]->setTarget(this);
|
||||
|
||||
xpos -= (myPins[kJUp]->getWidth() + 5) * 2;
|
||||
ypos = 30 + (myPins[kJUp]->getHeight() + 10) * 3;
|
||||
myPins[kJFire] = new CheckboxWidget(boss, font, xpos, ypos, "Fire", kCheckActionCmd);
|
||||
myPins[kJFire] = new CheckboxWidget(boss, font, xpos, ypos, "Fire",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJFire]->setID(kJFire);
|
||||
myPins[kJFire]->setTarget(this);
|
||||
}
|
||||
|
@ -73,7 +78,7 @@ void JoystickWidget::loadConfig()
|
|||
void JoystickWidget::handleCommand(
|
||||
CommandSender* sender, int cmd, int data, int id)
|
||||
{
|
||||
if(cmd == kCheckActionCmd)
|
||||
if(cmd == CheckboxWidget::kCheckActionCmd)
|
||||
myController.set(ourPinNo[id], !myPins[id]->getState());
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,8 @@ KeyboardWidget::KeyboardWidget(GuiObject* boss, const GUI::Font& font,
|
|||
|
||||
for(int i = 0; i < 12; ++i)
|
||||
{
|
||||
myBox[i] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||
myBox[i] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myBox[i]->setID(i);
|
||||
myBox[i]->setTarget(this);
|
||||
xpos += myBox[i]->getWidth() + 5;
|
||||
|
@ -63,7 +64,7 @@ void KeyboardWidget::loadConfig()
|
|||
void KeyboardWidget::handleCommand(
|
||||
CommandSender* sender, int cmd, int data, int id)
|
||||
{
|
||||
if(cmd == kCheckActionCmd)
|
||||
if(cmd == CheckboxWidget::kCheckActionCmd)
|
||||
instance().eventHandler().handleEvent(myEvent[id], myBox[id]->getState());
|
||||
}
|
||||
|
||||
|
|
|
@ -475,7 +475,7 @@ void PromptWidget::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch (cmd)
|
||||
{
|
||||
case kSetPositionCmd:
|
||||
case GuiObject::kSetPositionCmd:
|
||||
int newPos = int(data) + _linesPerPage - 1 + _firstLineInBuffer;
|
||||
if (newPos != _scrollLine)
|
||||
{
|
||||
|
|
|
@ -257,7 +257,7 @@ void RamWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
|||
break;
|
||||
}
|
||||
|
||||
case kSetPositionCmd:
|
||||
case GuiObject::kSetPositionCmd:
|
||||
myCurrentRamBank = data;
|
||||
showSearchResults();
|
||||
fillGrid(false);
|
||||
|
|
|
@ -202,13 +202,13 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
// Select and Reset
|
||||
xpos += myP0Diff->getWidth() + 20; ypos = col2_ypos + lineHeight;
|
||||
mySelect = new CheckboxWidget(boss, lfont, xpos, ypos, "Select",
|
||||
kCheckActionCmd);
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
mySelect->setID(kSelectID);
|
||||
mySelect->setTarget(this);
|
||||
addFocusWidget(mySelect);
|
||||
ypos += mySelect->getHeight() + 5;
|
||||
myReset = new CheckboxWidget(boss, lfont, xpos, ypos, "Reset",
|
||||
kCheckActionCmd);
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myReset->setID(kResetID);
|
||||
myReset->setTarget(this);
|
||||
addFocusWidget(myReset);
|
||||
|
@ -222,7 +222,7 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
// Randomize RAM
|
||||
xpos += 30; ypos += lineHeight + 4;
|
||||
myRandomizeRAM = new CheckboxWidget(boss, lfont, xpos, ypos+1,
|
||||
"Randomize zero-page and extended RAM", kCheckActionCmd);
|
||||
"Randomize zero-page and extended RAM", CheckboxWidget::kCheckActionCmd);
|
||||
myRandomizeRAM->setID(kRandRAMID);
|
||||
myRandomizeRAM->setTarget(this);
|
||||
addFocusWidget(myRandomizeRAM);
|
||||
|
@ -237,7 +237,7 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
for(int i = 0; i < 5; ++i)
|
||||
{
|
||||
myRandomizeCPU[i] = new CheckboxWidget(boss, lfont, xpos, ypos+1,
|
||||
cpuregs[i], kCheckActionCmd);
|
||||
cpuregs[i], CheckboxWidget::kCheckActionCmd);
|
||||
myRandomizeCPU[i]->setID(kRandCPUID);
|
||||
myRandomizeCPU[i]->setTarget(this);
|
||||
addFocusWidget(myRandomizeCPU[i]);
|
||||
|
@ -415,7 +415,7 @@ void RiotWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
|||
}
|
||||
break;
|
||||
|
||||
case kCheckActionCmd:
|
||||
case CheckboxWidget::kCheckActionCmd:
|
||||
switch(id)
|
||||
{
|
||||
case kSelectID:
|
||||
|
@ -453,9 +453,9 @@ ControllerWidget* RiotWidget::addControlWidget(GuiObject* boss, const GUI::Font&
|
|||
{
|
||||
switch(controller.type())
|
||||
{
|
||||
case Controller::AmigaMouse:
|
||||
case Controller::AmigaMouse:
|
||||
return new AmigaMouseWidget(boss, font, x, y, controller);
|
||||
case Controller::AtariMouse:
|
||||
case Controller::AtariMouse:
|
||||
return new AtariMouseWidget(boss, font, x, y, controller);
|
||||
case Controller::AtariVox:
|
||||
return new AtariVoxWidget(boss, font, x, y, controller);
|
||||
|
@ -475,7 +475,7 @@ ControllerWidget* RiotWidget::addControlWidget(GuiObject* boss, const GUI::Font&
|
|||
return new PaddleWidget(boss, font, x, y, controller);
|
||||
case Controller::SaveKey:
|
||||
return new SaveKeyWidget(boss, font, x, y, controller);
|
||||
case Controller::TrakBall:
|
||||
case Controller::TrakBall:
|
||||
return new TrakBallWidget(boss, font, x, y, controller);
|
||||
default:
|
||||
return new NullControlWidget(boss, font, x, y, controller);
|
||||
|
|
|
@ -80,7 +80,8 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
CheckboxWidget* t = nullptr;
|
||||
for(int i = 0; i < _rows; ++i)
|
||||
{
|
||||
t = new CheckboxWidget(boss, lfont, _x + 2, ypos, "", kCheckActionCmd);
|
||||
t = new CheckboxWidget(boss, lfont, _x + 2, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
t->setTarget(this);
|
||||
t->setID(i);
|
||||
t->setFill(CheckboxWidget::Circle);
|
||||
|
@ -414,14 +415,14 @@ void RomListWidget::handleCommand(CommandSender* sender, int cmd, int data, int
|
|||
{
|
||||
switch (cmd)
|
||||
{
|
||||
case kCheckActionCmd:
|
||||
case CheckboxWidget::kCheckActionCmd:
|
||||
// We let the parent class handle this
|
||||
// Pass it as a kRLBreakpointChangedCmd command, since that's the intent
|
||||
sendCommand(RomListWidget::kBPointChangedCmd, _currentPos+id,
|
||||
myCheckList[id]->getState());
|
||||
break;
|
||||
|
||||
case kSetPositionCmd:
|
||||
case GuiObject::kSetPositionCmd:
|
||||
if (_currentPos != data)
|
||||
{
|
||||
_currentPos = data;
|
||||
|
|
|
@ -202,7 +202,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
// P0 reflect
|
||||
xpos += myHMP0->getWidth() + 15;
|
||||
myRefP0 = new CheckboxWidget(boss, lfont, xpos, ypos+1,
|
||||
"Reflect", kCheckActionCmd);
|
||||
"Reflect", CheckboxWidget::kCheckActionCmd);
|
||||
myRefP0->setTarget(this);
|
||||
myRefP0->setID(kRefP0ID);
|
||||
addFocusWidget(myRefP0);
|
||||
|
@ -226,7 +226,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
// P0 delay
|
||||
xpos += myGRP0Old->getWidth() + 12;
|
||||
myDelP0 = new CheckboxWidget(boss, lfont, xpos, ypos+1,
|
||||
"VDel", kCheckActionCmd);
|
||||
"VDel", CheckboxWidget::kCheckActionCmd);
|
||||
myDelP0->setTarget(this);
|
||||
myDelP0->setID(kDelP0ID);
|
||||
addFocusWidget(myDelP0);
|
||||
|
@ -287,7 +287,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
// P1 reflect
|
||||
xpos += myHMP1->getWidth() + 15;
|
||||
myRefP1 = new CheckboxWidget(boss, lfont, xpos, ypos+1,
|
||||
"Reflect", kCheckActionCmd);
|
||||
"Reflect", CheckboxWidget::kCheckActionCmd);
|
||||
myRefP1->setTarget(this);
|
||||
myRefP1->setID(kRefP1ID);
|
||||
addFocusWidget(myRefP1);
|
||||
|
@ -310,7 +310,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
// P1 delay
|
||||
xpos += myGRP1Old->getWidth() + 12;
|
||||
myDelP1 = new CheckboxWidget(boss, lfont, xpos, ypos+1,
|
||||
"VDel", kCheckActionCmd);
|
||||
"VDel", CheckboxWidget::kCheckActionCmd);
|
||||
myDelP1->setTarget(this);
|
||||
myDelP1->setID(kDelP1ID);
|
||||
addFocusWidget(myDelP1);
|
||||
|
@ -382,7 +382,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
// M0 reset to player 0
|
||||
xpos += myNusizM0->getWidth() + 15;
|
||||
myResMP0 = new CheckboxWidget(boss, lfont, xpos, ypos+1,
|
||||
"Reset to P0", kCheckActionCmd);
|
||||
"Reset to P0", CheckboxWidget::kCheckActionCmd);
|
||||
myResMP0->setTarget(this);
|
||||
myResMP0->setID(kResMP0ID);
|
||||
addFocusWidget(myResMP0);
|
||||
|
@ -445,7 +445,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
// M1 reset to player 0
|
||||
xpos += myNusizM1->getWidth() + 15;
|
||||
myResMP1 = new CheckboxWidget(boss, lfont, xpos, ypos+1,
|
||||
"Reset to P1", kCheckActionCmd);
|
||||
"Reset to P1", CheckboxWidget::kCheckActionCmd);
|
||||
myResMP1->setTarget(this);
|
||||
myResMP1->setID(kResMP1ID);
|
||||
addFocusWidget(myResMP1);
|
||||
|
@ -523,7 +523,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
// Ball delay
|
||||
xpos += myEnaBLOld->getWidth() + 12;
|
||||
myDelBL = new CheckboxWidget(boss, lfont, xpos, ypos+1,
|
||||
"VDel", kCheckActionCmd);
|
||||
"VDel", CheckboxWidget::kCheckActionCmd);
|
||||
myDelBL->setTarget(this);
|
||||
myDelBL->setID(kDelBLID);
|
||||
addFocusWidget(myDelBL);
|
||||
|
@ -590,21 +590,21 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
// PF reflect, score, priority
|
||||
xpos = 10 + 4*fontWidth; ypos += lineHeight + 6;
|
||||
myRefPF = new CheckboxWidget(boss, lfont, xpos, ypos+1,
|
||||
"Reflect", kCheckActionCmd);
|
||||
"Reflect", CheckboxWidget::kCheckActionCmd);
|
||||
myRefPF->setTarget(this);
|
||||
myRefPF->setID(kRefPFID);
|
||||
addFocusWidget(myRefPF);
|
||||
|
||||
xpos += myRefPF->getWidth() + 15;
|
||||
myScorePF = new CheckboxWidget(boss, lfont, xpos, ypos+1,
|
||||
"Score", kCheckActionCmd);
|
||||
"Score", CheckboxWidget::kCheckActionCmd);
|
||||
myScorePF->setTarget(this);
|
||||
myScorePF->setID(kScorePFID);
|
||||
addFocusWidget(myScorePF);
|
||||
|
||||
xpos += myScorePF->getWidth() + 15;
|
||||
myPriorityPF = new CheckboxWidget(boss, lfont, xpos, ypos+1,
|
||||
"Priority", kCheckActionCmd);
|
||||
"Priority", CheckboxWidget::kCheckActionCmd);
|
||||
myPriorityPF->setTarget(this);
|
||||
myPriorityPF->setID(kPriorityPFID);
|
||||
addFocusWidget(myPriorityPF);
|
||||
|
@ -833,7 +833,7 @@ void TiaWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
|||
}
|
||||
break;
|
||||
|
||||
case kCheckActionCmd:
|
||||
case CheckboxWidget::kCheckActionCmd:
|
||||
switch(id)
|
||||
{
|
||||
case kRefP0ID:
|
||||
|
|
|
@ -202,7 +202,7 @@ void ToggleWidget::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch (cmd)
|
||||
{
|
||||
case kSetPositionCmd:
|
||||
case GuiObject::kSetPositionCmd:
|
||||
if (_selectedItem != data)
|
||||
{
|
||||
_selectedItem = data;
|
||||
|
|
|
@ -46,20 +46,20 @@ AboutDialog::AboutDialog(OSystem& osystem, DialogContainer& parent,
|
|||
xpos = 10; ypos = _h - buttonHeight - 10;
|
||||
myPrevButton =
|
||||
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||
"Previous", kPrevCmd);
|
||||
"Previous", GuiObject::kPrevCmd);
|
||||
myPrevButton->clearFlags(WIDGET_ENABLED);
|
||||
wid.push_back(myPrevButton);
|
||||
|
||||
xpos += buttonWidth + 7;
|
||||
myNextButton =
|
||||
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||
"Next", kNextCmd);
|
||||
"Next", GuiObject::kNextCmd);
|
||||
wid.push_back(myNextButton);
|
||||
|
||||
xpos = _w - buttonWidth - 10;
|
||||
ButtonWidget* b =
|
||||
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||
"Close", kCloseCmd);
|
||||
"Close", GuiObject::kCloseCmd);
|
||||
wid.push_back(b);
|
||||
addOKWidget(b); addCancelWidget(b);
|
||||
|
||||
|
@ -229,7 +229,7 @@ void AboutDialog::handleCommand(CommandSender* sender, int cmd, int data, int id
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kNextCmd:
|
||||
case GuiObject::kNextCmd:
|
||||
myPage++;
|
||||
if(myPage >= myNumPages)
|
||||
myNextButton->clearFlags(WIDGET_ENABLED);
|
||||
|
@ -239,7 +239,7 @@ void AboutDialog::handleCommand(CommandSender* sender, int cmd, int data, int id
|
|||
displayInfo();
|
||||
break;
|
||||
|
||||
case kPrevCmd:
|
||||
case GuiObject::kPrevCmd:
|
||||
myPage--;
|
||||
if(myPage <= myNumPages)
|
||||
myNextButton->setFlags(WIDGET_ENABLED);
|
||||
|
|
|
@ -109,7 +109,7 @@ AudioDialog::AudioDialog(OSystem& osystem, DialogContainer& parent,
|
|||
// Add Defaults, OK and Cancel buttons
|
||||
ButtonWidget* b;
|
||||
b = new ButtonWidget(this, font, 10, _h - buttonHeight - 10,
|
||||
buttonWidth, buttonHeight, "Defaults", kDefaultsCmd);
|
||||
buttonWidth, buttonHeight, "Defaults", GuiObject::kDefaultsCmd);
|
||||
wid.push_back(b);
|
||||
addOKCancelBGroup(wid, font);
|
||||
|
||||
|
@ -193,12 +193,12 @@ void AudioDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
saveConfig();
|
||||
close();
|
||||
break;
|
||||
|
||||
case kDefaultsCmd:
|
||||
case GuiObject::kDefaultsCmd:
|
||||
setDefaults();
|
||||
break;
|
||||
|
||||
|
|
|
@ -98,12 +98,12 @@ BrowserDialog::BrowserDialog(GuiObject* boss, const GUI::Font& font,
|
|||
addFocusWidget(b);
|
||||
addOKWidget(b);
|
||||
b = new ButtonWidget(this, font, _w - (buttonWidth + 10), _h - buttonHeight - 10,
|
||||
buttonWidth, buttonHeight, "Cancel", kCloseCmd);
|
||||
buttonWidth, buttonHeight, "Cancel", GuiObject::kCloseCmd);
|
||||
addFocusWidget(b);
|
||||
addCancelWidget(b);
|
||||
#else
|
||||
b = new ButtonWidget(this, font, _w - 2 * (buttonWidth + 7), _h - buttonHeight - 10,
|
||||
buttonWidth, buttonHeight, "Cancel", kCloseCmd);
|
||||
buttonWidth, buttonHeight, "Cancel", GuiObject::kCloseCmd);
|
||||
addFocusWidget(b);
|
||||
addCancelWidget(b);
|
||||
b = new ButtonWidget(this, font, _w - (buttonWidth + 10), _h - buttonHeight - 10,
|
||||
|
|
|
@ -34,7 +34,8 @@ CheckListWidget::CheckListWidget(GuiObject* boss, const GUI::Font& font,
|
|||
CheckboxWidget* t = nullptr;
|
||||
for(int i = 0; i < _rows; ++i)
|
||||
{
|
||||
t = new CheckboxWidget(boss, font, _x + 2, ypos, "", kCheckActionCmd);
|
||||
t = new CheckboxWidget(boss, font, _x + 2, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
t->setTextColor(kTextColor);
|
||||
t->setTarget(this);
|
||||
t->setID(i);
|
||||
|
@ -171,14 +172,14 @@ void CheckListWidget::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kCheckActionCmd:
|
||||
case CheckboxWidget::kCheckActionCmd:
|
||||
{
|
||||
// Figure out which line has been checked
|
||||
int line = _currentPos + id;
|
||||
_stateList[line] = bool(data);
|
||||
|
||||
// Let the boss know about it
|
||||
sendCommand(kListItemChecked, line, _id);
|
||||
sendCommand(CheckListWidget::kListItemChecked, line, _id);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ using CheckboxArray = vector<CheckboxWidget*>;
|
|||
class CheckListWidget : public ListWidget
|
||||
{
|
||||
public:
|
||||
enum { kListItemChecked = 'LIct' /* checkbox toggled on current line*/ };
|
||||
enum { kListItemChecked = 'LIct' /* checkbox toggled on current line*/ };
|
||||
enum CheckStyle { XFill, SolidFill };
|
||||
|
||||
public:
|
||||
|
|
|
@ -81,7 +81,7 @@ ComboDialog::ComboDialog(GuiObject* boss, const GUI::Font& font,
|
|||
// Add Defaults, OK and Cancel buttons
|
||||
ButtonWidget* b;
|
||||
b = new ButtonWidget(this, font, 10, _h - buttonHeight - 10,
|
||||
buttonWidth, buttonHeight, "Defaults", kDefaultsCmd);
|
||||
buttonWidth, buttonHeight, "Defaults", GuiObject::kDefaultsCmd);
|
||||
wid.push_back(b);
|
||||
addOKCancelBGroup(wid, font);
|
||||
|
||||
|
@ -142,12 +142,12 @@ void ComboDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
saveConfig();
|
||||
close();
|
||||
break;
|
||||
|
||||
case kDefaultsCmd:
|
||||
case GuiObject::kDefaultsCmd:
|
||||
setDefaults();
|
||||
break;
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ ConfigPathDialog::ConfigPathDialog(
|
|||
// Add Defaults, OK and Cancel buttons
|
||||
b = new ButtonWidget(this, font, 10, _h - buttonHeight - 10,
|
||||
font.getStringWidth("Defaults") + 20, buttonHeight,
|
||||
"Defaults", kDefaultsCmd);
|
||||
"Defaults", GuiObject::kDefaultsCmd);
|
||||
wid.push_back(b);
|
||||
addOKCancelBGroup(wid, font);
|
||||
|
||||
|
@ -192,14 +192,14 @@ void ConfigPathDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch (cmd)
|
||||
{
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
saveConfig();
|
||||
close();
|
||||
if(myIsGlobal) // Let the boss know romdir has changed
|
||||
sendCommand(LauncherDialog::kRomDirChosenCmd, 0, 0);
|
||||
break;
|
||||
|
||||
case kDefaultsCmd:
|
||||
case GuiObject::kDefaultsCmd:
|
||||
setDefaults();
|
||||
break;
|
||||
|
||||
|
|
|
@ -629,12 +629,12 @@ void Dialog::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kTabChangedCmd:
|
||||
case TabWidget::kTabChangedCmd:
|
||||
if(_visible)
|
||||
buildCurrentFocusList(id);
|
||||
break;
|
||||
|
||||
case kCloseCmd:
|
||||
case GuiObject::kCloseCmd:
|
||||
close();
|
||||
break;
|
||||
}
|
||||
|
@ -663,23 +663,23 @@ void Dialog::addOKCancelBGroup(WidgetArray& wid, const GUI::Font& font,
|
|||
#ifndef BSPF_MAC_OSX
|
||||
b = new ButtonWidget(this, font, _w - 2 * (buttonWidth + 7), _h - buttonHeight - 10,
|
||||
buttonWidth, buttonHeight,
|
||||
okText == "" ? "OK" : okText, kOKCmd);
|
||||
okText == "" ? "OK" : okText, GuiObject::kOKCmd);
|
||||
wid.push_back(b);
|
||||
addOKWidget(b);
|
||||
b = new ButtonWidget(this, font, _w - (buttonWidth + 10), _h - buttonHeight - 10,
|
||||
buttonWidth, buttonHeight,
|
||||
cancelText == "" ? "Cancel" : cancelText, kCloseCmd);
|
||||
cancelText == "" ? "Cancel" : cancelText, GuiObject::kCloseCmd);
|
||||
wid.push_back(b);
|
||||
addCancelWidget(b);
|
||||
#else
|
||||
b = new ButtonWidget(this, font, _w - 2 * (buttonWidth + 7), _h - buttonHeight - 10,
|
||||
buttonWidth, buttonHeight,
|
||||
cancelText == "" ? "Cancel" : cancelText, kCloseCmd);
|
||||
cancelText == "" ? "Cancel" : cancelText, GuiObject::kCloseCmd);
|
||||
wid.push_back(b);
|
||||
addCancelWidget(b);
|
||||
b = new ButtonWidget(this, font, _w - (buttonWidth + 10), _h - buttonHeight - 10,
|
||||
buttonWidth, buttonHeight,
|
||||
okText == "" ? "OK" : okText, kOKCmd);
|
||||
okText == "" ? "OK" : okText, GuiObject::kOKCmd);
|
||||
wid.push_back(b);
|
||||
addOKWidget(b);
|
||||
#endif
|
||||
|
|
|
@ -364,7 +364,7 @@ GameInfoDialog::GameInfoDialog(
|
|||
wid.clear();
|
||||
ButtonWidget* b;
|
||||
b = new ButtonWidget(this, font, 10, _h - buttonHeight - 10,
|
||||
buttonWidth, buttonHeight, "Defaults", kDefaultsCmd);
|
||||
buttonWidth, buttonHeight, "Defaults", GuiObject::kDefaultsCmd);
|
||||
wid.push_back(b);
|
||||
addOKCancelBGroup(wid, font);
|
||||
addBGroupToFocusList(wid);
|
||||
|
@ -612,16 +612,16 @@ void GameInfoDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch (cmd)
|
||||
{
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
saveConfig();
|
||||
close();
|
||||
break;
|
||||
|
||||
case kDefaultsCmd:
|
||||
case GuiObject::kDefaultsCmd:
|
||||
setDefaults();
|
||||
break;
|
||||
|
||||
case kTabChangedCmd:
|
||||
case TabWidget::kTabChangedCmd:
|
||||
if(data == 2) // 'Controller' tab selected
|
||||
updateControllerStates();
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font)
|
|||
// Add Defaults, OK and Cancel buttons
|
||||
ButtonWidget* b;
|
||||
b = new ButtonWidget(this, font, 10, _h - buttonHeight - 10,
|
||||
buttonWidth, buttonHeight, "Defaults", kDefaultsCmd);
|
||||
buttonWidth, buttonHeight, "Defaults", GuiObject::kDefaultsCmd);
|
||||
wid.push_back(b);
|
||||
addOKCancelBGroup(wid, font, "Load ROM", "Close");
|
||||
|
||||
|
@ -289,14 +289,14 @@ void GlobalPropsDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
saveConfig();
|
||||
close();
|
||||
// Inform parent to load the ROM
|
||||
sendCommand(LauncherDialog::kLoadROMCmd, 0, 0);
|
||||
break;
|
||||
|
||||
case kDefaultsCmd:
|
||||
case GuiObject::kDefaultsCmd:
|
||||
setDefaults();
|
||||
saveConfig();
|
||||
break;
|
||||
|
|
|
@ -31,20 +31,6 @@ class Widget;
|
|||
|
||||
using WidgetArray = vector<Widget*>;
|
||||
|
||||
// The commands generated by various widgets
|
||||
enum {
|
||||
kOKCmd = 'OK ',
|
||||
kCloseCmd = 'CLOS',
|
||||
kNextCmd = 'NEXT',
|
||||
kPrevCmd = 'PREV',
|
||||
kEditCmd = 'EDIT',
|
||||
kDefaultsCmd = 'DEFA',
|
||||
kSetPositionCmd = 'SETP',
|
||||
kTabChangedCmd = 'TBCH',
|
||||
kCheckActionCmd = 'CBAC',
|
||||
kRefreshAllCmd = 'REFA'
|
||||
};
|
||||
|
||||
/**
|
||||
This is the base class for all GUI objects/widgets.
|
||||
|
||||
|
@ -55,6 +41,17 @@ class GuiObject : public CommandReceiver
|
|||
friend class Widget;
|
||||
friend class DialogContainer;
|
||||
|
||||
public:
|
||||
// The commands generated by various widgets
|
||||
enum {
|
||||
kOKCmd = 'OK ',
|
||||
kCloseCmd = 'CLOS',
|
||||
kNextCmd = 'NEXT',
|
||||
kPrevCmd = 'PREV',
|
||||
kDefaultsCmd = 'DEFA',
|
||||
kSetPositionCmd = 'SETP'
|
||||
};
|
||||
|
||||
public:
|
||||
GuiObject(OSystem& osystem, DialogContainer& parent, Dialog& dialog,
|
||||
int x, int y, int w, int h)
|
||||
|
|
|
@ -46,20 +46,20 @@ HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent,
|
|||
xpos = 10; ypos = _h - buttonHeight - 10;
|
||||
myPrevButton =
|
||||
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||
"Previous", kPrevCmd);
|
||||
"Previous", GuiObject::kPrevCmd);
|
||||
myPrevButton->clearFlags(WIDGET_ENABLED);
|
||||
wid.push_back(myPrevButton);
|
||||
|
||||
xpos += buttonWidth + 7;
|
||||
myNextButton =
|
||||
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||
"Next", kNextCmd);
|
||||
"Next", GuiObject::kNextCmd);
|
||||
wid.push_back(myNextButton);
|
||||
|
||||
xpos = _w - buttonWidth - 10;
|
||||
ButtonWidget* b =
|
||||
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||
"Close", kCloseCmd);
|
||||
"Close", GuiObject::kCloseCmd);
|
||||
wid.push_back(b);
|
||||
addOKWidget(b); addCancelWidget(b);
|
||||
|
||||
|
@ -192,7 +192,7 @@ void HelpDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kNextCmd:
|
||||
case GuiObject::kNextCmd:
|
||||
myPage++;
|
||||
if(myPage >= myNumPages)
|
||||
myNextButton->clearFlags(WIDGET_ENABLED);
|
||||
|
@ -202,7 +202,7 @@ void HelpDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
displayInfo();
|
||||
break;
|
||||
|
||||
case kPrevCmd:
|
||||
case GuiObject::kPrevCmd:
|
||||
myPage--;
|
||||
if(myPage <= myNumPages)
|
||||
myNextButton->setFlags(WIDGET_ENABLED);
|
||||
|
|
|
@ -86,7 +86,7 @@ InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent,
|
|||
WidgetArray wid;
|
||||
ButtonWidget* b;
|
||||
b = new ButtonWidget(this, font, 10, _h - buttonHeight - 10,
|
||||
buttonWidth, buttonHeight, "Defaults", kDefaultsCmd);
|
||||
buttonWidth, buttonHeight, "Defaults", GuiObject::kDefaultsCmd);
|
||||
wid.push_back(b);
|
||||
addOKCancelBGroup(wid, font);
|
||||
addBGroupToFocusList(wid);
|
||||
|
@ -222,7 +222,7 @@ void InputDialog::addDevicePortTab(const GUI::Font& font)
|
|||
new StaticTextWidget(myTab, font, _w - 14 - (fwidth + lwidth) / 2, ypos+2,
|
||||
"AtariVox/SaveKey");
|
||||
|
||||
// Show joystick database
|
||||
// Show joystick database
|
||||
ypos += lineHeight;
|
||||
myJoyDlgButton = new ButtonWidget(myTab, font, hSpace, ypos, 20,
|
||||
"Joystick database" + ELLIPSIS, kDBButtonPressed);
|
||||
|
@ -481,17 +481,17 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
saveConfig();
|
||||
close();
|
||||
break;
|
||||
|
||||
case kCloseCmd:
|
||||
case GuiObject::kCloseCmd:
|
||||
// Revert changes made to event mapping
|
||||
close();
|
||||
break;
|
||||
|
||||
case kDefaultsCmd:
|
||||
case GuiObject::kDefaultsCmd:
|
||||
setDefaults();
|
||||
break;
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ void InputTextDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
case EditableWidget::kAcceptCmd:
|
||||
{
|
||||
// Send a signal to the calling class that a selection has been made
|
||||
|
@ -212,7 +212,7 @@ void InputTextDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
break;
|
||||
|
||||
case EditableWidget::kCancelCmd:
|
||||
Dialog::handleCommand(sender, kCloseCmd, data, id);
|
||||
Dialog::handleCommand(sender, GuiObject::kCloseCmd, data, id);
|
||||
break;
|
||||
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ JoystickDialog::JoystickDialog(GuiObject* boss, const GUI::Font& font,
|
|||
// Add buttons at bottom
|
||||
xpos = _w - buttonWidth - 10;
|
||||
myCloseBtn = new ButtonWidget(this, font, xpos, ypos,
|
||||
buttonWidth, buttonHeight, "Close", kCloseCmd);
|
||||
buttonWidth, buttonHeight, "Close", GuiObject::kCloseCmd);
|
||||
addOKWidget(myCloseBtn); addCancelWidget(myCloseBtn);
|
||||
|
||||
buttonWidth = font.getStringWidth("Remove") + 20;
|
||||
|
@ -95,7 +95,7 @@ void JoystickDialog::handleCommand(CommandSender* sender, int cmd, int data, int
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
close();
|
||||
break;
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ LauncherFilterDialog::LauncherFilterDialog(GuiObject* boss, const GUI::Font& fon
|
|||
// Add Defaults, OK and Cancel buttons
|
||||
ButtonWidget* b;
|
||||
b = new ButtonWidget(this, font, 10, _h - buttonHeight - 10,
|
||||
buttonWidth, buttonHeight, "Defaults", kDefaultsCmd);
|
||||
buttonWidth, buttonHeight, "Defaults", GuiObject::kDefaultsCmd);
|
||||
wid.push_back(b);
|
||||
addOKCancelBGroup(wid, font);
|
||||
|
||||
|
@ -229,12 +229,12 @@ void LauncherFilterDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
saveConfig();
|
||||
close();
|
||||
break;
|
||||
|
||||
case kDefaultsCmd:
|
||||
case GuiObject::kDefaultsCmd:
|
||||
setDefaults();
|
||||
break;
|
||||
|
||||
|
|
|
@ -410,7 +410,7 @@ void ListWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
|||
{
|
||||
switch (cmd)
|
||||
{
|
||||
case kSetPositionCmd:
|
||||
case GuiObject::kSetPositionCmd:
|
||||
if (_currentPos != data)
|
||||
{
|
||||
_currentPos = data;
|
||||
|
|
|
@ -38,7 +38,7 @@ class ListWidget : public EditableWidget
|
|||
kSelectionChangedCmd = 'Lsch', // selection changed - 'data' will be item index
|
||||
kScrolledCmd = 'Lscl', // list scrolled - 'data' will be current position
|
||||
kPrevDirCmd = 'Lpdr' // request to go to parent list, if applicable
|
||||
};
|
||||
};
|
||||
|
||||
public:
|
||||
ListWidget(GuiObject* boss, const GUI::Font& font,
|
||||
|
|
|
@ -79,7 +79,8 @@ LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent,
|
|||
// Add Defaults, OK and Cancel buttons
|
||||
ButtonWidget* b;
|
||||
b = new ButtonWidget(this, font, 10, _h - buttonHeight - 10,
|
||||
buttonWidth, buttonHeight, "Save log to disk", kDefaultsCmd);
|
||||
buttonWidth, buttonHeight, "Save log to disk",
|
||||
GuiObject::kDefaultsCmd);
|
||||
wid.push_back(b);
|
||||
addOKCancelBGroup(wid, font);
|
||||
|
||||
|
@ -123,12 +124,12 @@ void LoggerDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
saveConfig();
|
||||
close();
|
||||
break;
|
||||
|
||||
case kDefaultsCmd:
|
||||
case GuiObject::kDefaultsCmd:
|
||||
saveLogFile();
|
||||
break;
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ void MessageBox::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
{
|
||||
close();
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ void RomAuditDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch (cmd)
|
||||
{
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
if(!myConfirmMsg)
|
||||
{
|
||||
StringList msg;
|
||||
|
|
|
@ -201,7 +201,7 @@ void ScrollBarWidget::checkBounds(int old_pos)
|
|||
if (old_pos != _currentPos)
|
||||
{
|
||||
recalc();
|
||||
sendCommand(kSetPositionCmd, _currentPos, _id);
|
||||
sendCommand(GuiObject::kSetPositionCmd, _currentPos, _id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent,
|
|||
// Add Defaults, OK and Cancel buttons
|
||||
b = new ButtonWidget(this, font, 10, _h - buttonHeight - 10,
|
||||
font.getStringWidth("Defaults") + 20, buttonHeight,
|
||||
"Defaults", kDefaultsCmd);
|
||||
"Defaults", GuiObject::kDefaultsCmd);
|
||||
wid.push_back(b);
|
||||
addOKCancelBGroup(wid, font);
|
||||
|
||||
|
@ -170,12 +170,12 @@ void SnapshotDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch (cmd)
|
||||
{
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
saveConfig();
|
||||
close();
|
||||
break;
|
||||
|
||||
case kDefaultsCmd:
|
||||
case GuiObject::kDefaultsCmd:
|
||||
setDefaults();
|
||||
break;
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ void TabWidget::setActiveTab(int tabID, bool show)
|
|||
|
||||
// Let parent know about the tab change
|
||||
if(show)
|
||||
sendCommand(kTabChangedCmd, _activeTab, _id);
|
||||
sendCommand(TabWidget::kTabChangedCmd, _activeTab, _id);
|
||||
}
|
||||
|
||||
#if 0 // FIXME
|
||||
|
@ -134,7 +134,7 @@ void TabWidget::updateActiveTab()
|
|||
void TabWidget::activateTabs()
|
||||
{
|
||||
for(uInt32 i = 0; i <_tabs.size(); ++i)
|
||||
sendCommand(kTabChangedCmd, i-1, _id);
|
||||
sendCommand(TabWidget::kTabChangedCmd, i-1, _id);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -25,6 +25,11 @@
|
|||
|
||||
class TabWidget : public Widget, public CommandSender
|
||||
{
|
||||
public:
|
||||
enum {
|
||||
kTabChangedCmd = 'TBCH'
|
||||
};
|
||||
|
||||
public:
|
||||
TabWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h);
|
||||
virtual ~TabWidget();
|
||||
|
|
|
@ -295,7 +295,7 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
|
|||
// Add Defaults, OK and Cancel buttons
|
||||
wid.clear();
|
||||
b = new ButtonWidget(this, font, 10, _h - buttonHeight - 10,
|
||||
buttonWidth, buttonHeight, "Defaults", kDefaultsCmd);
|
||||
buttonWidth, buttonHeight, "Defaults", GuiObject::kDefaultsCmd);
|
||||
wid.push_back(b);
|
||||
addOKCancelBGroup(wid, font);
|
||||
addBGroupToFocusList(wid);
|
||||
|
@ -498,12 +498,12 @@ void UIDialog::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
|||
break;
|
||||
#endif
|
||||
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
saveConfig();
|
||||
close();
|
||||
break;
|
||||
|
||||
case kDefaultsCmd:
|
||||
case GuiObject::kDefaultsCmd:
|
||||
setDefaults();
|
||||
break;
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
|||
int lwidth = font.getStringWidth("NTSC Aspect "),
|
||||
pwidth = font.getStringWidth("XXXXxXXXX"),
|
||||
swidth = 69;
|
||||
|
||||
|
||||
WidgetArray wid;
|
||||
VariantList items;
|
||||
|
||||
|
@ -375,7 +375,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
|||
wid.clear();
|
||||
ButtonWidget* b;
|
||||
b = new ButtonWidget(this, font, 10, _h - buttonHeight - 10,
|
||||
buttonWidth, buttonHeight, "Defaults", kDefaultsCmd);
|
||||
buttonWidth, buttonHeight, "Defaults", GuiObject::kDefaultsCmd);
|
||||
wid.push_back(b);
|
||||
addOKCancelBGroup(wid, font);
|
||||
addBGroupToFocusList(wid);
|
||||
|
@ -792,12 +792,12 @@ void VideoDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kOKCmd:
|
||||
case GuiObject::kOKCmd:
|
||||
saveConfig();
|
||||
close();
|
||||
break;
|
||||
|
||||
case kDefaultsCmd:
|
||||
case GuiObject::kDefaultsCmd:
|
||||
setDefaults();
|
||||
break;
|
||||
|
||||
|
|
|
@ -214,7 +214,7 @@ class ButtonWidget : public StaticTextWidget, public CommandSender
|
|||
int x, int y, int w, int h,
|
||||
const string& label, int cmd = 0);
|
||||
ButtonWidget(GuiObject* boss, const GUI::Font& font,
|
||||
int x, int y, int dw,
|
||||
int x, int y, int dw,
|
||||
const string& label, int cmd = 0);
|
||||
ButtonWidget(GuiObject* boss, const GUI::Font& font,
|
||||
int x, int y,
|
||||
|
@ -248,6 +248,7 @@ class ButtonWidget : public StaticTextWidget, public CommandSender
|
|||
class CheckboxWidget : public ButtonWidget
|
||||
{
|
||||
public:
|
||||
enum { kCheckActionCmd = 'CBAC' };
|
||||
enum FillType { Normal, Inactive, Circle };
|
||||
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue