Fiddling with new tab widget
svn-id: r11086
This commit is contained in:
parent
c4d5445b00
commit
a331a298a2
2 changed files with 54 additions and 19 deletions
|
@ -29,6 +29,8 @@
|
||||||
#include "gui/options.h"
|
#include "gui/options.h"
|
||||||
#include "gui/EditTextWidget.h"
|
#include "gui/EditTextWidget.h"
|
||||||
#include "gui/ListWidget.h"
|
#include "gui/ListWidget.h"
|
||||||
|
#include "gui/TabWidget.h"
|
||||||
|
#include "gui/PopUpWidget.h"
|
||||||
|
|
||||||
#include "backends/fs/fs.h"
|
#include "backends/fs/fs.h"
|
||||||
|
|
||||||
|
@ -92,34 +94,65 @@ protected:
|
||||||
EditGameDialog::EditGameDialog(const String &domain, GameSettings target)
|
EditGameDialog::EditGameDialog(const String &domain, GameSettings target)
|
||||||
: Dialog(8, 50, 320 - 2 * 8, 200 - 2 * 40),
|
: Dialog(8, 50, 320 - 2 * 8, 200 - 2 * 40),
|
||||||
_domain(domain) {
|
_domain(domain) {
|
||||||
|
const int vBorder = 5; // Tab border
|
||||||
|
|
||||||
// Determine the description string
|
// GAME: Path to game data (r/o)
|
||||||
|
String path(ConfMan.get("path", _domain));
|
||||||
|
|
||||||
|
// GAME: Determine the description string
|
||||||
String description(ConfMan.get("description", domain));
|
String description(ConfMan.get("description", domain));
|
||||||
if (description.isEmpty() && target.description) {
|
if (description.isEmpty() && target.description) {
|
||||||
description = target.description;
|
description = target.description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GUI: Add tab widget
|
||||||
// Label & edit widget for the game ID
|
TabWidget *tab = new TabWidget(this, 0, vBorder, _w, _h - 24 - 2*vBorder);
|
||||||
new StaticTextWidget(this, 10, 10, 40, kLineHeight, "ID: ", kTextAlignRight);
|
tab->addTab("Game");
|
||||||
_domainWidget =
|
|
||||||
new EditTextWidget(this, 50, 10, _w - 50 - 10, kLineHeight, _domain);
|
|
||||||
|
|
||||||
// Label & edit widget for the description
|
// GUI: Label & edit widget for the game ID
|
||||||
new StaticTextWidget(this, 10, 26, 40, kLineHeight, "Name: ", kTextAlignRight);
|
new StaticTextWidget(tab, 10, 10, 40, kLineHeight, "ID: ", kTextAlignRight);
|
||||||
_descriptionWidget =
|
_domainWidget = new EditTextWidget(tab, 50, 10, _w - 50 - 10, kLineHeight, _domain);
|
||||||
new EditTextWidget(this, 50, 26, _w - 50 - 10, kLineHeight, description);
|
|
||||||
|
|
||||||
// Path to game data (view only)
|
// GUI: Label & edit widget for the description
|
||||||
String path(ConfMan.get("path", _domain));
|
new StaticTextWidget(tab, 10, 26, 40, kLineHeight, "Name: ", kTextAlignRight);
|
||||||
new StaticTextWidget(this, 10, 42, 40, kLineHeight, "Path: ", kTextAlignRight);
|
_descriptionWidget = new EditTextWidget(tab, 50, 26, _w - 50 - 10, kLineHeight, description);
|
||||||
new StaticTextWidget(this, 50, 42, _w - 50 - 10, kLineHeight, path, kTextAlignLeft);
|
|
||||||
|
|
||||||
// Full screen checkbox
|
// GUI: Label for the game path
|
||||||
_fullscreenCheckbox = new CheckboxWidget(this, 15, 62, 200, 16, "Use Fullscreen Mode", 0, 'F');
|
// TODO: Allow editing, and clip to the RIGHT on long paths (to keep meaningful portions)
|
||||||
|
new StaticTextWidget(tab, 10, 42, 40, kLineHeight, "Path: ", kTextAlignRight);
|
||||||
|
new StaticTextWidget(tab, 50, 42, _w - 50 - 10, kLineHeight, path, kTextAlignLeft);
|
||||||
|
|
||||||
|
// TODO: Platform and language dropdowns (?)
|
||||||
|
|
||||||
|
// GUI: Add Graphics tab
|
||||||
|
tab->addTab("Graphics");
|
||||||
|
|
||||||
|
// The GFX mode popup & a label
|
||||||
|
// TODO - add an API to query the list of available GFX modes, and to get/set the mode
|
||||||
|
PopUpWidget *gfxPopUp;
|
||||||
|
gfxPopUp = new PopUpWidget(tab, 5, vBorder, 280, kLineHeight, "Graphics mode: ", 100);
|
||||||
|
gfxPopUp->appendEntry("<global default>");
|
||||||
|
gfxPopUp->appendEntry("");
|
||||||
|
gfxPopUp->appendEntry("Normal (no scaling)");
|
||||||
|
gfxPopUp->appendEntry("2x");
|
||||||
|
gfxPopUp->appendEntry("3x");
|
||||||
|
gfxPopUp->appendEntry("2xSAI");
|
||||||
|
gfxPopUp->appendEntry("Super2xSAI");
|
||||||
|
gfxPopUp->appendEntry("SuperEagle");
|
||||||
|
gfxPopUp->appendEntry("AdvMAME2x");
|
||||||
|
gfxPopUp->appendEntry("TV2x");
|
||||||
|
gfxPopUp->appendEntry("DotMatrix");
|
||||||
|
gfxPopUp->setSelected(0);
|
||||||
|
|
||||||
|
// FIXME - disable GFX popup for now
|
||||||
|
gfxPopUp->setEnabled(false);
|
||||||
|
|
||||||
|
// GUI: Full screen checkbox
|
||||||
|
_fullscreenCheckbox = new CheckboxWidget(tab, 15, 62, 200, 16, "Use Fullscreen Mode", 0, 'F');
|
||||||
_fullscreenCheckbox->setState(ConfMan.getBool("fullscreen", _domain));
|
_fullscreenCheckbox->setState(ConfMan.getBool("fullscreen", _domain));
|
||||||
|
|
||||||
// Add OK & Cancel buttons
|
|
||||||
|
// GUI: Add OK & Cancel buttons
|
||||||
addButton(_w - 2 * (kButtonWidth + 10), _h - 24, "Cancel", kCloseCmd, 0);
|
addButton(_w - 2 * (kButtonWidth + 10), _h - 24, "Cancel", kCloseCmd, 0);
|
||||||
addButton(_w - (kButtonWidth + 10), _h - 24, "OK", kOKCmd, 0);
|
addButton(_w - (kButtonWidth + 10), _h - 24, "OK", kOKCmd, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,11 +55,11 @@ This just looks like an option dialog, but it doesn't change any actual settings
|
||||||
// - aspect ratio, language, platform, subtitles, debug mode/level, cd drive, joystick, multi midi, native mt32
|
// - aspect ratio, language, platform, subtitles, debug mode/level, cd drive, joystick, multi midi, native mt32
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kMasterVolumeChanged = 'mavc',
|
kMasterVolumeChanged = 'mavc',
|
||||||
kMusicVolumeChanged = 'muvc',
|
kMusicVolumeChanged = 'muvc',
|
||||||
kSfxVolumeChanged = 'sfvc',
|
kSfxVolumeChanged = 'sfvc',
|
||||||
kChooseSaveDirCmd = 'chos',
|
kChooseSaveDirCmd = 'chos',
|
||||||
kOKCmd = 'ok '
|
kOKCmd = 'ok '
|
||||||
};
|
};
|
||||||
|
|
||||||
GlobalOptionsDialog::GlobalOptionsDialog(GameDetector &detector)
|
GlobalOptionsDialog::GlobalOptionsDialog(GameDetector &detector)
|
||||||
|
@ -80,6 +80,8 @@ GlobalOptionsDialog::GlobalOptionsDialog(GameDetector &detector)
|
||||||
//new StaticTextWidget(tab, 5, vBorder+2, 100, kLineHeight, "Graphics mode: ", kTextAlignRight);
|
//new StaticTextWidget(tab, 5, vBorder+2, 100, kLineHeight, "Graphics mode: ", kTextAlignRight);
|
||||||
PopUpWidget *gfxPopUp;
|
PopUpWidget *gfxPopUp;
|
||||||
gfxPopUp = new PopUpWidget(tab, 5, vBorder, 280, kLineHeight, "Graphics mode: ", 100);
|
gfxPopUp = new PopUpWidget(tab, 5, vBorder, 280, kLineHeight, "Graphics mode: ", 100);
|
||||||
|
|
||||||
|
// Ender: We don't really want a <default> here at all, we want to setSelected to the current global
|
||||||
gfxPopUp->appendEntry("<default>");
|
gfxPopUp->appendEntry("<default>");
|
||||||
gfxPopUp->appendEntry("");
|
gfxPopUp->appendEntry("");
|
||||||
gfxPopUp->appendEntry("Normal (no scaling)");
|
gfxPopUp->appendEntry("Normal (no scaling)");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue