A rather large commit, but basically all that's happened is

converting StringMap to VariantList.  In the process, some of the
code is much cleaner, and the Variant infrastructure allows
work to continue on a more full-featured ContextMenu.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2732 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2013-05-09 14:22:34 +00:00
parent 1326b219f6
commit f4d0641219
53 changed files with 362 additions and 359 deletions

View File

@ -20,8 +20,9 @@
#ifndef VARIANT_HXX
#define VARIANT_HXX
#include "bspf.hxx"
#include "Array.hxx"
#include "Rect.hxx"
#include "bspf.hxx"
/**
This class implements a very simple variant type, which is convertible
@ -74,6 +75,18 @@ class Variant
}
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const Variant EmptyVariant("");
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class VariantList : public Common::Array< pair<string,Variant> >
{
public:
void push_back(const string& name, const Variant& tag = EmptyVariant)
{
ensureCapacity(_size + 1);
_data[_size++] = make_pair(name, tag);
}
};
#endif

View File

@ -47,9 +47,9 @@ Cartridge0840Widget::Cartridge0840Widget(
int xpos = 10,
ypos = addBaseInformation(size, "Fred X. Quimby", info.str()) + myLineHeight;
StringMap items;
items.push_back("0 ($800)", "0");
items.push_back("1 ($840)", "1");
VariantList items;
items.push_back("0 ($800)");
items.push_back("1 ($840)");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($800) "),
myLineHeight, items, "Set bank: ",

View File

@ -52,20 +52,14 @@ Cartridge3EWidget::Cartridge3EWidget(
int xpos = 10,
ypos = addBaseInformation(size, "TigerVision", info.str()) + myLineHeight;
StringMap romitems;
VariantList romitems;
for(uInt32 i = 0; i < myNumRomBanks; ++i)
{
const string& b = BSPF_toString(i);
romitems.push_back(b, b);
}
romitems.push_back(BSPF_toString(i));
romitems.push_back("Inactive", "");
StringMap ramitems;
VariantList ramitems;
for(uInt32 i = 0; i < myNumRamBanks; ++i)
{
const string& b = BSPF_toString(i);
ramitems.push_back(b, b);
}
ramitems.push_back(BSPF_toString(i));
ramitems.push_back("Inactive", "");
ostringstream label;

View File

@ -44,11 +44,11 @@ Cartridge3FWidget::Cartridge3FWidget(
int xpos = 10,
ypos = addBaseInformation(size, "TigerVision", info.str()) + myLineHeight;
StringMap items;
VariantList items;
for(uInt16 i = 0; i < cart.bankCount(); ++i)
{
const string& b = BSPF_toString(i);
items.push_back(b + " ($3F)", b);
items.push_back(b + " ($3F)");
}
ostringstream label;
label << "Set bank ($" << HEX4 << start << " - $" << (start+0x7FF) << "): ";

View File

@ -40,33 +40,21 @@ Cartridge4A50Widget::Cartridge4A50Widget(
ypos = addBaseInformation(cart.mySize, "John Payson / Supercat", info) +
myLineHeight;
StringMap items16, items32, items128, items256;
VariantList items16, items32, items128, items256;
for(uInt32 i = 0; i < 16; ++i)
{
const string& b = BSPF_toString(i);
items16.push_back(b, b);
}
items16.push_back(BSPF_toString(i));
items16.push_back("Inactive", "");
for(uInt32 i = 0; i < 32; ++i)
{
const string& b = BSPF_toString(i);
items32.push_back(b, b);
}
items32.push_back(BSPF_toString(i));
items32.push_back("Inactive", "");
for(uInt32 i = 0; i < 128; ++i)
{
const string& b = BSPF_toString(i);
items128.push_back(b, b);
}
items128.push_back(BSPF_toString(i));
items128.push_back("Inactive", "");
for(uInt32 i = 0; i < 256; ++i)
{
const string& b = BSPF_toString(i);
items256.push_back(b, b);
}
items256.push_back(BSPF_toString(i));
items256.push_back("Inactive", "");
string lowerlabel = "Set lower 2K region ($F000 - $F7FF): ";

View File

@ -37,39 +37,39 @@ CartridgeARWidget::CartridgeARWidget(
int xpos = 10,
ypos = addBaseInformation(size, "Starpath", info) + myLineHeight;
StringMap items;
items.push_back(" 0", "0");
items.push_back(" 1", "1");
items.push_back(" 2", "2");
items.push_back(" 3", "3");
items.push_back(" 4", "4");
items.push_back(" 5", "5");
items.push_back(" 6", "6");
items.push_back(" 7", "7");
items.push_back(" 8", "8");
items.push_back(" 9", "9");
items.push_back(" 10", "10");
items.push_back(" 11", "11");
items.push_back(" 12", "12");
items.push_back(" 13", "13");
items.push_back(" 14", "14");
items.push_back(" 15", "15");
items.push_back(" 16", "16");
items.push_back(" 17", "17");
items.push_back(" 18", "18");
items.push_back(" 19", "19");
items.push_back(" 20", "20");
items.push_back(" 21", "21");
items.push_back(" 22", "22");
items.push_back(" 23", "23");
items.push_back(" 24", "24");
items.push_back(" 25", "25");
items.push_back(" 26", "26");
items.push_back(" 27", "27");
items.push_back(" 28", "28");
items.push_back(" 29", "29");
items.push_back(" 30", "30");
items.push_back(" 31", "31");
VariantList items;
items.push_back(" 0");
items.push_back(" 1");
items.push_back(" 2");
items.push_back(" 3");
items.push_back(" 4");
items.push_back(" 5");
items.push_back(" 6");
items.push_back(" 7");
items.push_back(" 8");
items.push_back(" 9");
items.push_back(" 10");
items.push_back(" 11");
items.push_back(" 12");
items.push_back(" 13");
items.push_back(" 14");
items.push_back(" 15");
items.push_back(" 16");
items.push_back(" 17");
items.push_back(" 18");
items.push_back(" 19");
items.push_back(" 20");
items.push_back(" 21");
items.push_back(" 22");
items.push_back(" 23");
items.push_back(" 24");
items.push_back(" 25");
items.push_back(" 26");
items.push_back(" 27");
items.push_back(" 28");
items.push_back(" 29");
items.push_back(" 30");
items.push_back(" 31");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth(" XX "),
myLineHeight, items, "Set bank: ",

View File

@ -45,11 +45,11 @@ CartridgeCMWidget::CartridgeCMWidget(
int xpos = 10,
ypos = addBaseInformation(size, "CompuMate", info) + myLineHeight;
StringMap items;
items.push_back(" 0 ", "0");
items.push_back(" 1 ", "1");
items.push_back(" 2 ", "2");
items.push_back(" 3 ", "3");
VariantList items;
items.push_back(" 0 ");
items.push_back(" 1 ");
items.push_back(" 2 ");
items.push_back(" 3 ");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth(" 0 "),
myLineHeight, items, "Set bank: ",

View File

@ -39,14 +39,14 @@ CartridgeCTYWidget::CartridgeCTYWidget(
int xpos = 10,
ypos = addBaseInformation(size, "Chris D. Walton", info) + myLineHeight;
StringMap items;
items.push_back("1 ($FF5)", "1");
items.push_back("2 ($FF6)", "2");
items.push_back("3 ($FF7)", "3");
items.push_back("4 ($FF8)", "4");
items.push_back("5 ($FF9)", "5");
items.push_back("6 ($FFA)", "6");
items.push_back("7 ($FFB)", "7");
VariantList items;
items.push_back("1 ($FF5)");
items.push_back("2 ($FF6)");
items.push_back("3 ($FF7)");
items.push_back("4 ($FF8)");
items.push_back("5 ($FF9)");
items.push_back("6 ($FFA)");
items.push_back("7 ($FFB)");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),
myLineHeight, items, "Set bank: ",

View File

@ -54,13 +54,13 @@ CartridgeDPCPlusWidget::CartridgeDPCPlusWidget(
ypos = addBaseInformation(size, "Activision (Pitfall II)", info.str()) +
myLineHeight;
StringMap items;
items.push_back("0 ($FF6)", "0");
items.push_back("1 ($FF7)", "1");
items.push_back("2 ($FF8)", "2");
items.push_back("3 ($FF9)", "3");
items.push_back("4 ($FFA)", "4");
items.push_back("5 ($FFB)", "5");
VariantList items;
items.push_back("0 ($FF6)");
items.push_back("1 ($FF7)");
items.push_back("2 ($FF8)");
items.push_back("3 ($FF9)");
items.push_back("4 ($FFA)");
items.push_back("5 ($FFB)");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),
myLineHeight, items, "Set bank: ",

View File

@ -51,9 +51,9 @@ CartridgeDPCWidget::CartridgeDPCWidget(
ypos = addBaseInformation(size, "Activision (Pitfall II)", info.str()) +
myLineHeight;
StringMap items;
items.push_back("0 ($FF8)", "0");
items.push_back("1 ($FF9)", "1");
VariantList items;
items.push_back("0 ($FF8)");
items.push_back("1 ($FF9)");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),
myLineHeight, items, "Set bank: ",

View File

@ -51,33 +51,33 @@ CartridgeE0Widget::CartridgeE0Widget(
int xpos = 10,
ypos = addBaseInformation(size, "Parker Brothers", info) + myLineHeight;
StringMap items0, items1, items2;
items0.push_back("0 ($FE0)", "0");
items0.push_back("1 ($FE1)", "1");
items0.push_back("2 ($FE2)", "2");
items0.push_back("3 ($FE3)", "3");
items0.push_back("4 ($FE4)", "4");
items0.push_back("5 ($FE5)", "5");
items0.push_back("6 ($FE6)", "6");
items0.push_back("7 ($FE7)", "7");
VariantList items0, items1, items2;
items0.push_back("0 ($FE0)");
items0.push_back("1 ($FE1)");
items0.push_back("2 ($FE2)");
items0.push_back("3 ($FE3)");
items0.push_back("4 ($FE4)");
items0.push_back("5 ($FE5)");
items0.push_back("6 ($FE6)");
items0.push_back("7 ($FE7)");
items1.push_back("0 ($FE8)", "0");
items1.push_back("1 ($FE9)", "1");
items1.push_back("2 ($FEA)", "2");
items1.push_back("3 ($FEB)", "3");
items1.push_back("4 ($FEC)", "4");
items1.push_back("5 ($FED)", "5");
items1.push_back("6 ($FEE)", "6");
items1.push_back("7 ($FEF)", "7");
items1.push_back("0 ($FE8)");
items1.push_back("1 ($FE9)");
items1.push_back("2 ($FEA)");
items1.push_back("3 ($FEB)");
items1.push_back("4 ($FEC)");
items1.push_back("5 ($FED)");
items1.push_back("6 ($FEE)");
items1.push_back("7 ($FEF)");
items2.push_back("0 ($FF0)", "0");
items2.push_back("1 ($FF1)", "1");
items2.push_back("2 ($FF2)", "2");
items2.push_back("3 ($FF3)", "3");
items2.push_back("4 ($FF4)", "4");
items2.push_back("5 ($FF5)", "5");
items2.push_back("6 ($FF6)", "6");
items2.push_back("7 ($FF7)", "7");
items2.push_back("0 ($FF0)");
items2.push_back("1 ($FF1)");
items2.push_back("2 ($FF2)");
items2.push_back("3 ($FF3)");
items2.push_back("4 ($FF4)");
items2.push_back("5 ($FF5)");
items2.push_back("6 ($FF6)");
items2.push_back("7 ($FF7)");
const int lwidth = font.getStringWidth("Set slice for segment X: ");
mySlice0 =

View File

@ -53,20 +53,20 @@ CartridgeE7Widget::CartridgeE7Widget(
ypos = addBaseInformation(size, "M-Network", info.str(), 15) +
myLineHeight;
StringMap items0, items1;
items0.push_back("0 - ROM ($FE0)", "0");
items0.push_back("1 - ROM ($FE1)", "1");
items0.push_back("2 - ROM ($FE2)", "2");
items0.push_back("3 - ROM ($FE3)", "3");
items0.push_back("4 - ROM ($FE4)", "4");
items0.push_back("5 - ROM ($FE5)", "5");
items0.push_back("6 - ROM ($FE6)", "6");
items0.push_back("7 - RAM ($FE7)", "7");
VariantList items0, items1;
items0.push_back("0 - ROM ($FE0)");
items0.push_back("1 - ROM ($FE1)");
items0.push_back("2 - ROM ($FE2)");
items0.push_back("3 - ROM ($FE3)");
items0.push_back("4 - ROM ($FE4)");
items0.push_back("5 - ROM ($FE5)");
items0.push_back("6 - ROM ($FE6)");
items0.push_back("7 - RAM ($FE7)");
items1.push_back("0 - RAM ($FE8)", "0");
items1.push_back("1 - RAM ($FE9)", "1");
items1.push_back("2 - RAM ($FEA)", "2");
items1.push_back("3 - RAM ($FEB)", "3");
items1.push_back("0 - RAM ($FE8)");
items1.push_back("1 - RAM ($FE9)");
items1.push_back("2 - RAM ($FEA)");
items1.push_back("3 - RAM ($FEB)");
const int lwidth = font.getStringWidth("Set slice for upper 256B: "),
fwidth = font.getStringWidth("3 - RAM ($FEB)");

View File

@ -49,23 +49,23 @@ CartridgeEFSCWidget::CartridgeEFSCWidget(
ypos = addBaseInformation(size, "Paul Slocum / Homestar Runner",
info.str()) + myLineHeight;
StringMap items;
items.push_back(" 0 ($FE0)", "0");
items.push_back(" 1 ($FE1)", "1");
items.push_back(" 2 ($FE2)", "2");
items.push_back(" 3 ($FE3)", "3");
items.push_back(" 4 ($FE4)", "4");
items.push_back(" 5 ($FE5)", "5");
items.push_back(" 6 ($FE6)", "6");
items.push_back(" 7 ($FE7)", "7");
items.push_back(" 8 ($FE8)", "8");
items.push_back(" 9 ($FE9)", "9");
items.push_back("10 ($FEA)", "10");
items.push_back("11 ($FEB)", "11");
items.push_back("12 ($FEC)", "12");
items.push_back("13 ($FED)", "13");
items.push_back("14 ($FEE)", "14");
items.push_back("15 ($FEF)", "15");
VariantList items;
items.push_back(" 0 ($FE0)");
items.push_back(" 1 ($FE1)");
items.push_back(" 2 ($FE2)");
items.push_back(" 3 ($FE3)");
items.push_back(" 4 ($FE4)");
items.push_back(" 5 ($FE5)");
items.push_back(" 6 ($FE6)");
items.push_back(" 7 ($FE7)");
items.push_back(" 8 ($FE8)");
items.push_back(" 9 ($FE9)");
items.push_back("10 ($FEA)");
items.push_back("11 ($FEB)");
items.push_back("12 ($FEC)");
items.push_back("13 ($FED)");
items.push_back("14 ($FEE)");
items.push_back("15 ($FEF)");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("15 ($FE0) "),
myLineHeight, items, "Set bank: ",

View File

@ -47,23 +47,23 @@ CartridgeEFWidget::CartridgeEFWidget(
ypos = addBaseInformation(size, "Paul Slocum / Homestar Runner",
info.str()) + myLineHeight;
StringMap items;
items.push_back(" 0 ($FE0)", "0");
items.push_back(" 1 ($FE1)", "1");
items.push_back(" 2 ($FE2)", "2");
items.push_back(" 3 ($FE3)", "3");
items.push_back(" 4 ($FE4)", "4");
items.push_back(" 5 ($FE5)", "5");
items.push_back(" 6 ($FE6)", "6");
items.push_back(" 7 ($FE7)", "7");
items.push_back(" 8 ($FE8)", "8");
items.push_back(" 9 ($FE9)", "9");
items.push_back("10 ($FEA)", "10");
items.push_back("11 ($FEB)", "11");
items.push_back("12 ($FEC)", "12");
items.push_back("13 ($FED)", "13");
items.push_back("14 ($FEE)", "14");
items.push_back("15 ($FEF)", "15");
VariantList items;
items.push_back(" 0 ($FE0)");
items.push_back(" 1 ($FE1)");
items.push_back(" 2 ($FE2)");
items.push_back(" 3 ($FE3)");
items.push_back(" 4 ($FE4)");
items.push_back(" 5 ($FE5)");
items.push_back(" 6 ($FE6)");
items.push_back(" 7 ($FE7)");
items.push_back(" 8 ($FE8)");
items.push_back(" 9 ($FE9)");
items.push_back("10 ($FEA)");
items.push_back("11 ($FEB)");
items.push_back("12 ($FEC)");
items.push_back("13 ($FED)");
items.push_back("14 ($FEE)");
items.push_back("15 ($FEF)");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("15 ($FE0) "),
myLineHeight, items, "Set bank: ",

View File

@ -48,23 +48,23 @@ CartridgeF0Widget::CartridgeF0Widget(
ypos = addBaseInformation(size, "Dynacom Megaboy",
info.str()) + myLineHeight;
StringMap items;
items.push_back(" 0", "0");
items.push_back(" 1", "1");
items.push_back(" 2", "2");
items.push_back(" 3", "3");
items.push_back(" 4", "4");
items.push_back(" 5", "5");
items.push_back(" 6", "6");
items.push_back(" 7", "7");
items.push_back(" 8", "8");
items.push_back(" 9", "9");
items.push_back(" 10", "10");
items.push_back(" 11", "11");
items.push_back(" 12", "12");
items.push_back(" 13", "13");
items.push_back(" 14", "14");
items.push_back(" 15", "15");
VariantList items;
items.push_back(" 0");
items.push_back(" 1");
items.push_back(" 2");
items.push_back(" 3");
items.push_back(" 4");
items.push_back(" 5");
items.push_back(" 6");
items.push_back(" 7");
items.push_back(" 8");
items.push_back(" 9");
items.push_back(" 10");
items.push_back(" 11");
items.push_back(" 12");
items.push_back(" 13");
items.push_back(" 14");
items.push_back(" 15");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth(" 15 "),
myLineHeight, items, "Set bank: ",

View File

@ -48,15 +48,15 @@ CartridgeF4SCWidget::CartridgeF4SCWidget(
int xpos = 10,
ypos = addBaseInformation(size, "Atari", info.str(), 15) + myLineHeight;
StringMap items;
items.push_back("0 ($FF4)", "0");
items.push_back("1 ($FF5)", "1");
items.push_back("2 ($FF6)", "2");
items.push_back("3 ($FF7)", "3");
items.push_back("4 ($FF8)", "4");
items.push_back("5 ($FF9)", "5");
items.push_back("6 ($FFA)", "6");
items.push_back("7 ($FFB)", "7");
VariantList items;
items.push_back("0 ($FF4)");
items.push_back("1 ($FF5)");
items.push_back("2 ($FF6)");
items.push_back("3 ($FF7)");
items.push_back("4 ($FF8)");
items.push_back("5 ($FF9)");
items.push_back("6 ($FFA)");
items.push_back("7 ($FFB)");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),
myLineHeight, items, "Set bank: ",

View File

@ -46,15 +46,15 @@ CartridgeF4Widget::CartridgeF4Widget(
int xpos = 10,
ypos = addBaseInformation(size, "Atari", info.str(), 15) + myLineHeight;
StringMap items;
items.push_back("0 ($FF4)", "0");
items.push_back("1 ($FF5)", "1");
items.push_back("2 ($FF6)", "2");
items.push_back("3 ($FF7)", "3");
items.push_back("4 ($FF8)", "4");
items.push_back("5 ($FF9)", "5");
items.push_back("6 ($FFA)", "6");
items.push_back("7 ($FFB)", "7");
VariantList items;
items.push_back("0 ($FF4)");
items.push_back("1 ($FF5)");
items.push_back("2 ($FF6)");
items.push_back("3 ($FF7)");
items.push_back("4 ($FF8)");
items.push_back("5 ($FF9)");
items.push_back("6 ($FFA)");
items.push_back("7 ($FFB)");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),
myLineHeight, items, "Set bank: ",

View File

@ -48,11 +48,11 @@ CartridgeF6SCWidget::CartridgeF6SCWidget(
int xpos = 10,
ypos = addBaseInformation(size, "Atari", info.str()) + myLineHeight;
StringMap items;
items.push_back("0 ($FF6)", "0");
items.push_back("1 ($FF7)", "1");
items.push_back("2 ($FF8)", "2");
items.push_back("3 ($FF9)", "3");
VariantList items;
items.push_back("0 ($FF6)");
items.push_back("1 ($FF7)");
items.push_back("2 ($FF8)");
items.push_back("3 ($FF9)");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),
myLineHeight, items, "Set bank: ",

View File

@ -46,11 +46,11 @@ CartridgeF6Widget::CartridgeF6Widget(
int xpos = 10,
ypos = addBaseInformation(size, "Atari", info.str()) + myLineHeight;
StringMap items;
items.push_back("0 ($FF6)", "0");
items.push_back("1 ($FF7)", "1");
items.push_back("2 ($FF8)", "2");
items.push_back("3 ($FF9)", "3");
VariantList items;
items.push_back("0 ($FF6)");
items.push_back("1 ($FF7)");
items.push_back("2 ($FF8)");
items.push_back("3 ($FF9)");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),
myLineHeight, items, "Set bank: ",

View File

@ -48,9 +48,9 @@ CartridgeF8SCWidget::CartridgeF8SCWidget(
int xpos = 10,
ypos = addBaseInformation(size, "Atari", info.str()) + myLineHeight;
StringMap items;
items.push_back("0 ($FF8)", "0");
items.push_back("1 ($FF9)", "1");
VariantList items;
items.push_back("0 ($FF8)");
items.push_back("1 ($FF9)");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),
myLineHeight, items, "Set bank: ",

View File

@ -46,9 +46,9 @@ CartridgeF8Widget::CartridgeF8Widget(
int xpos = 10,
ypos = addBaseInformation(size, "Atari", info.str()) + myLineHeight;
StringMap items;
items.push_back("0 ($FF8)", "0");
items.push_back("1 ($FF9)", "1");
VariantList items;
items.push_back("0 ($FF8)");
items.push_back("1 ($FF9)");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),
myLineHeight, items, "Set bank: ",

View File

@ -51,15 +51,15 @@ CartridgeFA2Widget::CartridgeFA2Widget(
ypos = addBaseInformation(size, "Chris D. Walton (Star Castle 2600)",
info.str(), 15) + myLineHeight;
StringMap items;
items.push_back("0 ($FF5)", "0");
items.push_back("1 ($FF6)", "1");
items.push_back("2 ($FF7)", "2");
items.push_back("3 ($FF8)", "3");
items.push_back("4 ($FF9)", "4");
items.push_back("5 ($FFA)", "5");
VariantList items;
items.push_back("0 ($FF5)");
items.push_back("1 ($FF6)");
items.push_back("2 ($FF7)");
items.push_back("3 ($FF8)");
items.push_back("4 ($FF9)");
items.push_back("5 ($FFA)");
if(cart.bankCount() == 7)
items.push_back("6 ($FFB)", "6");
items.push_back("6 ($FFB)");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),

View File

@ -48,10 +48,10 @@ CartridgeFAWidget::CartridgeFAWidget(
int xpos = 10,
ypos = addBaseInformation(size, "CBS", info.str()) + myLineHeight;
StringMap items;
items.push_back("0 ($FF8)", "0");
items.push_back("1 ($FF9)", "1");
items.push_back("2 ($FFA)", "2");
VariantList items;
items.push_back("0 ($FF8)");
items.push_back("1 ($FF9)");
items.push_back("2 ($FFA)");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),
myLineHeight, items, "Set bank: ",

View File

@ -46,7 +46,7 @@ CartridgeMCWidget::CartridgeMCWidget(
ypos = addBaseInformation(size, "Chris Wilkson's Megacart", info) +
myLineHeight;
StringMap items;
VariantList items;
// Add 128 1K 'ROM' blocks
for(uInt32 i = 0x80; i <= 0xFF; ++i)
{
@ -98,15 +98,10 @@ CartridgeMCWidget::CartridgeMCWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeMCWidget::loadConfig()
{
const string& b0 = BSPF_toString(myCart.myCurrentBlock[0]);
const string& b1 = BSPF_toString(myCart.myCurrentBlock[1]);
const string& b2 = BSPF_toString(myCart.myCurrentBlock[2]);
const string& b3 = BSPF_toString(myCart.myCurrentBlock[3]);
mySlice0->setSelected(b0, b0);
mySlice1->setSelected(b1, b1);
mySlice2->setSelected(b2, b2);
mySlice3->setSelected(b3, b3);
mySlice0->setSelected(myCart.myCurrentBlock[0]);
mySlice1->setSelected(myCart.myCurrentBlock[1]);
mySlice2->setSelected(myCart.myCurrentBlock[2]);
mySlice3->setSelected(myCart.myCurrentBlock[3]);
CartDebugWidget::loadConfig();
}
@ -120,16 +115,16 @@ void CartridgeMCWidget::handleCommand(CommandSender* sender,
switch(cmd)
{
case kSlice0Changed:
myCart.myCurrentBlock[0] = atoi(mySlice0->getSelectedTag().c_str());
myCart.myCurrentBlock[0] = mySlice0->getSelectedTag().toInt();
break;
case kSlice1Changed:
myCart.myCurrentBlock[1] = atoi(mySlice1->getSelectedTag().c_str());
myCart.myCurrentBlock[1] = mySlice1->getSelectedTag().toInt();
break;
case kSlice2Changed:
myCart.myCurrentBlock[2] = atoi(mySlice2->getSelectedTag().c_str());
myCart.myCurrentBlock[2] = mySlice2->getSelectedTag().toInt();
break;
case kSlice3Changed:
myCart.myCurrentBlock[3] = atoi(mySlice3->getSelectedTag().c_str());
myCart.myCurrentBlock[3] = mySlice3->getSelectedTag().toInt();
break;
}

View File

@ -30,7 +30,7 @@ CartridgeSBWidget::CartridgeSBWidget(
{
uInt32 size = myCart.mySize;
StringMap items;
VariantList items;
ostringstream info, bank;
info << "SB SUPERbanking, 32 or 64 4K banks\n"
<< "Hotspots are from $800 to $"
@ -48,7 +48,7 @@ CartridgeSBWidget::CartridgeSBWidget(
<< "$" << (start + 0xFFF) << " (hotspot = $" << spot << ")\n";
bank << dec << setw(2) << setfill(' ') << i << " ($" << HEX2 << spot << ")";
items.push_back(bank.str(), BSPF_toString(i));
items.push_back(bank.str());
bank.str("");
}

View File

@ -47,9 +47,9 @@ CartridgeUAWidget::CartridgeUAWidget(
int xpos = 10,
ypos = addBaseInformation(size, "UA Limited", info.str()) + myLineHeight;
StringMap items;
items.push_back("0 ($220)", "0");
items.push_back("1 ($240)", "1");
VariantList items;
items.push_back("0 ($220)");
items.push_back("1 ($240)");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),
myLineHeight, items, "Set bank: ",

View File

@ -49,23 +49,23 @@ CartridgeX07Widget::CartridgeX07Widget(
ypos = addBaseInformation(size, "AtariAge / John Payson / Fred Quimby",
info.str()) + myLineHeight;
StringMap items;
items.push_back(" 0", "0");
items.push_back(" 1", "1");
items.push_back(" 2", "2");
items.push_back(" 3", "3");
items.push_back(" 4", "4");
items.push_back(" 5", "5");
items.push_back(" 6", "6");
items.push_back(" 7", "7");
items.push_back(" 8", "8");
items.push_back(" 9", "9");
items.push_back(" 10", "10");
items.push_back(" 11", "11");
items.push_back(" 12", "12");
items.push_back(" 13", "13");
items.push_back(" 14", "14");
items.push_back(" 15", "15");
VariantList items;
items.push_back(" 0");
items.push_back(" 1");
items.push_back(" 2");
items.push_back(" 3");
items.push_back(" 4");
items.push_back(" 5");
items.push_back(" 6");
items.push_back(" 7");
items.push_back(" 8");
items.push_back(" 9");
items.push_back(" 10");
items.push_back(" 11");
items.push_back(" 12");
items.push_back(" 13");
items.push_back(" 14");
items.push_back(" 15");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth(" 15 "),
myLineHeight, items, "Set bank: ",

View File

@ -64,7 +64,7 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& font,
lineHeight = font.getLineHeight();
int xpos = 10, ypos = 25, lwidth = 9 * fontWidth, col = 0;
StaticTextWidget* t;
StringMap items;
VariantList items;
// Set the strings to be used in the various bit registers
// We only do this once because it's the state that changes, not the strings
@ -378,11 +378,11 @@ void RiotWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
break;
case kP0DiffChanged:
riot.diffP0(myP0Diff->getSelectedTag() != "b");
riot.diffP0(myP0Diff->getSelectedTag().toString() != "b");
break;
case kP1DiffChanged:
riot.diffP1(myP1Diff->getSelectedTag() != "b");
riot.diffP1(myP1Diff->getSelectedTag().toString() != "b");
break;
case kTVTypeChanged:

View File

@ -60,7 +60,7 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& font,
myScrollBar->setTarget(this);
// Add context menu
StringMap l;
VariantList l;
// l.push_back("Add bookmark");
l.push_back("Save ROM", "saverom");
l.push_back("Set PC", "setpc");

View File

@ -72,7 +72,7 @@ RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font,
// 'resolvedata' setting for Distella
xpos += myBank->getWidth() + 20;
StringMap items;
VariantList items;
items.push_back("Never", "never");
items.push_back("Always", "always");
items.push_back("Automatic", "auto");
@ -118,7 +118,8 @@ void RomWidget::loadConfig()
myCurrentBank = cart.getBank();
// Fill romlist the current bank of source or disassembly
myListIsDirty |= cart.disassemble(myResolveData->getSelectedTag(), myListIsDirty);
myListIsDirty |= cart.disassemble(myResolveData->getSelectedTag().toString(),
myListIsDirty);
if(myListIsDirty)
{
myRomList->setList(cart.disassembly(), dbg.breakpoints());
@ -156,7 +157,7 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
case ContextMenu::kItemSelectedCmd:
{
const string& rmb = myRomList->myMenu->getSelectedTag();
const string& rmb = myRomList->myMenu->getSelectedTag().toString();
if(rmb == "saverom")
{

View File

@ -46,7 +46,7 @@ TiaOutputWidget::TiaOutputWidget(GuiObject* boss, const GUI::Font& font,
_type = kTiaOutputWidget;
// Create context menu for commands
StringMap l;
VariantList l;
l.push_back("Fill to scanline", "scanline");
l.push_back("Set breakpoint", "bp");
l.push_back("Set zoom position", "zoom");
@ -89,7 +89,7 @@ void TiaOutputWidget::handleCommand(CommandSender* sender, int cmd, int data, in
{
case ContextMenu::kItemSelectedCmd:
{
const string& rmb = myMenu->getSelectedTag();
const string& rmb = myMenu->getSelectedTag().toString();
if(rmb == "scanline")
{

View File

@ -58,7 +58,7 @@ TiaZoomWidget::TiaZoomWidget(GuiObject* boss, const GUI::Font& font,
myYCenter = myNumRows >> 1;
// Create context menu for zoom levels
StringMap l;
VariantList l;
l.push_back("2x zoom", "2");
l.push_back("4x zoom", "4");
l.push_back("8x zoom", "8");
@ -202,7 +202,7 @@ void TiaZoomWidget::handleCommand(CommandSender* sender, int cmd, int data, int
{
case ContextMenu::kItemSelectedCmd:
{
int level = (int) atoi(myMenu->getSelectedTag().c_str());
int level = myMenu->getSelectedTag().toInt();
if(level > 0)
zoom(level);
break;

View File

@ -1811,7 +1811,7 @@ void EventHandler::getActionList(EventMode mode, StringList& l) const
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::getComboList(EventMode, StringMap& l) const
void EventHandler::getComboList(EventMode, VariantList& l) const
{
// For now, this only works in emulation mode

View File

@ -27,9 +27,9 @@ class Console;
class OSystem;
class DialogContainer;
class EventMappingWidget;
class StringMap;
class StringList;
class MouseControl;
class StringList;
class VariantList;
#include "Array.hxx"
#include "Event.hxx"
@ -210,7 +210,7 @@ class EventHandler
bool frying() const { return myFryingFlag; }
void getActionList(EventMode mode, StringList& list) const;
void getComboList(EventMode mode, StringMap& map) const;
void getComboList(EventMode mode, VariantList& map) const;
/** Used to access the list of events assigned to a specific combo event. */
void getComboListForEvent(Event::Type event, StringList& list) const;

