mirror of https://github.com/stella-emu/stella.git
Reworked fonts a little. Added small/medium/large fonts as choices for
launcherfont. Also added a small font for use in 'small' systems (currently defined as systems where max resolution is 320x240). If such as system is detected, Stella will automatically switch to the small font for in-game UI and launcher. Of course, the debugger will still be larger size, but in that case, it's impossible to resize it anyway. Still TODO is make sure the TIA actually uses only 1x zoom mode (in fact, I may add a commandline option to force this, which is very useful for testing emulation of 'small' systems on a normal-sized display. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1597 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
e6e5dd1caf
commit
94ad760481
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: CheatCodeDialog.cxx,v 1.24 2009-01-04 02:28:12 stephena Exp $
|
// $Id: CheatCodeDialog.cxx,v 1.25 2009-01-04 22:27:43 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -37,21 +37,26 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
CheatCodeDialog::CheatCodeDialog(OSystem* osystem, DialogContainer* parent,
|
CheatCodeDialog::CheatCodeDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
const GUI::Font& font, int x, int y, int w, int h)
|
const GUI::Font& font)
|
||||||
: Dialog(osystem, parent, x, y, w, h)
|
: Dialog(osystem, parent, 0, 0, 0, 0)
|
||||||
{
|
{
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
|
fontWidth = font.getMaxCharWidth(),
|
||||||
buttonWidth = font.getStringWidth("Defaults") + 20,
|
buttonWidth = font.getStringWidth("Defaults") + 20,
|
||||||
buttonHeight = font.getLineHeight() + 4;
|
buttonHeight = font.getLineHeight() + 4;
|
||||||
int xpos, ypos;
|
int xpos, ypos;
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
ButtonWidget* b;
|
ButtonWidget* b;
|
||||||
|
|
||||||
|
// Set real dimensions
|
||||||
|
_w = 46 * fontWidth + 10;
|
||||||
|
_h = 11 * (lineHeight + 4) + 10;
|
||||||
|
|
||||||
// List of cheats, with checkboxes to enable/disable
|
// List of cheats, with checkboxes to enable/disable
|
||||||
xpos = 10; ypos = 10;
|
xpos = 10; ypos = 10;
|
||||||
myCheatList =
|
myCheatList =
|
||||||
new CheckListWidget(this, font, xpos, ypos, _w - buttonWidth - 25,
|
new CheckListWidget(this, font, xpos, ypos, _w - buttonWidth - 25,
|
||||||
_h - 3*lineHeight);
|
_h - 2*buttonHeight - 10);
|
||||||
myCheatList->setStyle(kXFill);
|
myCheatList->setStyle(kXFill);
|
||||||
myCheatList->setEditable(false);
|
myCheatList->setEditable(false);
|
||||||
wid.push_back(myCheatList);
|
wid.push_back(myCheatList);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: CheatCodeDialog.hxx,v 1.11 2009-01-01 18:13:34 stephena Exp $
|
// $Id: CheatCodeDialog.hxx,v 1.12 2009-01-04 22:27:43 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -42,7 +42,7 @@ class CheatCodeDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CheatCodeDialog(OSystem* osystem, DialogContainer* parent,
|
CheatCodeDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
const GUI::Font& font, int x, int y, int w, int h);
|
const GUI::Font& font);
|
||||||
~CheatCodeDialog();
|
~CheatCodeDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: OSystem.cxx,v 1.141 2009-01-03 22:57:12 stephena Exp $
|
// $Id: OSystem.cxx,v 1.142 2009-01-04 22:27:43 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
@ -53,6 +53,7 @@
|
||||||
#include "Launcher.hxx"
|
#include "Launcher.hxx"
|
||||||
#include "Font.hxx"
|
#include "Font.hxx"
|
||||||
#include "StellaFont.hxx"
|
#include "StellaFont.hxx"
|
||||||
|
#include "StellaMediumFont.hxx"
|
||||||
#include "StellaLargeFont.hxx"
|
#include "StellaLargeFont.hxx"
|
||||||
#include "ConsoleFont.hxx"
|
#include "ConsoleFont.hxx"
|
||||||
#include "Widget.hxx"
|
#include "Widget.hxx"
|
||||||
|
@ -179,17 +180,44 @@ bool OSystem::create()
|
||||||
// it may be needed to initialize the size of graphical objects
|
// it may be needed to initialize the size of graphical objects
|
||||||
queryVideoHardware();
|
queryVideoHardware();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
// Create fonts to draw text
|
// Create fonts to draw text
|
||||||
// TODO - this should be configurable, and also depend on the minimum
|
// NOTE: the logic determining appropriate font sizes is done here,
|
||||||
// size of the launcher and maximum size of the TIA window
|
// so that the UI classes can just use the font they expect,
|
||||||
// The logic must be taken care of here, so the GUI classes
|
// and not worry about it
|
||||||
// can just create the interface and not worry about checking
|
// This logic should also take into account the size of the
|
||||||
myFont = new GUI::Font(GUI::stellaDesc);
|
// framebuffer, and try to be intelligent about font sizes
|
||||||
|
// We can probably add ifdefs to take care of corner cases,
|
||||||
|
// but the means we've failed to abstract it enough ...
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
bool smallScreen = myDesktopWidth <= 320 || myDesktopHeight <= 240;
|
||||||
|
|
||||||
|
// This font is used in a variety of situations when a really small
|
||||||
|
// font is needed; we let the specific widget/dialog decide when to
|
||||||
|
// use it
|
||||||
|
mySmallFont = new GUI::Font(GUI::stellaDesc);
|
||||||
|
|
||||||
|
// The console font is always the same size (for now at least)
|
||||||
myConsoleFont = new GUI::Font(GUI::consoleDesc);
|
myConsoleFont = new GUI::Font(GUI::consoleDesc);
|
||||||
|
|
||||||
|
// The general font used in all UI elements
|
||||||
|
// This is determined by the size of the framebuffer
|
||||||
|
myFont = new GUI::Font(smallScreen ? GUI::stellaDesc : GUI::stellaMediumDesc);
|
||||||
|
|
||||||
|
// The font used by the ROM launcher
|
||||||
|
// Normally, this is configurable by the user, except in the case of
|
||||||
|
// very small screens
|
||||||
|
if(!smallScreen)
|
||||||
|
{
|
||||||
if(mySettings->getString("launcherfont") == "small")
|
if(mySettings->getString("launcherfont") == "small")
|
||||||
myLauncherFont = new GUI::Font(GUI::stellaDesc);
|
myLauncherFont = new GUI::Font(GUI::consoleDesc);
|
||||||
|
else if(mySettings->getString("launcherfont") == "medium")
|
||||||
|
myLauncherFont = new GUI::Font(GUI::stellaMediumDesc);
|
||||||
else
|
else
|
||||||
myLauncherFont = new GUI::Font(GUI::stellaLargeDesc);
|
myLauncherFont = new GUI::Font(GUI::stellaLargeDesc);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
myLauncherFont = new GUI::Font(GUI::stellaDesc);
|
||||||
|
|
||||||
// Create the event handler for the system
|
// Create the event handler for the system
|
||||||
myEventHandler = new EventHandler(this);
|
myEventHandler = new EventHandler(this);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: OSystem.hxx,v 1.72 2009-01-03 22:57:12 stephena Exp $
|
// $Id: OSystem.hxx,v 1.73 2009-01-04 22:27:43 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef OSYSTEM_HXX
|
#ifndef OSYSTEM_HXX
|
||||||
|
@ -56,7 +56,7 @@ typedef Common::Array<Resolution> ResolutionList;
|
||||||
other objects belong.
|
other objects belong.
|
||||||
|
|
||||||
@author Stephen Anthony
|
@author Stephen Anthony
|
||||||
@version $Id: OSystem.hxx,v 1.72 2009-01-03 22:57:12 stephena Exp $
|
@version $Id: OSystem.hxx,v 1.73 2009-01-04 22:27:43 stephena Exp $
|
||||||
*/
|
*/
|
||||||
class OSystem
|
class OSystem
|
||||||
{
|
{
|
||||||
|
@ -182,6 +182,13 @@ class OSystem
|
||||||
inline CheatManager& cheat() const { return *myCheatManager; }
|
inline CheatManager& cheat() const { return *myCheatManager; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get the small font object of the system
|
||||||
|
|
||||||
|
@return The font reference
|
||||||
|
*/
|
||||||
|
inline const GUI::Font& smallFont() const { return *mySmallFont; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get the font object of the system
|
Get the font object of the system
|
||||||
|
|
||||||
|
@ -501,6 +508,9 @@ class OSystem
|
||||||
|
|
||||||
string myFeatures;
|
string myFeatures;
|
||||||
|
|
||||||
|
// The font object to use when space is very limited
|
||||||
|
GUI::Font* mySmallFont;
|
||||||
|
|
||||||
// The font object to use for the normal in-game GUI
|
// The font object to use for the normal in-game GUI
|
||||||
GUI::Font* myFont;
|
GUI::Font* myFont;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: Settings.cxx,v 1.153 2009-01-03 22:57:12 stephena Exp $
|
// $Id: Settings.cxx,v 1.154 2009-01-04 22:27:43 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
@ -88,7 +88,7 @@ Settings::Settings(OSystem* osystem)
|
||||||
|
|
||||||
// ROM browser options
|
// ROM browser options
|
||||||
setInternal("launcherres", "640x480");
|
setInternal("launcherres", "640x480");
|
||||||
setInternal("launcherfont", "small");
|
setInternal("launcherfont", "medium");
|
||||||
setInternal("romviewer", "0");
|
setInternal("romviewer", "0");
|
||||||
setInternal("lastrom", "");
|
setInternal("lastrom", "");
|
||||||
|
|
||||||
|
@ -258,8 +258,8 @@ void Settings::validate()
|
||||||
setInternal("palette", "standard");
|
setInternal("palette", "standard");
|
||||||
|
|
||||||
s = getString("launcherfont");
|
s = getString("launcherfont");
|
||||||
if(s != "small" && s != "large")
|
if(s != "small" && s != "medium" && s != "large")
|
||||||
setInternal("launcherfont", "small");
|
setInternal("launcherfont", "medium");
|
||||||
|
|
||||||
i = getInt("romviewer");
|
i = getInt("romviewer");
|
||||||
if(i < 0)
|
if(i < 0)
|
||||||
|
@ -332,7 +332,8 @@ void Settings::usage()
|
||||||
<< " -listrominfo Display contents of stella.pro, one line per ROM entry\n"
|
<< " -listrominfo Display contents of stella.pro, one line per ROM entry\n"
|
||||||
<< " -rominfo <rom> Display detailed information for the given ROM\n"
|
<< " -rominfo <rom> Display detailed information for the given ROM\n"
|
||||||
<< " -launcherres <WxH> The resolution to use in ROM launcher mode\n"
|
<< " -launcherres <WxH> The resolution to use in ROM launcher mode\n"
|
||||||
<< " -launcherfont <small|large> Use small or large font in the ROM launcher\n"
|
<< " -launcherfont <small|medium| Use the specified font in the ROM launcher\n"
|
||||||
|
<< " large>\n"
|
||||||
<< " -uipalette <1|2> Used the specified palette for UI elements\n"
|
<< " -uipalette <1|2> Used the specified palette for UI elements\n"
|
||||||
<< " -mwheel <lines> Number of lines the mouse wheel will scroll in UI\n"
|
<< " -mwheel <lines> Number of lines the mouse wheel will scroll in UI\n"
|
||||||
<< " -statedir <dir> Directory in which to save state files\n"
|
<< " -statedir <dir> Directory in which to save state files\n"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: AboutDialog.cxx,v 1.29 2009-01-03 22:57:12 stephena Exp $
|
// $Id: AboutDialog.cxx,v 1.30 2009-01-04 22:27:43 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -31,18 +31,23 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
AboutDialog::AboutDialog(OSystem* osystem, DialogContainer* parent,
|
AboutDialog::AboutDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
const GUI::Font& font, int x, int y, int w, int h)
|
const GUI::Font& font)
|
||||||
: Dialog(osystem, parent, x, y, w, h),
|
: Dialog(osystem, parent, 0, 0, 0, 0),
|
||||||
myPage(1),
|
myPage(1),
|
||||||
myNumPages(6)
|
myNumPages(6)
|
||||||
{
|
{
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
|
fontWidth = font.getMaxCharWidth(),
|
||||||
fontHeight = font.getFontHeight(),
|
fontHeight = font.getFontHeight(),
|
||||||
buttonWidth = font.getStringWidth("Defaults") + 20,
|
buttonWidth = font.getStringWidth("Defaults") + 20,
|
||||||
buttonHeight = font.getLineHeight() + 4;
|
buttonHeight = font.getLineHeight() + 4;
|
||||||
int xpos, ypos;
|
int xpos, ypos;
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
|
|
||||||
|
// Set real dimensions
|
||||||
|
_w = 52 * fontWidth + 10;
|
||||||
|
_h = 12 * lineHeight + 20;
|
||||||
|
|
||||||
// Add Previous, Next and Close buttons
|
// Add Previous, Next and Close buttons
|
||||||
xpos = 10; ypos = _h - buttonHeight - 10;
|
xpos = 10; ypos = _h - buttonHeight - 10;
|
||||||
myPrevButton =
|
myPrevButton =
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: AboutDialog.hxx,v 1.9 2009-01-01 18:13:38 stephena Exp $
|
// $Id: AboutDialog.hxx,v 1.10 2009-01-04 22:27:43 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -35,7 +35,7 @@ class AboutDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AboutDialog(OSystem* osystem, DialogContainer* parent,
|
AboutDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
const GUI::Font& font, int x, int y, int w, int h);
|
const GUI::Font& font);
|
||||||
~AboutDialog();
|
~AboutDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: AudioDialog.cxx,v 1.30 2009-01-01 18:13:38 stephena Exp $
|
// $Id: AudioDialog.cxx,v 1.31 2009-01-04 22:27:43 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -38,8 +38,8 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
AudioDialog::AudioDialog(OSystem* osystem, DialogContainer* parent,
|
AudioDialog::AudioDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
const GUI::Font& font, int x, int y, int w, int h)
|
const GUI::Font& font)
|
||||||
: Dialog(osystem, parent, x, y, w, h)
|
: Dialog(osystem, parent, 0, 0, 0, 0)
|
||||||
{
|
{
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
fontWidth = font.getMaxCharWidth(),
|
fontWidth = font.getMaxCharWidth(),
|
||||||
|
@ -53,8 +53,8 @@ AudioDialog::AudioDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
StringMap items;
|
StringMap items;
|
||||||
|
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
// _w = 35 * fontWidth + 10;
|
_w = 35 * fontWidth + 10;
|
||||||
// _h = 8 * (lineHeight + 4) + 10;
|
_h = 8 * (lineHeight + 4) + 10;
|
||||||
|
|
||||||
// Volume
|
// Volume
|
||||||
xpos = 3 * fontWidth; ypos = 10;
|
xpos = 3 * fontWidth; ypos = 10;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: AudioDialog.hxx,v 1.13 2009-01-01 18:13:38 stephena Exp $
|
// $Id: AudioDialog.hxx,v 1.14 2009-01-04 22:27:43 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -36,8 +36,7 @@ class CheckboxWidget;
|
||||||
class AudioDialog : public Dialog
|
class AudioDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AudioDialog(OSystem* osystem, DialogContainer* parent,
|
AudioDialog(OSystem* osystem, DialogContainer* parent, const GUI::Font& font);
|
||||||
const GUI::Font& font, int x, int y, int w, int h);
|
|
||||||
~AudioDialog();
|
~AudioDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: BrowserDialog.cxx,v 1.34 2009-01-02 01:50:03 stephena Exp $
|
// $Id: BrowserDialog.cxx,v 1.35 2009-01-04 22:27:43 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -22,6 +22,7 @@
|
||||||
#include "bspf.hxx"
|
#include "bspf.hxx"
|
||||||
|
|
||||||
#include "Dialog.hxx"
|
#include "Dialog.hxx"
|
||||||
|
#include "DialogContainer.hxx"
|
||||||
#include "FSNode.hxx"
|
#include "FSNode.hxx"
|
||||||
#include "GameList.hxx"
|
#include "GameList.hxx"
|
||||||
#include "GuiObject.hxx"
|
#include "GuiObject.hxx"
|
||||||
|
@ -38,9 +39,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
BrowserDialog::BrowserDialog(GuiObject* boss, const GUI::Font& font,
|
BrowserDialog::BrowserDialog(GuiObject* boss, const GUI::Font& font)
|
||||||
int x, int y, int w, int h)
|
: Dialog(&boss->instance(), &boss->parent(), 0, 0, 0, 0),
|
||||||
: Dialog(&boss->instance(), &boss->parent(), x, y, w, h),
|
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
_fileList(NULL),
|
_fileList(NULL),
|
||||||
_currentPath(NULL),
|
_currentPath(NULL),
|
||||||
|
@ -55,8 +55,8 @@ BrowserDialog::BrowserDialog(GuiObject* boss, const GUI::Font& font,
|
||||||
|
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
// This is one dialog that can take as much space as is available
|
// This is one dialog that can take as much space as is available
|
||||||
// _w = _DLG_MIN_SWIDTH - 30;
|
_w = BSPF_min(instance().desktopWidth(), 480u);
|
||||||
// _h = _DLG_MIN_SHEIGHT - 30;
|
_h = BSPF_min(instance().desktopHeight(), 380u);
|
||||||
|
|
||||||
xpos = 10; ypos = 4;
|
xpos = 10; ypos = 4;
|
||||||
_title = new StaticTextWidget(this, font, xpos, ypos,
|
_title = new StaticTextWidget(this, font, xpos, ypos,
|
||||||
|
@ -114,9 +114,23 @@ BrowserDialog::~BrowserDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void BrowserDialog::setStartPath(const string& startpath,
|
void BrowserDialog::show(const string& title, const string& startpath,
|
||||||
FilesystemNode::ListMode mode)
|
FilesystemNode::ListMode mode, int cmd)
|
||||||
{
|
{
|
||||||
|
// TODO - dialog has to be added before any settings are changed,
|
||||||
|
// since (for example) changing the title triggers a redraw,
|
||||||
|
// and the dialog must be added (so it exists) for that to happen
|
||||||
|
// Fixing this requires changes to the underlying widget classes
|
||||||
|
// (ie, changing a widgets contents should signal its dialog that a
|
||||||
|
// redraw is necessary; it shouldn't be responsible for redraw itself)
|
||||||
|
//
|
||||||
|
// Doing it this way has the unfortunate side effect that a previous
|
||||||
|
// title is temporarily visible when re-using the browser for different
|
||||||
|
// purposes
|
||||||
|
parent().addDialog(this);
|
||||||
|
|
||||||
|
_title->setLabel(title);
|
||||||
|
_cmd = cmd;
|
||||||
_mode = mode;
|
_mode = mode;
|
||||||
|
|
||||||
// If no node has been set, or the last used one is now invalid,
|
// If no node has been set, or the last used one is now invalid,
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: BrowserDialog.hxx,v 1.14 2009-01-01 18:13:38 stephena Exp $
|
// $Id: BrowserDialog.hxx,v 1.15 2009-01-04 22:27:43 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -36,16 +36,14 @@ class GameList;
|
||||||
class BrowserDialog : public Dialog, public CommandSender
|
class BrowserDialog : public Dialog, public CommandSender
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BrowserDialog(GuiObject* boss, const GUI::Font& font,
|
BrowserDialog(GuiObject* boss, const GUI::Font& font);
|
||||||
int x, int y, int w, int h);
|
|
||||||
|
|
||||||
virtual ~BrowserDialog();
|
virtual ~BrowserDialog();
|
||||||
|
|
||||||
const FilesystemNode& getResult() { return _node; }
|
const FilesystemNode& getResult() { return _node; }
|
||||||
|
|
||||||
void setTitle(const string& title) { _title->setLabel(title); }
|
/** Place the browser window onscreen, using the given attributes */
|
||||||
void setEmitSignal(int cmd) { _cmd = cmd; }
|
void show(const string& title, const string& startpath,
|
||||||
void setStartPath(const string& startpath, FilesystemNode::ListMode mode);
|
FilesystemNode::ListMode mode, int cmd);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: FileSnapDialog.cxx,v 1.24 2009-01-03 22:57:12 stephena Exp $
|
// $Id: FileSnapDialog.cxx,v 1.25 2009-01-04 22:27:43 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -22,7 +22,6 @@
|
||||||
#include "bspf.hxx"
|
#include "bspf.hxx"
|
||||||
|
|
||||||
#include "BrowserDialog.hxx"
|
#include "BrowserDialog.hxx"
|
||||||
#include "DialogContainer.hxx"
|
|
||||||
#include "EditTextWidget.hxx"
|
#include "EditTextWidget.hxx"
|
||||||
#include "FSNode.hxx"
|
#include "FSNode.hxx"
|
||||||
#include "LauncherDialog.hxx"
|
#include "LauncherDialog.hxx"
|
||||||
|
@ -33,14 +32,14 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
FileSnapDialog::FileSnapDialog(
|
FileSnapDialog::FileSnapDialog(
|
||||||
OSystem* osystem, DialogContainer* parent,
|
OSystem* osystem, DialogContainer* parent,
|
||||||
const GUI::Font& font, GuiObject* boss,
|
const GUI::Font& font, GuiObject* boss)
|
||||||
int x, int y, int w, int h)
|
: Dialog(osystem, parent, 0, 0, 0, 0),
|
||||||
: Dialog(osystem, parent, x, y, w, h),
|
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
myBrowser(NULL),
|
myBrowser(NULL),
|
||||||
myIsGlobal(boss != 0)
|
myIsGlobal(boss != 0)
|
||||||
{
|
{
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
|
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 vBorder = 8;
|
||||||
|
@ -49,8 +48,8 @@ FileSnapDialog::FileSnapDialog(
|
||||||
ButtonWidget* b;
|
ButtonWidget* b;
|
||||||
|
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
// _w = 50 * fontWidth + 10;
|
_w = 52 * fontWidth + 10;
|
||||||
// _h = 11 * (lineHeight + 4) + 10;
|
_h = 10 * (lineHeight + 4) + 10;
|
||||||
|
|
||||||
xpos = vBorder; ypos = vBorder;
|
xpos = vBorder; ypos = vBorder;
|
||||||
|
|
||||||
|
@ -143,7 +142,7 @@ FileSnapDialog::FileSnapDialog(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create file browser dialog
|
// Create file browser dialog
|
||||||
myBrowser = new BrowserDialog(this, font, 0, 0, 400, 320);
|
myBrowser = new BrowserDialog(this, font);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -204,17 +203,6 @@ void FileSnapDialog::setDefaults()
|
||||||
mySnap1x->setState(false);
|
mySnap1x->setState(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
void FileSnapDialog::openBrowser(const string& title, const string& startpath,
|
|
||||||
FilesystemNode::ListMode mode, int cmd)
|
|
||||||
{
|
|
||||||
parent().addDialog(myBrowser);
|
|
||||||
|
|
||||||
myBrowser->setTitle(title);
|
|
||||||
myBrowser->setEmitSignal(cmd);
|
|
||||||
myBrowser->setStartPath(startpath, mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void FileSnapDialog::handleCommand(CommandSender* sender, int cmd,
|
void FileSnapDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
int data, int id)
|
int data, int id)
|
||||||
|
@ -233,32 +221,32 @@ void FileSnapDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kChooseRomDirCmd:
|
case kChooseRomDirCmd:
|
||||||
openBrowser("Select ROM directory:", myRomPath->getEditString(),
|
myBrowser->show("Select ROM directory:", myRomPath->getEditString(),
|
||||||
FilesystemNode::kListDirectoriesOnly, kRomDirChosenCmd);
|
FilesystemNode::kListDirectoriesOnly, kRomDirChosenCmd);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kChooseStateDirCmd:
|
case kChooseStateDirCmd:
|
||||||
openBrowser("Select state directory:", myStatePath->getEditString(),
|
myBrowser->show("Select state directory:", myStatePath->getEditString(),
|
||||||
FilesystemNode::kListDirectoriesOnly, kStateDirChosenCmd);
|
FilesystemNode::kListDirectoriesOnly, kStateDirChosenCmd);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kChooseCheatFileCmd:
|
case kChooseCheatFileCmd:
|
||||||
openBrowser("Select cheat file:", myCheatFile->getEditString(),
|
myBrowser->show("Select cheat file:", myCheatFile->getEditString(),
|
||||||
FilesystemNode::kListAll, kCheatFileChosenCmd);
|
FilesystemNode::kListAll, kCheatFileChosenCmd);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kChoosePaletteFileCmd:
|
case kChoosePaletteFileCmd:
|
||||||
openBrowser("Select palette file:", myPaletteFile->getEditString(),
|
myBrowser->show("Select palette file:", myPaletteFile->getEditString(),
|
||||||
FilesystemNode::kListAll, kPaletteFileChosenCmd);
|
FilesystemNode::kListAll, kPaletteFileChosenCmd);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kChoosePropsFileCmd:
|
case kChoosePropsFileCmd:
|
||||||
openBrowser("Select properties file:", myPropsFile->getEditString(),
|
myBrowser->show("Select properties file:", myPropsFile->getEditString(),
|
||||||
FilesystemNode::kListAll, kPropsFileChosenCmd);
|
FilesystemNode::kListAll, kPropsFileChosenCmd);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kChooseSnapDirCmd:
|
case kChooseSnapDirCmd:
|
||||||
openBrowser("Select snapshot directory:", mySnapPath->getEditString(),
|
myBrowser->show("Select snapshot directory:", mySnapPath->getEditString(),
|
||||||
FilesystemNode::kListDirectoriesOnly, kSnapDirChosenCmd);
|
FilesystemNode::kListDirectoriesOnly, kSnapDirChosenCmd);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: FileSnapDialog.hxx,v 1.12 2009-01-03 22:57:12 stephena Exp $
|
// $Id: FileSnapDialog.hxx,v 1.13 2009-01-04 22:27:43 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -38,8 +38,7 @@ class FileSnapDialog : public Dialog, public CommandSender
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FileSnapDialog(OSystem* osystem, DialogContainer* parent,
|
FileSnapDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
const GUI::Font& font, GuiObject* boss,
|
const GUI::Font& font, GuiObject* boss);
|
||||||
int x, int y, int w, int h);
|
|
||||||
~FileSnapDialog();
|
~FileSnapDialog();
|
||||||
|
|
||||||
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
@ -49,9 +48,6 @@ class FileSnapDialog : public Dialog, public CommandSender
|
||||||
void saveConfig();
|
void saveConfig();
|
||||||
void setDefaults();
|
void setDefaults();
|
||||||
|
|
||||||
void openBrowser(const string& title, const string& startpath,
|
|
||||||
FilesystemNode::ListMode mode, int cmd);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum {
|
enum {
|
||||||
kChooseRomDirCmd = 'LOrm', // rom select
|
kChooseRomDirCmd = 'LOrm', // rom select
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: GameInfoDialog.cxx,v 1.62 2009-01-02 01:50:03 stephena Exp $
|
// $Id: GameInfoDialog.cxx,v 1.63 2009-01-04 22:27:44 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -36,8 +36,8 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
GameInfoDialog::GameInfoDialog(
|
GameInfoDialog::GameInfoDialog(
|
||||||
OSystem* osystem, DialogContainer* parent, const GUI::Font& font,
|
OSystem* osystem, DialogContainer* parent, const GUI::Font& font,
|
||||||
GuiObject* boss, int x, int y, int w, int h)
|
GuiObject* boss)
|
||||||
: Dialog(osystem, parent, x, y, w, h),
|
: Dialog(osystem, parent, 0, 0, 0, 0),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
myPropertiesLoaded(false),
|
myPropertiesLoaded(false),
|
||||||
myDefaultsSelected(false)
|
myDefaultsSelected(false)
|
||||||
|
@ -52,6 +52,10 @@ GameInfoDialog::GameInfoDialog(
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
StringMap items, ports, ctrls;
|
StringMap items, ports, ctrls;
|
||||||
|
|
||||||
|
// Set real dimensions
|
||||||
|
_w = 54 * fontWidth + 10;
|
||||||
|
_h = 12 * (lineHeight + 4) + 10;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Some of the following items are also present in GlobalPropsDialog
|
// Some of the following items are also present in GlobalPropsDialog
|
||||||
// If any changes are ever made here, GlobalPropsDialog should also
|
// If any changes are ever made here, GlobalPropsDialog should also
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: GameInfoDialog.hxx,v 1.36 2009-01-02 01:50:03 stephena Exp $
|
// $Id: GameInfoDialog.hxx,v 1.37 2009-01-04 22:27:44 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -40,8 +40,7 @@ class GameInfoDialog : public Dialog, public CommandSender
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GameInfoDialog(OSystem* osystem, DialogContainer* parent,
|
GameInfoDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
const GUI::Font& font, GuiObject* boss,
|
const GUI::Font& font, GuiObject* boss);
|
||||||
int x, int y, int w, int h);
|
|
||||||
virtual ~GameInfoDialog();
|
virtual ~GameInfoDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: GlobalPropsDialog.cxx,v 1.1 2009-01-02 01:50:03 stephena Exp $
|
// $Id: GlobalPropsDialog.cxx,v 1.2 2009-01-04 22:27:44 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -33,12 +33,12 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
GlobalPropsDialog::
|
GlobalPropsDialog::
|
||||||
GlobalPropsDialog(GuiObject* boss, const GUI::Font& font, Settings& settings,
|
GlobalPropsDialog(GuiObject* boss, const GUI::Font& font, Settings& settings)
|
||||||
int x, int y, int w, int h)
|
: Dialog(&boss->instance(), &boss->parent(), 0, 0, 0, 0),
|
||||||
: Dialog(&boss->instance(), &boss->parent(), x, y, w, h),
|
|
||||||
mySettings(settings)
|
mySettings(settings)
|
||||||
{
|
{
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
|
fontWidth = font.getMaxCharWidth(),
|
||||||
fontHeight = font.getFontHeight(),
|
fontHeight = font.getFontHeight(),
|
||||||
buttonWidth = font.getStringWidth("Defaults") + 20,
|
buttonWidth = font.getStringWidth("Defaults") + 20,
|
||||||
buttonHeight = font.getLineHeight() + 4;
|
buttonHeight = font.getLineHeight() + 4;
|
||||||
|
@ -48,6 +48,10 @@ GlobalPropsDialog::
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
StringMap items;
|
StringMap items;
|
||||||
|
|
||||||
|
// Set real dimensions
|
||||||
|
_w = lwidth + pwidth + fontWidth*3 + 15;
|
||||||
|
_h = 10 * (lineHeight + 4) + buttonHeight + 10;
|
||||||
|
|
||||||
xpos = 10; ypos = 10;
|
xpos = 10; ypos = 10;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: GlobalPropsDialog.hxx,v 1.1 2009-01-02 01:50:03 stephena Exp $
|
// $Id: GlobalPropsDialog.hxx,v 1.2 2009-01-04 22:27:44 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -35,9 +35,8 @@ class PopUpWidget;
|
||||||
class GlobalPropsDialog : public Dialog
|
class GlobalPropsDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GlobalPropsDialog(GuiObject* boss, const GUI::Font& font, Settings& settings,
|
GlobalPropsDialog(GuiObject* boss, const GUI::Font& font, Settings& settings);
|
||||||
int x, int y, int w, int h);
|
virtual ~GlobalPropsDialog();
|
||||||
~GlobalPropsDialog();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void loadConfig();
|
void loadConfig();
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: HelpDialog.cxx,v 1.27 2009-01-01 18:13:38 stephena Exp $
|
// $Id: HelpDialog.cxx,v 1.28 2009-01-04 22:27:44 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -29,8 +29,8 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
HelpDialog::HelpDialog(OSystem* osystem, DialogContainer* parent,
|
HelpDialog::HelpDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
const GUI::Font& font, int x, int y, int w, int h)
|
const GUI::Font& font)
|
||||||
: Dialog(osystem, parent, x, y, w, h),
|
: Dialog(osystem, parent, 0, 0, 0, 0),
|
||||||
myPage(1),
|
myPage(1),
|
||||||
myNumPages(4)
|
myNumPages(4)
|
||||||
{
|
{
|
||||||
|
@ -42,6 +42,10 @@ HelpDialog::HelpDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
int xpos, ypos;
|
int xpos, ypos;
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
|
|
||||||
|
// Set real dimensions
|
||||||
|
_w = 46 * fontWidth + 10;
|
||||||
|
_h = 12 * lineHeight + 20;
|
||||||
|
|
||||||
// Add Previous, Next and Close buttons
|
// Add Previous, Next and Close buttons
|
||||||
xpos = 10; ypos = _h - buttonHeight - 10;
|
xpos = 10; ypos = _h - buttonHeight - 10;
|
||||||
myPrevButton =
|
myPrevButton =
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: HelpDialog.hxx,v 1.11 2009-01-01 18:13:38 stephena Exp $
|
// $Id: HelpDialog.hxx,v 1.12 2009-01-04 22:27:44 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -40,8 +40,7 @@ class StaticTextWidget;
|
||||||
class HelpDialog : public Dialog
|
class HelpDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HelpDialog(OSystem* osystem, DialogContainer* parent,
|
HelpDialog(OSystem* osystem, DialogContainer* parent, const GUI::Font& font);
|
||||||
const GUI::Font& font, int x, int y, int w, int h);
|
|
||||||
~HelpDialog();
|
~HelpDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: InputDialog.cxx,v 1.35 2009-01-01 18:13:38 stephena Exp $
|
// $Id: InputDialog.cxx,v 1.36 2009-01-04 22:27:44 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include "bspf.hxx"
|
#include "bspf.hxx"
|
||||||
|
@ -35,17 +35,19 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
InputDialog::InputDialog(OSystem* osystem, DialogContainer* parent,
|
InputDialog::InputDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
const GUI::Font& font, int x, int y, int w, int h)
|
const GUI::Font& font)
|
||||||
: Dialog(osystem, parent, x, y, w, h)
|
: Dialog(osystem, parent, 0, 0, 0, 0)
|
||||||
{
|
{
|
||||||
const int buttonHeight = font.getLineHeight() + 4;
|
const int lineHeight = font.getLineHeight(),
|
||||||
|
fontWidth = font.getMaxCharWidth(),
|
||||||
|
buttonHeight = font.getLineHeight() + 4;
|
||||||
const int vBorder = 4;
|
const int vBorder = 4;
|
||||||
int xpos, ypos, tabID;
|
int xpos, ypos, tabID;
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
|
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
// _w = 42 * fontWidth + 10;
|
_w = 42 * fontWidth + 10;
|
||||||
// _h = 12 * (lineHeight + 4) + 10;
|
_h = 12 * (lineHeight + 4) + 10;
|
||||||
|
|
||||||
// The tab widget
|
// The tab widget
|
||||||
xpos = 2; ypos = vBorder;
|
xpos = 2; ypos = vBorder;
|
||||||
|
@ -123,7 +125,7 @@ void InputDialog::addVDeviceTab(const GUI::Font& font)
|
||||||
wid.push_back(myRightPort);
|
wid.push_back(myRightPort);
|
||||||
|
|
||||||
lwidth = font.getStringWidth("Paddle threshold: ");
|
lwidth = font.getStringWidth("Paddle threshold: ");
|
||||||
pwidth = font.getMaxCharWidth() * 5;
|
pwidth = font.getMaxCharWidth() * 8;
|
||||||
|
|
||||||
// Add joystick deadzone setting
|
// Add joystick deadzone setting
|
||||||
ypos += 2*lineHeight;
|
ypos += 2*lineHeight;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: InputDialog.hxx,v 1.19 2009-01-01 18:13:38 stephena Exp $
|
// $Id: InputDialog.hxx,v 1.20 2009-01-04 22:27:44 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef INPUT_DIALOG_HXX
|
#ifndef INPUT_DIALOG_HXX
|
||||||
|
@ -36,7 +36,7 @@ class InputDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InputDialog(OSystem* osystem, DialogContainer* parent,
|
InputDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
const GUI::Font& font, int x, int y, int w, int h);
|
const GUI::Font& font);
|
||||||
~InputDialog();
|
~InputDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: LauncherDialog.cxx,v 1.96 2009-01-04 02:28:12 stephena Exp $
|
// $Id: LauncherDialog.cxx,v 1.97 2009-01-04 22:27:44 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -100,8 +100,9 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
if(romWidth > 0)
|
if(romWidth > 0)
|
||||||
{
|
{
|
||||||
xpos += myList->getWidth() + 5;
|
xpos += myList->getWidth() + 5;
|
||||||
myRomInfoWidget = new RomInfoWidget(this, instance().consoleFont(), xpos, ypos,
|
myRomInfoWidget =
|
||||||
romWidth, myList->getHeight());
|
new RomInfoWidget(this, romWidth < 660 ? instance().smallFont() : instance().consoleFont(),
|
||||||
|
xpos, ypos, romWidth, myList->getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add note textwidget to show any notes for the currently selected ROM
|
// Add note textwidget to show any notes for the currently selected ROM
|
||||||
|
@ -168,13 +169,12 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
l.push_back("Override properties", "override");
|
l.push_back("Override properties", "override");
|
||||||
l.push_back("Filter listing", "filter");
|
l.push_back("Filter listing", "filter");
|
||||||
l.push_back("Reload listing", "reload");
|
l.push_back("Reload listing", "reload");
|
||||||
myMenu = new ContextMenu(this, font, l);
|
myMenu = new ContextMenu(this, osystem->font(), l);
|
||||||
|
|
||||||
// Create global props dialog, which is uses to to temporarily overrride
|
// Create global props dialog, which is uses to to temporarily overrride
|
||||||
// ROM properties
|
// ROM properties
|
||||||
myGlobalProps =
|
myGlobalProps =
|
||||||
new GlobalPropsDialog(this, osystem->font(), osystem->settings(),
|
new GlobalPropsDialog(this, osystem->font(), osystem->settings());
|
||||||
0, 0, 440, 270);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: OptionsDialog.cxx,v 1.76 2009-01-01 18:13:38 stephena Exp $
|
// $Id: OptionsDialog.cxx,v 1.77 2009-01-04 22:27:44 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -115,16 +115,11 @@ OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
addCancelWidget(b);
|
addCancelWidget(b);
|
||||||
|
|
||||||
// Set some sane values for the dialog boxes
|
|
||||||
int x = 0, y = 0, w, h;
|
|
||||||
|
|
||||||
// Now create all the dialogs attached to each menu button
|
// Now create all the dialogs attached to each menu button
|
||||||
w = 410; h = 275;
|
myVideoDialog = new VideoDialog(osystem, parent, font);
|
||||||
myVideoDialog = new VideoDialog(osystem, parent, font, x, y, w, h);
|
myAudioDialog = new AudioDialog(osystem, parent, font);
|
||||||
|
|
||||||
w = 285; h = 200;
|
|
||||||
myAudioDialog = new AudioDialog(osystem, parent, font, x, y, w, h);
|
|
||||||
|
|
||||||
|
/* FIXME - may not be needed with small-font functionality
|
||||||
#ifdef _WIN32_WCE
|
#ifdef _WIN32_WCE
|
||||||
// FIXME - adjust size for WINCE using a smaller font
|
// FIXME - adjust size for WINCE using a smaller font
|
||||||
// we scale the input dialog down a bit in low res devices.
|
// we scale the input dialog down a bit in low res devices.
|
||||||
|
@ -134,31 +129,17 @@ OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
#else
|
#else
|
||||||
w = 380; h = 310;
|
w = 380; h = 310;
|
||||||
#endif
|
#endif
|
||||||
myInputDialog = new InputDialog(osystem, parent, font, x, y, w, h);
|
*/
|
||||||
|
myInputDialog = new InputDialog(osystem, parent, font);
|
||||||
w = 380; h = 220;
|
myUIDialog = new UIDialog(osystem, parent, font);
|
||||||
myUIDialog = new UIDialog(osystem, parent, font, x, y, w, h);
|
myFileSnapDialog = new FileSnapDialog(osystem, parent, font, boss);
|
||||||
|
myRomAuditDialog = new RomAuditDialog(osystem, parent, font);
|
||||||
w = 480; h = 250;
|
myGameInfoDialog = new GameInfoDialog(osystem, parent, font, this);
|
||||||
myFileSnapDialog = new FileSnapDialog(osystem, parent, font,
|
|
||||||
boss, x, y, w, h);
|
|
||||||
|
|
||||||
w = 440; h = 160;
|
|
||||||
myRomAuditDialog = new RomAuditDialog(osystem, parent, font, x, y, w, h);
|
|
||||||
|
|
||||||
w = 470; h = 300;
|
|
||||||
myGameInfoDialog = new GameInfoDialog(osystem, parent, font, this, x, y, w, h);
|
|
||||||
|
|
||||||
#ifdef CHEATCODE_SUPPORT
|
#ifdef CHEATCODE_SUPPORT
|
||||||
w = 380; h = 240;
|
myCheatCodeDialog = new CheatCodeDialog(osystem, parent, font);
|
||||||
myCheatCodeDialog = new CheatCodeDialog(osystem, parent, font, x, y, w, h);
|
|
||||||
#endif
|
#endif
|
||||||
|
myHelpDialog = new HelpDialog(osystem, parent, font);
|
||||||
w = 420; h = 270;
|
myAboutDialog = new AboutDialog(osystem, parent, font);
|
||||||
myHelpDialog = new HelpDialog(osystem, parent, font, x, y, w, h);
|
|
||||||
|
|
||||||
w = 480; h = 270;
|
|
||||||
myAboutDialog = new AboutDialog(osystem, parent, font, x, y, w, h);
|
|
||||||
|
|
||||||
addToFocusList(wid);
|
addToFocusList(wid);
|
||||||
|
|
||||||
|
@ -174,6 +155,7 @@ OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
#ifdef _WIN32_WCE
|
#ifdef _WIN32_WCE
|
||||||
myAudioSettingsButton->clearFlags(WIDGET_ENABLED); // not honored in wince port
|
myAudioSettingsButton->clearFlags(WIDGET_ENABLED); // not honored in wince port
|
||||||
#endif
|
#endif
|
||||||
|
//FIXME - this may no longer be true (with the new small font functionality)
|
||||||
if(instance().desktopWidth() < 320)
|
if(instance().desktopWidth() < 320)
|
||||||
{
|
{
|
||||||
// These cannot be displayed in low res devices
|
// These cannot be displayed in low res devices
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: RomAuditDialog.cxx,v 1.8 2009-01-01 18:13:39 stephena Exp $
|
// $Id: RomAuditDialog.cxx,v 1.9 2009-01-04 22:27:44 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -34,38 +34,44 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
RomAuditDialog::RomAuditDialog(OSystem* osystem, DialogContainer* parent,
|
RomAuditDialog::RomAuditDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
const GUI::Font& font,
|
const GUI::Font& font)
|
||||||
int x, int y, int w, int h)
|
: Dialog(osystem, parent, 0, 0, 0, 0),
|
||||||
: Dialog(osystem, parent, x, y, w, h),
|
|
||||||
myBrowser(NULL)
|
myBrowser(NULL)
|
||||||
{
|
{
|
||||||
const int vBorder = 8;
|
const int vBorder = 8;
|
||||||
const int bwidth = font.getStringWidth("Audit path:") + 20,
|
|
||||||
bheight = font.getLineHeight() + 4,
|
const int lineHeight = font.getLineHeight(),
|
||||||
fontHeight = font.getLineHeight(),
|
fontWidth = font.getMaxCharWidth(),
|
||||||
|
fontHeight = font.getFontHeight(),
|
||||||
|
buttonWidth = font.getStringWidth("Audit path:") + 20,
|
||||||
|
buttonHeight = font.getLineHeight() + 4,
|
||||||
lwidth = font.getStringWidth("ROMs with properties (renamed): ");
|
lwidth = font.getStringWidth("ROMs with properties (renamed): ");
|
||||||
int xpos = vBorder, ypos = vBorder;
|
int xpos = vBorder, ypos = vBorder;
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
|
|
||||||
|
// Set real dimensions
|
||||||
|
_w = 44 * fontWidth + 10;
|
||||||
|
_h = 7 * (lineHeight + 4) + 10;
|
||||||
|
|
||||||
// Audit path
|
// Audit path
|
||||||
ButtonWidget* romButton =
|
ButtonWidget* romButton =
|
||||||
new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Audit path:",
|
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
|
||||||
kChooseAuditDirCmd);
|
"Audit path:", kChooseAuditDirCmd);
|
||||||
wid.push_back(romButton);
|
wid.push_back(romButton);
|
||||||
xpos += bwidth + 10;
|
xpos += buttonWidth + 10;
|
||||||
myRomPath = new EditTextWidget(this, font, xpos, ypos + 2,
|
myRomPath = new EditTextWidget(this, font, xpos, ypos + 2,
|
||||||
_w - xpos - 10, font.getLineHeight(), "");
|
_w - xpos - 10, lineHeight, "");
|
||||||
wid.push_back(myRomPath);
|
wid.push_back(myRomPath);
|
||||||
|
|
||||||
// Show results of ROM audit
|
// Show results of ROM audit
|
||||||
xpos = vBorder + 10; ypos += bheight + 10;
|
xpos = vBorder + 10; ypos += buttonHeight + 10;
|
||||||
new StaticTextWidget(this, font, xpos, ypos, lwidth, fontHeight,
|
new StaticTextWidget(this, font, xpos, ypos, lwidth, fontHeight,
|
||||||
"ROMs with properties (renamed): ", kTextAlignLeft);
|
"ROMs with properties (renamed): ", kTextAlignLeft);
|
||||||
myResults1 = new StaticTextWidget(this, font, xpos + lwidth, ypos,
|
myResults1 = new StaticTextWidget(this, font, xpos + lwidth, ypos,
|
||||||
_w - lwidth - 20, fontHeight, "",
|
_w - lwidth - 20, fontHeight, "",
|
||||||
kTextAlignLeft);
|
kTextAlignLeft);
|
||||||
myResults1->setFlags(WIDGET_CLEARBG);
|
myResults1->setFlags(WIDGET_CLEARBG);
|
||||||
ypos += bheight;
|
ypos += buttonHeight;
|
||||||
new StaticTextWidget(this, font, xpos, ypos, lwidth, fontHeight,
|
new StaticTextWidget(this, font, xpos, ypos, lwidth, fontHeight,
|
||||||
"ROMs without properties: ", kTextAlignLeft);
|
"ROMs without properties: ", kTextAlignLeft);
|
||||||
myResults2 = new StaticTextWidget(this, font, xpos + lwidth, ypos,
|
myResults2 = new StaticTextWidget(this, font, xpos + lwidth, ypos,
|
||||||
|
@ -73,9 +79,9 @@ RomAuditDialog::RomAuditDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
kTextAlignLeft);
|
kTextAlignLeft);
|
||||||
myResults2->setFlags(WIDGET_CLEARBG);
|
myResults2->setFlags(WIDGET_CLEARBG);
|
||||||
|
|
||||||
ypos += bheight + 8;
|
ypos += buttonHeight + 8;
|
||||||
new StaticTextWidget(this, font, xpos, ypos, _w - 20, fontHeight,
|
new StaticTextWidget(this, font, xpos, ypos, _w - 20, fontHeight,
|
||||||
"(*) Warning: this operation cannot be undone",
|
"(*) WARNING: operation cannot be undone",
|
||||||
kTextAlignLeft);
|
kTextAlignLeft);
|
||||||
|
|
||||||
// Add OK and Cancel buttons
|
// Add OK and Cancel buttons
|
||||||
|
@ -84,7 +90,7 @@ RomAuditDialog::RomAuditDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
addBGroupToFocusList(wid);
|
addBGroupToFocusList(wid);
|
||||||
|
|
||||||
// Create file browser dialog
|
// Create file browser dialog
|
||||||
myBrowser = new BrowserDialog(this, font, 0, 0, 400, 320);
|
myBrowser = new BrowserDialog(this, font);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -158,17 +164,6 @@ void RomAuditDialog::auditRoms()
|
||||||
myResults2->setValue(notfound);
|
myResults2->setValue(notfound);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
void RomAuditDialog::openBrowser(const string& title, const string& startpath,
|
|
||||||
FilesystemNode::ListMode mode, int cmd)
|
|
||||||
{
|
|
||||||
parent().addDialog(myBrowser);
|
|
||||||
|
|
||||||
myBrowser->setTitle(title);
|
|
||||||
myBrowser->setEmitSignal(cmd);
|
|
||||||
myBrowser->setStartPath(startpath, mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void RomAuditDialog::handleCommand(CommandSender* sender, int cmd,
|
void RomAuditDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
int data, int id)
|
int data, int id)
|
||||||
|
@ -180,7 +175,7 @@ void RomAuditDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kChooseAuditDirCmd:
|
case kChooseAuditDirCmd:
|
||||||
openBrowser("Select ROM directory to audit:", myRomPath->getEditString(),
|
myBrowser->show("Select ROM directory to audit:", myRomPath->getEditString(),
|
||||||
FilesystemNode::kListDirectoriesOnly, kAuditDirChosenCmd);
|
FilesystemNode::kListDirectoriesOnly, kAuditDirChosenCmd);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: RomAuditDialog.hxx,v 1.2 2009-01-01 18:13:39 stephena Exp $
|
// $Id: RomAuditDialog.hxx,v 1.3 2009-01-04 22:27:44 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -37,7 +37,7 @@ class RomAuditDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RomAuditDialog(OSystem* osystem, DialogContainer* parent,
|
RomAuditDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
const GUI::Font& font, int x, int y, int w, int h);
|
const GUI::Font& font);
|
||||||
~RomAuditDialog();
|
~RomAuditDialog();
|
||||||
|
|
||||||
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: RomInfoWidget.cxx,v 1.14 2009-01-03 22:57:12 stephena Exp $
|
// $Id: RomInfoWidget.cxx,v 1.15 2009-01-04 22:27:44 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
@ -204,9 +204,10 @@ void RomInfoWidget::drawWidget(bool hilite)
|
||||||
}
|
}
|
||||||
else if(mySurfaceErrorMsg != "")
|
else if(mySurfaceErrorMsg != "")
|
||||||
{
|
{
|
||||||
uInt32 x = _x + ((_w - _font->getStringWidth(mySurfaceErrorMsg)) >> 1);
|
const GUI::Font* font = &instance().font();
|
||||||
uInt32 y = _y + ((yoff - _font->getLineHeight()) >> 1);
|
uInt32 x = _x + ((_w - font->getStringWidth(mySurfaceErrorMsg)) >> 1);
|
||||||
s.drawString(_font, mySurfaceErrorMsg, x, y, _w - 10, _textcolor);
|
uInt32 y = _y + ((yoff - font->getLineHeight()) >> 1);
|
||||||
|
s.drawString(font, mySurfaceErrorMsg, x, y, _w - 10, _textcolor);
|
||||||
}
|
}
|
||||||
int xpos = _x + 5, ypos = _y + yoff + 10;
|
int xpos = _x + 5, ypos = _y + yoff + 10;
|
||||||
for(unsigned int i = 0; i < myRomInfo.size(); ++i)
|
for(unsigned int i = 0; i < myRomInfo.size(); ++i)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: UIDialog.cxx,v 1.18 2009-01-03 15:44:13 stephena Exp $
|
// $Id: UIDialog.cxx,v 1.19 2009-01-04 22:27:44 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -36,8 +36,8 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
|
UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
const GUI::Font& font, int x, int y, int w, int h)
|
const GUI::Font& font)
|
||||||
: Dialog(osystem, parent, x, y, w, h)
|
: Dialog(osystem, parent, 0, 0, 0, 0)
|
||||||
{
|
{
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
fontWidth = font.getMaxCharWidth(),
|
fontWidth = font.getMaxCharWidth(),
|
||||||
|
@ -51,8 +51,8 @@ UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
StringMap items;
|
StringMap items;
|
||||||
|
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
// _w = 36 * fontWidth + 10;
|
_w = 42 * fontWidth + 10;
|
||||||
// _h = 10 * (lineHeight + 4) + 10;
|
_h = 9 * (lineHeight + 4) + 10;
|
||||||
|
|
||||||
// The tab widget
|
// The tab widget
|
||||||
xpos = ypos = vBorder;
|
xpos = ypos = vBorder;
|
||||||
|
@ -99,6 +99,7 @@ UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
pwidth = font.getStringWidth("2x (1000x760)");
|
pwidth = font.getStringWidth("2x (1000x760)");
|
||||||
items.clear();
|
items.clear();
|
||||||
items.push_back("Small", "small");
|
items.push_back("Small", "small");
|
||||||
|
items.push_back("Medium", "medium");
|
||||||
items.push_back("Large", "large");
|
items.push_back("Large", "large");
|
||||||
myLauncherFontPopup =
|
myLauncherFontPopup =
|
||||||
new PopUpWidget(myTab, font, xpos, ypos+1, pwidth, lineHeight, items,
|
new PopUpWidget(myTab, font, xpos, ypos+1, pwidth, lineHeight, items,
|
||||||
|
@ -255,7 +256,7 @@ void UIDialog::loadConfig()
|
||||||
|
|
||||||
// Launcher font
|
// Launcher font
|
||||||
const string& font = instance().settings().getString("launcherfont");
|
const string& font = instance().settings().getString("launcherfont");
|
||||||
myLauncherFontPopup->setSelected(font, "small");
|
myLauncherFontPopup->setSelected(font, "medium");
|
||||||
|
|
||||||
// ROM launcher info viewer
|
// ROM launcher info viewer
|
||||||
const string& viewer = instance().settings().getString("romviewer");
|
const string& viewer = instance().settings().getString("romviewer");
|
||||||
|
@ -328,7 +329,7 @@ void UIDialog::setDefaults()
|
||||||
myLauncherWidthLabel->setValue(w);
|
myLauncherWidthLabel->setValue(w);
|
||||||
myLauncherHeightSlider->setValue(h);
|
myLauncherHeightSlider->setValue(h);
|
||||||
myLauncherHeightLabel->setValue(h);
|
myLauncherHeightLabel->setValue(h);
|
||||||
myLauncherFontPopup->setSelected("small", "");
|
myLauncherFontPopup->setSelected("medium", "");
|
||||||
myRomViewerPopup->setSelected("0", "");
|
myRomViewerPopup->setSelected("0", "");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: UIDialog.hxx,v 1.10 2009-01-01 18:13:39 stephena Exp $
|
// $Id: UIDialog.hxx,v 1.11 2009-01-04 22:27:44 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -37,8 +37,7 @@ class TabWidget;
|
||||||
class UIDialog : public Dialog
|
class UIDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UIDialog(OSystem* osystem, DialogContainer* parent,
|
UIDialog(OSystem* osystem, DialogContainer* parent, const GUI::Font& font);
|
||||||
const GUI::Font& font, int x, int y, int w, int h);
|
|
||||||
~UIDialog();
|
~UIDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: VideoDialog.cxx,v 1.59 2009-01-01 18:13:39 stephena Exp $
|
// $Id: VideoDialog.cxx,v 1.60 2009-01-04 22:27:44 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -38,8 +38,8 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
|
VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
const GUI::Font& font, int x, int y, int w, int h)
|
const GUI::Font& font)
|
||||||
: Dialog(osystem, parent, x, y, w, h)
|
: Dialog(osystem, parent, 0, 0, 0, 0)
|
||||||
{
|
{
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
fontWidth = font.getMaxCharWidth(),
|
fontWidth = font.getMaxCharWidth(),
|
||||||
|
@ -53,6 +53,10 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
StringMap items;
|
StringMap items;
|
||||||
|
|
||||||
|
// Set real dimensions
|
||||||
|
_w = 46 * fontWidth + 10;
|
||||||
|
_h = 11 * (lineHeight + 4) + 10;
|
||||||
|
|
||||||
xpos = 5; ypos = 10;
|
xpos = 5; ypos = 10;
|
||||||
|
|
||||||
// Video renderer
|
// Video renderer
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: VideoDialog.hxx,v 1.27 2009-01-01 18:13:39 stephena Exp $
|
// $Id: VideoDialog.hxx,v 1.28 2009-01-04 22:27:44 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -37,8 +37,7 @@ class CheckboxWidget;
|
||||||
class VideoDialog : public Dialog
|
class VideoDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VideoDialog(OSystem* osystem, DialogContainer* parent,
|
VideoDialog(OSystem* osystem, DialogContainer* parent, const GUI::Font& font);
|
||||||
const GUI::Font& font, int x, int y, int w, int h);
|
|
||||||
~VideoDialog();
|
~VideoDialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue