From 769f5c291997dba6cde9bd4b89391bff7d4e9872 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 8 Sep 2003 18:09:32 +0000 Subject: added About dialog to launcher svn-id: r10107 --- gui/launcher.cpp | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'gui') diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 65a8341c47..d157160bbc 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -19,16 +19,19 @@ */ #include "stdafx.h" -#include "launcher.h" -#include "browser.h" -#include "chooser.h" -#include "message.h" -#include "newgui.h" -#include "options.h" -#include "EditTextWidget.h" -#include "ListWidget.h" + +#include "gui/about.h" +#include "gui/browser.h" +#include "gui/chooser.h" +#include "gui/launcher.h" +#include "gui/message.h" +#include "gui/newgui.h" +#include "gui/options.h" +#include "gui/EditTextWidget.h" +#include "gui/ListWidget.h" #include "backends/fs/fs.h" + #include "common/config-file.h" #include "common/engine.h" #include "common/gameDetector.h" @@ -36,6 +39,7 @@ enum { kStartCmd = 'STRT', + kAboutCmd = 'ABOU', kOptionsCmd = 'OPTN', kAddGameCmd = 'ADDG', kEditGameCmd = 'EDTG', @@ -172,9 +176,16 @@ LauncherDialog::LauncherDialog(NewGui *gui, GameDetector &detector) new StaticTextWidget(this, 10, 8, 300, kLineHeight, gScummVMFullVersion, kTextAlignCenter); // Add three buttons at the bottom - addButton(1 * (_w - kButtonWidth) / 6, _h - 24, "Quit", kQuitCmd, 'Q'); - addButton(3 * (_w - kButtonWidth) / 6, _h - 24, "Options", kOptionsCmd, 'O'); - _startButton = addButton(5 * (_w - kButtonWidth)/6, _h - 24, "Start", kStartCmd, 'S'); + const int border = 10; + const int space = 8; + const int buttons = 4; + const int width = (_w - 2 * border - space * (buttons - 1)) / buttons; + int x = border; + new ButtonWidget(this, x, _h - 24, width, 16, "Quit", kQuitCmd, 'Q'); x += space + width; + new ButtonWidget(this, x, _h - 24, width, 16, "About", kAboutCmd, 'B'); x += space + width; + new ButtonWidget(this, x, _h - 24, width, 16, "Options", kOptionsCmd, 'O'); x += space + width; + _startButton = + new ButtonWidget(this, x, _h - 24, width, 16, "Start", kStartCmd, 'S'); x += space + width; // Add list with game titles _list = new ListWidget(this, 10, 28, 300, 112); @@ -437,6 +448,11 @@ void LauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat options.runModal(); } break; + case kAboutCmd: { + AboutDialog about(_gui); + about.runModal(); + } + break; case kStartCmd: case kListItemDoubleClickedCmd: // Print out what was selected -- cgit v1.2.3