View File

@ -929,7 +929,7 @@ uInt8 FrameBuffer::getPhosphor(uInt8 c1, uInt8 c2) const
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const StringMap& FrameBuffer::supportedTIAFilters(const string& type)
const VariantList& FrameBuffer::supportedTIAFilters(const string& type)
{
uInt32 max_zoom = maxWindowSizeForScreen(320, 210,
myOSystem->desktopWidth(), myOSystem->desktopHeight());

View File

@ -37,6 +37,7 @@ namespace GUI {
#include "Rect.hxx"
#include "StringList.hxx"
#include "NTSCFilter.hxx"
#include "Variant.hxx"
#include "bspf.hxx"
// Different types of framebuffer derived objects
@ -258,7 +259,7 @@ class FrameBuffer
/**
Get the supported TIA filters for the given framebuffer type.
*/
const StringMap& supportedTIAFilters(const string& type);
const VariantList& supportedTIAFilters(const string& type);
/**
Get the TIA pixel associated with the given TIA buffer index,
@ -526,7 +527,7 @@ class FrameBuffer
Uint8 myDefPalette24[256+kNumColors][3];
// Names of the TIA filters that can be used for this framebuffer
StringMap myTIAFilters;
VariantList myTIAFilters;
private:
/**

View File

@ -51,7 +51,7 @@ AudioDialog::AudioDialog(OSystem* osystem, DialogContainer* parent,
int lwidth = font.getStringWidth("Sample Size (*): "),
pwidth = font.getStringWidth("512 bytes");
WidgetArray wid;
StringMap items;
VariantList items;
// Set real dimensions
_w = 35 * fontWidth + 10;
@ -159,10 +159,10 @@ void AudioDialog::saveConfig()
instance().sound().setVolume(myVolumeSlider->getValue());
// Fragsize
settings.setValue("fragsize", myFragsizePopup->getSelectedTag());
settings.setValue("fragsize", myFragsizePopup->getSelectedTag().toString());
// Output frequency
settings.setValue("freq", myFreqPopup->getSelectedTag());
settings.setValue("freq", myFreqPopup->getSelectedTag().toString());
// Enable/disable sound (requires a restart to take effect)
instance().sound().setEnabled(mySoundEnableCheckbox->getState());

View File

@ -35,7 +35,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ComboDialog::ComboDialog(GuiObject* boss, const GUI::Font& font,
const StringMap& combolist)
const VariantList& combolist)
: Dialog(&boss->instance(), &boss->parent(), 0, 0, 0, 0),
myComboEvent(Event::NoType)
{
@ -129,7 +129,7 @@ void ComboDialog::saveConfig()
{
StringList events;
for(int i = 0; i < 8; ++i)
events.push_back(myEvents[i]->getSelectedTag());
events.push_back(myEvents[i]->getSelectedTag().toString());
instance().eventHandler().setComboListForEvent(myComboEvent, events);
}

View File

@ -23,7 +23,7 @@
class PopUpWidget;
class EditTextWidget;
class StaticTextWidget;
class StringMap;
class VariantList;
class OSystem;
#include "Dialog.hxx"
@ -32,7 +32,7 @@ class OSystem;
class ComboDialog : public Dialog
{
public:
ComboDialog(GuiObject* boss, const GUI::Font& font, const StringMap& combolist);
ComboDialog(GuiObject* boss, const GUI::Font& font, const VariantList& combolist);
~ComboDialog();
/** Place the dialog onscreen and center it */

View File

@ -29,7 +29,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ContextMenu::ContextMenu(GuiObject* boss, const GUI::Font& font,
const StringMap& items, int cmd)
const VariantList& items, int cmd)
: Dialog(&boss->instance(), &boss->parent(), 0, 0, 16, 16),
CommandSender(boss),
_rowHeight(font.getLineHeight()),
@ -56,7 +56,7 @@ ContextMenu::~ContextMenu()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void ContextMenu::addItems(const StringMap& items)
void ContextMenu::addItems(const VariantList& items)
{
_entries.clear();
_entries = items;
@ -140,13 +140,13 @@ void ContextMenu::setSelected(int item)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void ContextMenu::setSelected(const string& tag, const string& defaultTag)
void ContextMenu::setSelected(const Variant& tag, const Variant& defaultTag)
{
if(tag != "") // indicates that the defaultTag should be used instead
{
for(unsigned int item = 0; item < _entries.size(); ++item)
{
if(BSPF_equalsIgnoreCase(_entries[item].second, tag))
if(BSPF_equalsIgnoreCase(_entries[item].second.toString(), tag.toString()))
{
setSelected(item);
return;
@ -157,7 +157,7 @@ void ContextMenu::setSelected(const string& tag, const string& defaultTag)
// If we get this far, the value wasn't found; use the default value
for(unsigned int item = 0; item < _entries.size(); ++item)
{
if(BSPF_equalsIgnoreCase(_entries[item].second, defaultTag))
if(BSPF_equalsIgnoreCase(_entries[item].second.toString(), defaultTag.toString()))
{
setSelected(item);
return;
@ -190,9 +190,9 @@ const string& ContextMenu::getSelectedName() const
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const string& ContextMenu::getSelectedTag() const
const Variant& ContextMenu::getSelectedTag() const
{
return (_selectedItem >= 0) ? _entries[_selectedItem].second : EmptyString;
return (_selectedItem >= 0) ? _entries[_selectedItem].second : EmptyVariant;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -26,6 +26,7 @@
#include "bspf.hxx"
#include "Command.hxx"
#include "Dialog.hxx"
#include "Variant.hxx"
/**
* Popup context menu which, when clicked, "pop up" a list of items and
@ -46,11 +47,11 @@ class ContextMenu : public Dialog, public CommandSender
public:
ContextMenu(GuiObject* boss, const GUI::Font& font,
const StringMap& items, int cmd = 0);
const VariantList& items, int cmd = 0);
virtual ~ContextMenu();
/** Add the given items to the widget. */
void addItems(const StringMap& items);
void addItems(const VariantList& items);
/** Show context menu onscreen at the specified coordinates */
void show(uInt32 x, uInt32 y, int item = -1);
@ -59,7 +60,7 @@ class ContextMenu : public Dialog, public CommandSender
void setSelected(int item);
/** Select the first entry matching the given tag. */
void setSelected(const string& tag, const string& defaultTag);
void setSelected(const Variant& tag, const Variant& defaultTag);
/** Select the highest/last entry in the internal list. */
void setSelectedMax();
@ -70,7 +71,7 @@ class ContextMenu : public Dialog, public CommandSender
/** Accessor methods for the currently selected item. */
int getSelected() const;
const string& getSelectedName() const;
const string& getSelectedTag() const;
const Variant& getSelectedTag() const;
/** This dialog uses its own positioning, so we override Dialog::center() */
void center();
@ -116,7 +117,7 @@ class ContextMenu : public Dialog, public CommandSender
void sendSelection();
private:
StringMap _entries;
VariantList _entries;
int _rowHeight;
int _firstEntry, _numEntries;

View File

@ -31,7 +31,7 @@
#include "StringListWidget.hxx"
#include "Widget.hxx"
#include "ComboDialog.hxx"
#include "Variant.hxx"
#include "EventMappingWidget.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -97,7 +97,7 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font,
myComboButton->setTarget(this);
addFocusWidget(myComboButton);
StringMap combolist;
VariantList combolist;
instance().eventHandler().getComboList(mode, combolist);
myComboDialog = new ComboDialog(boss, font, combolist);
}

View File

@ -149,7 +149,7 @@ FileSnapDialog::FileSnapDialog(
wid.push_back(mySnap1x);
// Snapshot interval (continuous mode)
StringMap items;
VariantList items;
items.clear();
items.push_back("1 second", "1");
items.push_back("2 seconds", "2");
@ -223,7 +223,8 @@ void FileSnapDialog::saveConfig()
instance().settings().setValue("nvramdir", myNVRamPath->getEditString());
instance().settings().setValue("sssingle", mySnapSingle->getState());
instance().settings().setValue("ss1x", mySnap1x->getState());
instance().settings().setValue("ssinterval", mySnapInterval->getSelectedTag());
instance().settings().setValue("ssinterval",
mySnapInterval->getSelectedTag().toString());
// Flush changes to disk and inform the OSystem
instance().saveConfig();

View File

@ -53,7 +53,7 @@ GameInfoDialog::GameInfoDialog(
const int vBorder = 4;
int xpos, ypos, lwidth, fwidth, pwidth, tabID;
WidgetArray wid;
StringMap items, ports, ctrls;
VariantList items, ports, ctrls;
// Set real dimensions
_w = 52 * fontWidth + 8;
@ -515,30 +515,31 @@ void GameInfoDialog::saveConfig()
myGameProperties.set(Cartridge_ModelNo, myModelNo->getEditString());
myGameProperties.set(Cartridge_Rarity, myRarity->getEditString());
myGameProperties.set(Cartridge_Note, myNote->getEditString());
myGameProperties.set(Cartridge_Sound, mySound->getSelectedTag());
myGameProperties.set(Cartridge_Type, myType->getSelectedTag());
myGameProperties.set(Cartridge_Sound, mySound->getSelectedTag().toString());
myGameProperties.set(Cartridge_Type, myType->getSelectedTag().toString());
// Console properties
myGameProperties.set(Console_LeftDifficulty, myLeftDiff->getSelectedTag());
myGameProperties.set(Console_RightDifficulty, myRightDiff->getSelectedTag());
myGameProperties.set(Console_TelevisionType, myTVType->getSelectedTag());
myGameProperties.set(Console_LeftDifficulty, myLeftDiff->getSelectedTag().toString());
myGameProperties.set(Console_RightDifficulty, myRightDiff->getSelectedTag().toString());
myGameProperties.set(Console_TelevisionType, myTVType->getSelectedTag().toString());
// Controller properties
myGameProperties.set(Controller_Left, myP0Controller->getSelectedTag());
myGameProperties.set(Controller_Right, myP1Controller->getSelectedTag());
myGameProperties.set(Controller_Left, myP0Controller->getSelectedTag().toString());
myGameProperties.set(Controller_Right, myP1Controller->getSelectedTag().toString());
myGameProperties.set(Console_SwapPorts,
myLeftPort->getSelectedTag() == "L" ? "NO" : "YES");
myGameProperties.set(Controller_SwapPaddles, mySwapPaddles->getSelectedTag());
string mcontrol = myMouseControl->getSelectedTag();
myLeftPort->getSelectedTag().toString() == "L" ? "NO" : "YES");
myGameProperties.set(Controller_SwapPaddles, mySwapPaddles->getSelectedTag().toString());
string mcontrol = myMouseControl->getSelectedTag().toString();
if(mcontrol != "auto")
mcontrol = myMouseX->getSelectedTag() + myMouseY->getSelectedTag();
mcontrol = myMouseX->getSelectedTag().toString() +
myMouseY->getSelectedTag().toString();
myGameProperties.set(Controller_MouseAxis, mcontrol);
// Display properties
myGameProperties.set(Display_Format, myFormat->getSelectedTag());
myGameProperties.set(Display_Format, myFormat->getSelectedTag().toString());
myGameProperties.set(Display_YStart, myYStart->getEditString());
myGameProperties.set(Display_Height, myHeight->getEditString());
myGameProperties.set(Display_Phosphor, myPhosphor->getSelectedTag());
myGameProperties.set(Display_Phosphor, myPhosphor->getSelectedTag().toString());
myGameProperties.set(Display_PPBlend, myPPBlendLabel->getLabel());
// Determine whether to add or remove an entry from the properties set
@ -592,7 +593,7 @@ void GameInfoDialog::handleCommand(CommandSender* sender, int cmd,
case kPhosphorChanged:
{
bool status = myPhosphor->getSelectedTag() == "YES";
bool status = myPhosphor->getSelectedTag().toString() == "YES";
myPPBlend->setEnabled(status);
myPPBlendLabel->setEnabled(status);
break;
@ -604,7 +605,7 @@ void GameInfoDialog::handleCommand(CommandSender* sender, int cmd,
case kMCtrlChanged:
{
bool state = myMouseControl->getSelectedTag() != "auto";
bool state = myMouseControl->getSelectedTag().toString() != "auto";
myMouseX->setEnabled(state);
myMouseY->setEnabled(state);
break;

View File

@ -46,7 +46,7 @@ GlobalPropsDialog::
int lwidth = font.getStringWidth("Right Difficulty: "),
pwidth = font.getStringWidth("CM (SpectraVideo CompuMate)");
WidgetArray wid;
StringMap items;
VariantList items;
// Set real dimensions
_w = lwidth + pwidth + fontWidth*3 + 15;
@ -200,19 +200,19 @@ void GlobalPropsDialog::saveConfig()
Settings& settings = instance().settings();
string s;
s = myBSType->getSelectedTag();
s = myBSType->getSelectedTag().toString();
if(s == "AUTO") s = "";
settings.setValue("bs", s);
s = myLeftDiff->getSelectedTag();
s = myLeftDiff->getSelectedTag().toString();
if(s == "DEFAULT") s = "";
settings.setValue("ld", s);
s = myRightDiff->getSelectedTag();
s = myRightDiff->getSelectedTag().toString();
if(s == "DEFAULT") s = "";
settings.setValue("rd", s);
s = myTVType->getSelectedTag();
s = myTVType->getSelectedTag().toString();
if(s == "DEFAULT") s = "";
settings.setValue("tv", s);

View File

@ -108,7 +108,7 @@ void InputDialog::addDevicePortTab(const GUI::Font& font)
fontHeight = font.getFontHeight();
int xpos, ypos, lwidth, pwidth, tabID;
WidgetArray wid;
StringMap items;
VariantList items;
// Devices/ports
tabID = myTab->addTab("Devices & Ports");
@ -234,7 +234,7 @@ void InputDialog::loadConfig()
void InputDialog::saveConfig()
{
// Left & right ports
instance().eventHandler().mapStelladaptors(mySAPort->getSelectedTag());
instance().eventHandler().mapStelladaptors(mySAPort->getSelectedTag().toString());
// Joystick deadzone
int deadzone = myDeadzone->getValue();

View File

@ -183,7 +183,7 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
addToFocusList(wid);
// Create context menu for ROM list options
StringMap l;
VariantList l;
l.push_back("Override properties", "override");
l.push_back("Filter listing", "filter");
l.push_back("Reload listing", "reload");
@ -387,7 +387,7 @@ void LauncherDialog::loadRomInfo()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void LauncherDialog::handleContextMenu()
{
const string& cmd = myMenu->getSelectedTag();
const string& cmd = myMenu->getSelectedTag().toString();
if(cmd == "override")
{

View File

@ -48,7 +48,7 @@ LauncherFilterDialog::LauncherFilterDialog(GuiObject* boss, const GUI::Font& fon
int lwidth = font.getStringWidth("Show: "),
pwidth = font.getStringWidth("ROMs ending with");
WidgetArray wid;
StringMap items;
VariantList items;
// Set real dimensions
_w = 3 * buttonWidth;//lwidth + pwidth + fontWidth*5 + 10;
@ -173,7 +173,7 @@ void LauncherFilterDialog::loadConfig()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void LauncherFilterDialog::saveConfig()
{
const string& type = myFileType->getSelectedTag();
const string& type = myFileType->getSelectedTag().toString();
if(type == "allfiles" || type == "allroms")
instance().settings().setValue("launcherexts", type);
else
@ -251,7 +251,7 @@ void LauncherFilterDialog::handleCommand(CommandSender* sender, int cmd,
break;
case kFileTypeChanged:
handleFileTypeChange(myFileType->getSelectedTag());
handleFileTypeChange(myFileType->getSelectedTag().toString());
break;
default:

View File

@ -62,7 +62,7 @@ LoggerDialog::LoggerDialog(OSystem* osystem, DialogContainer* parent,
// Level of logging (how much info to print)
xpos += 20;
StringMap items;
VariantList items;
items.clear();
items.push_back("None", "0");
items.push_back("Basic", "1");
@ -108,7 +108,7 @@ void LoggerDialog::loadConfig()
void LoggerDialog::saveConfig()
{
instance().settings().setValue("loglevel",
myLogLevel->getSelectedTag());
myLogLevel->getSelectedTag().toString());
instance().settings().setValue("logtoconsole", myLogToConsole->getState());
}

View File

@ -44,7 +44,7 @@ static unsigned int up_down_arrows[8] = {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PopUpWidget::PopUpWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h, const StringMap& list,
int x, int y, int w, int h, const VariantList& list,
const string& label, int labelWidth, int cmd)
: Widget(boss, font, x, y - 1, w, h + 2),
CommandSender(boss),

View File

@ -45,7 +45,7 @@ class PopUpWidget : public Widget, public CommandSender
{
public:
PopUpWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h, const StringMap& items,
int x, int y, int w, int h, const VariantList& items,
const string& label, int labelWidth = 0, int cmd = 0);
~PopUpWidget();
@ -53,16 +53,17 @@ class PopUpWidget : public Widget, public CommandSender
/** Various selection methods passed directly to the underlying menu
See ContextMenu.hxx for more information. */
void addItems(const StringMap& items) { myMenu->addItems(items); }
void setSelected(int item) { myMenu->setSelected(item); }
void setSelected(const string& tag,
const string& def) { myMenu->setSelected(tag, def); }
void addItems(const VariantList& items) { myMenu->addItems(items); }
void setSelected(int item) { myMenu->setSelected(item); }
void setSelected(const Variant& tag,
const Variant& def = EmptyVariant)
{ myMenu->setSelected(tag, def); }
void setSelectedMax() { myMenu->setSelectedMax(); }
void clearSelection() { myMenu->clearSelection(); }
int getSelected() const { return myMenu->getSelected(); }
const string& getSelectedName() const { return myMenu->getSelectedName(); }
const string& getSelectedTag() const { return myMenu->getSelectedTag(); }
const Variant& getSelectedTag() const { return myMenu->getSelectedTag(); }
bool wantsFocus() { return true; }

View File

@ -51,7 +51,7 @@ UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
int xpos, ypos, tabID;
int lwidth, pwidth = font.getStringWidth("Standard");
WidgetArray wid;
StringMap items;
VariantList items;
// Set real dimensions
_w = 37 * fontWidth + 10;
@ -351,15 +351,15 @@ void UIDialog::saveConfig()
// Launcher font
instance().settings().setValue("launcherfont",
myLauncherFontPopup->getSelectedTag());
myLauncherFontPopup->getSelectedTag().toString());
// ROM launcher info viewer
instance().settings().setValue("romviewer",
myRomViewerPopup->getSelectedTag());
myRomViewerPopup->getSelectedTag().toString());
// Exit to Launcher
instance().settings().setValue("exitlauncher",
myLauncherExitPopup->getSelectedTag());
myLauncherExitPopup->getSelectedTag().toString());
// Debugger size
instance().settings().setValue("debuggerres",
@ -368,17 +368,17 @@ void UIDialog::saveConfig()
// UI palette
instance().settings().setValue("uipalette",
myPalettePopup->getSelectedTag());
myPalettePopup->getSelectedTag().toString());
// Listwidget quick delay
instance().settings().setValue("listdelay",
myListDelayPopup->getSelectedTag());
ListWidget::setQuickSelectDelay(atoi(myListDelayPopup->getSelectedTag().c_str()));
myListDelayPopup->getSelectedTag().toString());
ListWidget::setQuickSelectDelay(myListDelayPopup->getSelectedTag().toInt());
// Mouse wheel lines
instance().settings().setValue("mwheel",
myWheelLinesPopup->getSelectedTag());
ScrollBarWidget::setWheelLines(atoi(myWheelLinesPopup->getSelectedTag().c_str()));
myWheelLinesPopup->getSelectedTag().toString());
ScrollBarWidget::setWheelLines(myWheelLinesPopup->getSelectedTag().toInt());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -56,7 +56,7 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
pwidth = font.getStringWidth("1920x1200"),
fwidth = font.getStringWidth("Renderer: ");
WidgetArray wid;
StringMap items;
VariantList items;
// Set real dimensions
_w = BSPF_min(52 * fontWidth + 10, max_w);
@ -409,7 +409,7 @@ void VideoDialog::loadConfig()
// TIA Filter
// These are dynamically loaded, since they depend on the size of
// the desktop and which renderer we're using
const StringMap& items =
const VariantList& items =
instance().frameBuffer().supportedTIAFilters(gl ? "gl" : "soft");
myTIAFilterPopup->addItems(items);
myTIAFilterPopup->setSelected(instance().settings().getString("tia_filter"),
@ -495,23 +495,28 @@ void VideoDialog::loadConfig()
void VideoDialog::saveConfig()
{
// Renderer setting
instance().settings().setValue("video", myRendererPopup->getSelectedTag());
instance().settings().setValue("video",
myRendererPopup->getSelectedTag().toString());
// TIA Filter
instance().settings().setValue("tia_filter", myTIAFilterPopup->getSelectedTag());
instance().settings().setValue("tia_filter",
myTIAFilterPopup->getSelectedTag().toString());
// TIA Palette
instance().settings().setValue("palette", myTIAPalettePopup->getSelectedTag());
instance().settings().setValue("palette",
myTIAPalettePopup->getSelectedTag().toString());
// Fullscreen resolution
instance().settings().setValue("fullres", myFSResPopup->getSelectedTag());
instance().settings().setValue("fullres",
myFSResPopup->getSelectedTag().toString());
// Wait between frames
instance().settings().setValue("timing", myFrameTimingPopup->getSelectedTag());
instance().settings().setValue("timing",
myFrameTimingPopup->getSelectedTag().toString());
// GL Filter setting
instance().settings().setValue("gl_inter",
myGLFilterPopup->getSelectedTag() == "linear" ? true : false);
myGLFilterPopup->getSelectedTag().toString() == "linear" ? true : false);
// GL aspect ratio setting (NTSC and PAL)
instance().settings().setValue("gl_aspectn", myNAspectRatioLabel->getLabel());
@ -528,7 +533,8 @@ void VideoDialog::saveConfig()
}
// Fullscreen
instance().settings().setValue("fullscreen", myFullscreenPopup->getSelectedTag());
instance().settings().setValue("fullscreen",
myFullscreenPopup->getSelectedTag().toString());
// PAL color-loss effect
instance().settings().setValue("colorloss", myColorLossCheckbox->getState());
@ -551,7 +557,8 @@ void VideoDialog::saveConfig()
instance().settings().setValue("fastscbios", myFastSCBiosCheckbox->getState());
// TV Mode
instance().settings().setValue("tv_filter", myTVMode->getSelectedTag());
instance().settings().setValue("tv_filter",
myTVMode->getSelectedTag().toString());
// TV Custom adjustables
NTSCFilter::Adjustable adj;
@ -742,11 +749,11 @@ void VideoDialog::handleCommand(CommandSender* sender, int cmd,
break;
case kFullScrChanged:
handleFullscreenChange(myFullscreenPopup->getSelectedTag() != "-1");
handleFullscreenChange(myFullscreenPopup->getSelectedTag().toString() != "-1");
break;
case kTVModeChanged:
handleTVModeChange((NTSCFilter::Preset)atoi(myTVMode->getSelectedTag().c_str()));
handleTVModeChange((NTSCFilter::Preset)myTVMode->getSelectedTag().toInt());
case kTVSharpChanged: myTVSharpLabel->setValue(myTVSharp->getValue());
break;