mirror of https://github.com/stella-emu/stella.git
refined some more dialogs
This commit is contained in:
parent
d7dd6db9b8
commit
795c84de9d
|
@ -35,80 +35,82 @@ ConfigPathDialog::ConfigPathDialog(
|
||||||
myBrowser(nullptr),
|
myBrowser(nullptr),
|
||||||
myIsGlobal(boss != nullptr)
|
myIsGlobal(boss != nullptr)
|
||||||
{
|
{
|
||||||
|
const int VBORDER = 10;
|
||||||
|
const int HBORDER = 10;
|
||||||
|
const int V_GAP = 4;
|
||||||
|
const int H_GAP = 8;
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
fontWidth = font.getMaxCharWidth(),
|
fontWidth = font.getMaxCharWidth(),
|
||||||
buttonWidth = font.getStringWidth("Properties file") + 20,
|
buttonWidth = font.getStringWidth("Properties file") + 20,
|
||||||
buttonHeight = font.getLineHeight() + 4;
|
buttonHeight = font.getLineHeight() + 4;
|
||||||
const int vBorder = 8;
|
|
||||||
const int hBorder = 10;
|
|
||||||
int xpos, ypos;
|
int xpos, ypos;
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
ButtonWidget* b;
|
ButtonWidget* b;
|
||||||
|
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
_w = 56 * fontWidth + 8;
|
_w = 64 * fontWidth + HBORDER*2;
|
||||||
_h = 9 * (lineHeight + 4) + 10;
|
_h = 9 * (lineHeight + V_GAP) + 10;
|
||||||
|
|
||||||
xpos = hBorder; ypos = vBorder;
|
xpos = HBORDER; ypos = VBORDER;
|
||||||
|
|
||||||
// ROM path
|
// ROM path
|
||||||
ButtonWidget* romButton =
|
ButtonWidget* romButton =
|
||||||
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
"ROM path" + ELLIPSIS, kChooseRomDirCmd);
|
"ROM path" + ELLIPSIS, kChooseRomDirCmd);
|
||||||
wid.push_back(romButton);
|
wid.push_back(romButton);
|
||||||
xpos += buttonWidth + 10;
|
xpos += buttonWidth + H_GAP;
|
||||||
myRomPath = new EditTextWidget(this, font, xpos, ypos + 2,
|
myRomPath = new EditTextWidget(this, font, xpos, ypos + 1,
|
||||||
_w - xpos - 10, lineHeight, "");
|
_w - xpos - HBORDER, lineHeight, "");
|
||||||
wid.push_back(myRomPath);
|
wid.push_back(myRomPath);
|
||||||
|
|
||||||
// Cheat file
|
// Cheat file
|
||||||
xpos = hBorder; ypos += romButton->getHeight() + 3;
|
xpos = HBORDER; ypos += buttonHeight + V_GAP;
|
||||||
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
"Cheat file" + ELLIPSIS, kChooseCheatFileCmd);
|
"Cheat file" + ELLIPSIS, kChooseCheatFileCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
xpos += buttonWidth + 10;
|
xpos += buttonWidth + H_GAP;
|
||||||
myCheatFile = new EditTextWidget(this, font, xpos, ypos + 2,
|
myCheatFile = new EditTextWidget(this, font, xpos, ypos + 1,
|
||||||
_w - xpos - 10, lineHeight, "");
|
_w - xpos - HBORDER, lineHeight, "");
|
||||||
wid.push_back(myCheatFile);
|
wid.push_back(myCheatFile);
|
||||||
|
|
||||||
// Palette file
|
// Palette file
|
||||||
xpos = hBorder; ypos += b->getHeight() + 3;
|
xpos = HBORDER; ypos += buttonHeight + V_GAP;
|
||||||
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
"Palette file" + ELLIPSIS, kChoosePaletteFileCmd);
|
"Palette file" + ELLIPSIS, kChoosePaletteFileCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
xpos += buttonWidth + 10;
|
xpos += buttonWidth + H_GAP;
|
||||||
myPaletteFile = new EditTextWidget(this, font, xpos, ypos + 2,
|
myPaletteFile = new EditTextWidget(this, font, xpos, ypos + 1,
|
||||||
_w - xpos - 10, lineHeight, "");
|
_w - xpos - HBORDER, lineHeight, "");
|
||||||
wid.push_back(myPaletteFile);
|
wid.push_back(myPaletteFile);
|
||||||
|
|
||||||
// Properties file
|
// Properties file
|
||||||
xpos = hBorder; ypos += b->getHeight() + 3;
|
xpos = HBORDER; ypos += buttonHeight + V_GAP;
|
||||||
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
"Properties file" + ELLIPSIS, kChoosePropsFileCmd);
|
"Properties file" + ELLIPSIS, kChoosePropsFileCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
xpos += buttonWidth + 10;
|
xpos += buttonWidth + H_GAP;
|
||||||
myPropsFile = new EditTextWidget(this, font, xpos, ypos + 2,
|
myPropsFile = new EditTextWidget(this, font, xpos, ypos + 1,
|
||||||
_w - xpos - 10, lineHeight, "");
|
_w - xpos - HBORDER, lineHeight, "");
|
||||||
wid.push_back(myPropsFile);
|
wid.push_back(myPropsFile);
|
||||||
|
|
||||||
// State directory
|
// State directory
|
||||||
xpos = hBorder; ypos += b->getHeight() + 3;
|
xpos = HBORDER; ypos += buttonHeight + V_GAP;
|
||||||
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
"State path" + ELLIPSIS, kChooseStateDirCmd);
|
"State path" + ELLIPSIS, kChooseStateDirCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
xpos += buttonWidth + 10;
|
xpos += buttonWidth + H_GAP;
|
||||||
myStatePath = new EditTextWidget(this, font, xpos, ypos + 2,
|
myStatePath = new EditTextWidget(this, font, xpos, ypos + 1,
|
||||||
_w - xpos - 10, lineHeight, "");
|
_w - xpos - HBORDER, lineHeight, "");
|
||||||
wid.push_back(myStatePath);
|
wid.push_back(myStatePath);
|
||||||
|
|
||||||
// NVRAM directory
|
// NVRAM directory
|
||||||
xpos = hBorder; ypos += b->getHeight() + 3;
|
xpos = HBORDER; ypos += buttonHeight + V_GAP;
|
||||||
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
"NVRAM path" + ELLIPSIS, kChooseNVRamDirCmd);
|
"NVRAM path" + ELLIPSIS, kChooseNVRamDirCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
xpos += buttonWidth + 10;
|
xpos += buttonWidth + H_GAP;
|
||||||
myNVRamPath = new EditTextWidget(this, font, xpos, ypos + 2,
|
myNVRamPath = new EditTextWidget(this, font, xpos, ypos + 1,
|
||||||
_w - xpos - 10, lineHeight, "");
|
_w - xpos - HBORDER, lineHeight, "");
|
||||||
wid.push_back(myNVRamPath);
|
wid.push_back(myNVRamPath);
|
||||||
|
|
||||||
// Add Defaults, OK and Cancel buttons
|
// Add Defaults, OK and Cancel buttons
|
||||||
|
|
|
@ -115,11 +115,11 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
|
|
||||||
// Add textfield to show current directory
|
// Add textfield to show current directory
|
||||||
xpos = 10;
|
xpos = 10;
|
||||||
xpos += 5; ypos += myList->getHeight() + 4;
|
ypos += myList->getHeight() + 4;
|
||||||
lwidth = font.getStringWidth("Dir ");
|
lwidth = font.getStringWidth("Path ");
|
||||||
myDirLabel = new StaticTextWidget(this, font, xpos, ypos+2, lwidth, fontHeight,
|
myDirLabel = new StaticTextWidget(this, font, xpos, ypos+2, lwidth, fontHeight,
|
||||||
"Dir", TextAlign::Left);
|
"Path", TextAlign::Left);
|
||||||
xpos += lwidth + 5;
|
xpos += lwidth;
|
||||||
myDir = new EditTextWidget(this, font, xpos, ypos, _w - xpos - 10, lineHeight, "");
|
myDir = new EditTextWidget(this, font, xpos, ypos, _w - xpos - 10, lineHeight, "");
|
||||||
myDir->setEditable(false, true);
|
myDir->setEditable(false, true);
|
||||||
myDir->clearFlags(WIDGET_RETAIN_FOCUS);
|
myDir->clearFlags(WIDGET_RETAIN_FOCUS);
|
||||||
|
|
|
@ -40,8 +40,8 @@ RomAuditDialog::RomAuditDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
myMaxWidth(max_w),
|
myMaxWidth(max_w),
|
||||||
myMaxHeight(max_h)
|
myMaxHeight(max_h)
|
||||||
{
|
{
|
||||||
const int vBorder = 10;
|
const int VBORDER = 10;
|
||||||
const int hBorder = 10;
|
const int HBORDER = 10;
|
||||||
|
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
fontWidth = font.getMaxCharWidth(),
|
fontWidth = font.getMaxCharWidth(),
|
||||||
|
@ -49,44 +49,44 @@ RomAuditDialog::RomAuditDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
buttonWidth = font.getStringWidth("Audit path" + ELLIPSIS) + 20,
|
buttonWidth = font.getStringWidth("Audit path" + ELLIPSIS) + 20,
|
||||||
buttonHeight = font.getLineHeight() + 4,
|
buttonHeight = font.getLineHeight() + 4,
|
||||||
lwidth = font.getStringWidth("ROMs without properties (skipped) ");
|
lwidth = font.getStringWidth("ROMs without properties (skipped) ");
|
||||||
int xpos, ypos = vBorder;
|
int xpos, ypos = VBORDER;
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
|
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
_w = 54 * fontWidth + 10;
|
_w = 64 * fontWidth + HBORDER * 2;
|
||||||
_h = 7 * (lineHeight + 4) + 10;
|
_h = 7 * (lineHeight + 4) + 10;
|
||||||
|
|
||||||
// Audit path
|
// Audit path
|
||||||
ButtonWidget* romButton =
|
ButtonWidget* romButton =
|
||||||
new ButtonWidget(this, font, hBorder, ypos, buttonWidth, buttonHeight,
|
new ButtonWidget(this, font, HBORDER, ypos, buttonWidth, buttonHeight,
|
||||||
"Audit path" + ELLIPSIS, kChooseAuditDirCmd);
|
"Audit path" + ELLIPSIS, kChooseAuditDirCmd);
|
||||||
wid.push_back(romButton);
|
wid.push_back(romButton);
|
||||||
xpos = hBorder + buttonWidth + 10;
|
xpos = HBORDER + buttonWidth + 8;
|
||||||
myRomPath = new EditTextWidget(this, font, xpos, ypos + 2,
|
myRomPath = new EditTextWidget(this, font, xpos, ypos + 1,
|
||||||
_w - xpos - hBorder, lineHeight, "");
|
_w - xpos - HBORDER, lineHeight, "");
|
||||||
wid.push_back(myRomPath);
|
wid.push_back(myRomPath);
|
||||||
|
|
||||||
// Show results of ROM audit
|
// Show results of ROM audit
|
||||||
ypos += buttonHeight + 16;
|
ypos += buttonHeight + 16;
|
||||||
new StaticTextWidget(this, font, hBorder, ypos, lwidth, fontHeight,
|
new StaticTextWidget(this, font, HBORDER, ypos, lwidth, fontHeight,
|
||||||
"ROMs with properties (renamed) ", TextAlign::Left);
|
"ROMs with properties (renamed) ", TextAlign::Left);
|
||||||
myResults1 = new EditTextWidget(this, font, hBorder + lwidth, ypos - 2,
|
myResults1 = new EditTextWidget(this, font, HBORDER + lwidth, ypos - 2,
|
||||||
_w - hBorder*2 - lwidth, lineHeight, "");
|
fontWidth * 6, lineHeight, "");
|
||||||
myResults1->setEditable(false, true);
|
myResults1->setEditable(false, true);
|
||||||
ypos += buttonHeight;
|
ypos += buttonHeight;
|
||||||
new StaticTextWidget(this, font, hBorder, ypos, lwidth, fontHeight,
|
new StaticTextWidget(this, font, HBORDER, ypos, lwidth, fontHeight,
|
||||||
"ROMs without properties (skipped) ", TextAlign::Left);
|
"ROMs without properties (skipped) ", TextAlign::Left);
|
||||||
myResults2 = new EditTextWidget(this, font, hBorder + lwidth, ypos - 2,
|
myResults2 = new EditTextWidget(this, font, HBORDER + lwidth, ypos - 2,
|
||||||
_w - hBorder*2 - lwidth, lineHeight, "");
|
fontWidth * 6, lineHeight, "");
|
||||||
myResults2->setEditable(false, true);
|
myResults2->setEditable(false, true);
|
||||||
|
|
||||||
ypos += buttonHeight + 8;
|
ypos += buttonHeight + 8;
|
||||||
new StaticTextWidget(this, font, hBorder, ypos, _w - 20, fontHeight,
|
new StaticTextWidget(this, font, HBORDER, ypos, _w - 20, fontHeight,
|
||||||
"(*) WARNING: operation cannot be undone!",
|
"(*) WARNING: Operation cannot be undone!",
|
||||||
TextAlign::Left);
|
TextAlign::Left);
|
||||||
|
|
||||||
// Add OK and Cancel buttons
|
// Add OK and Cancel buttons
|
||||||
addOKCancelBGroup(wid, font, "Audit", "Done");
|
addOKCancelBGroup(wid, font, "Audit", "Close");
|
||||||
addBGroupToFocusList(wid);
|
addBGroupToFocusList(wid);
|
||||||
|
|
||||||
// Create file browser dialog
|
// Create file browser dialog
|
||||||
|
|
|
@ -31,38 +31,41 @@ SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
: Dialog(osystem, parent),
|
: Dialog(osystem, parent),
|
||||||
myFont(font)
|
myFont(font)
|
||||||
{
|
{
|
||||||
|
const int VBORDER = 10;
|
||||||
|
const int HBORDER = 10;
|
||||||
|
const int INDENT = 20;
|
||||||
|
const int V_GAP = 4;
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
fontWidth = font.getMaxCharWidth(),
|
fontWidth = font.getMaxCharWidth(),
|
||||||
buttonWidth = font.getStringWidth("Save path" + ELLIPSIS) + 20,
|
buttonWidth = font.getStringWidth("Save path" + ELLIPSIS) + 20,
|
||||||
buttonHeight = font.getLineHeight() + 4;
|
buttonHeight = font.getLineHeight() + 4;
|
||||||
const int vBorder = 10;
|
|
||||||
int xpos, ypos, lwidth, fwidth;
|
int xpos, ypos, lwidth, fwidth;
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
ButtonWidget* b;
|
ButtonWidget* b;
|
||||||
|
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
_w = 53 * fontWidth + 8;
|
_w = 64 * fontWidth + HBORDER * 2;
|
||||||
_h = 10 * (lineHeight + 4) + 10;
|
_h = 10 * (lineHeight + 4) + 10;
|
||||||
|
|
||||||
xpos = vBorder; ypos = vBorder;
|
xpos = HBORDER; ypos = VBORDER;
|
||||||
|
|
||||||
// Snapshot path (save files)
|
// Snapshot path (save files)
|
||||||
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
"Save path" + ELLIPSIS, kChooseSnapSaveDirCmd);
|
"Save path" + ELLIPSIS, kChooseSnapSaveDirCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
xpos += buttonWidth + 10;
|
xpos += buttonWidth + 8;
|
||||||
mySnapSavePath = new EditTextWidget(this, font, xpos, ypos + 2,
|
mySnapSavePath = new EditTextWidget(this, font, xpos, ypos + 1,
|
||||||
_w - xpos - 10, lineHeight, "");
|
_w - xpos - HBORDER, lineHeight, "");
|
||||||
wid.push_back(mySnapSavePath);
|
wid.push_back(mySnapSavePath);
|
||||||
|
|
||||||
// Snapshot path (load files)
|
// Snapshot path (load files)
|
||||||
xpos = vBorder; ypos += buttonHeight + 3;
|
xpos = HBORDER; ypos += buttonHeight + V_GAP;
|
||||||
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
"Load path" + ELLIPSIS, kChooseSnapLoadDirCmd);
|
"Load path" + ELLIPSIS, kChooseSnapLoadDirCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
xpos += buttonWidth + 10;
|
xpos += buttonWidth + 8;
|
||||||
mySnapLoadPath = new EditTextWidget(this, font, xpos, ypos + 2,
|
mySnapLoadPath = new EditTextWidget(this, font, xpos, ypos + 1,
|
||||||
_w - xpos - 10, lineHeight, "");
|
_w - xpos - HBORDER, lineHeight, "");
|
||||||
wid.push_back(mySnapLoadPath);
|
wid.push_back(mySnapLoadPath);
|
||||||
|
|
||||||
// Snapshot naming
|
// Snapshot naming
|
||||||
|
@ -71,7 +74,7 @@ SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
VariantList items;
|
VariantList items;
|
||||||
VarList::push_back(items, "actual ROM name", "rom");
|
VarList::push_back(items, "actual ROM name", "rom");
|
||||||
VarList::push_back(items, "internal database", "int");
|
VarList::push_back(items, "internal database", "int");
|
||||||
xpos = vBorder+10; ypos += buttonHeight + 8;
|
xpos = HBORDER; ypos += buttonHeight + V_GAP * 4;
|
||||||
mySnapName =
|
mySnapName =
|
||||||
new PopUpWidget(this, font, xpos, ypos, fwidth, lineHeight, items,
|
new PopUpWidget(this, font, xpos, ypos, fwidth, lineHeight, items,
|
||||||
"Save snapshots according to ", lwidth);
|
"Save snapshots according to ", lwidth);
|
||||||
|
@ -97,18 +100,18 @@ SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
|
|
||||||
// Booleans for saving snapshots
|
// Booleans for saving snapshots
|
||||||
fwidth = font.getStringWidth("When saving snapshots:");
|
fwidth = font.getStringWidth("When saving snapshots:");
|
||||||
xpos = vBorder; ypos += buttonHeight + 5;
|
xpos = HBORDER; ypos += lineHeight + V_GAP * 3;
|
||||||
new StaticTextWidget(this, font, xpos, ypos, fwidth, lineHeight,
|
new StaticTextWidget(this, font, xpos, ypos, fwidth, lineHeight,
|
||||||
"When saving snapshots:", TextAlign::Left);
|
"When saving snapshots:", TextAlign::Left);
|
||||||
|
|
||||||
// Snapshot single or multiple saves
|
// Snapshot single or multiple saves
|
||||||
xpos += 30; ypos += lineHeight + 3;
|
xpos += INDENT; ypos += lineHeight + V_GAP;
|
||||||
mySnapSingle = new CheckboxWidget(this, font, xpos, ypos,
|
mySnapSingle = new CheckboxWidget(this, font, xpos, ypos,
|
||||||
"Overwrite existing files");
|
"Overwrite existing files");
|
||||||
wid.push_back(mySnapSingle);
|
wid.push_back(mySnapSingle);
|
||||||
|
|
||||||
// Snapshot in 1x mode (ignore scaling)
|
// Snapshot in 1x mode (ignore scaling)
|
||||||
ypos += mySnapSingle->getHeight() + 4;
|
ypos += lineHeight + V_GAP;
|
||||||
mySnap1x = new CheckboxWidget(this, font, xpos, ypos,
|
mySnap1x = new CheckboxWidget(this, font, xpos, ypos,
|
||||||
"Ignore scaling (1x mode)");
|
"Ignore scaling (1x mode)");
|
||||||
wid.push_back(mySnap1x);
|
wid.push_back(mySnap1x);
|
||||||
|
|
Loading…
Reference in New Issue