From 333d2da1da40d3547f823c5a20c8c586a7fc3c43 Mon Sep 17 00:00:00 2001 From: Nicolas Bacca Date: Wed, 3 Mar 2004 22:31:28 +0000 Subject: Add SDL information to track driver problems svn-id: r13171 --- backends/wince/CELauncherDialog.cpp | 34 +++++++++++++++++++++++++++++++++- backends/wince/CELauncherDialog.h | 1 + 2 files changed, 34 insertions(+), 1 deletion(-) (limited to 'backends/wince') diff --git a/backends/wince/CELauncherDialog.cpp b/backends/wince/CELauncherDialog.cpp index 7c432f5a20..e8cbdfcd45 100644 --- a/backends/wince/CELauncherDialog.cpp +++ b/backends/wince/CELauncherDialog.cpp @@ -20,10 +20,15 @@ */ #include "stdafx.h" + +#include "wince-sdl.h" + #include "CELauncherDialog.h" #include "base/engine.h" +#include "gui/newgui.h" +#include "gui/widget.h" #include "gui/browser.h" #include "gui/message.h" @@ -32,10 +37,37 @@ using namespace GUI; using namespace Common; +class CEAboutDialog : public Dialog { +public: + CEAboutDialog::CEAboutDialog() + : Dialog(10, 60, 300, 77) { + char tempo[100]; + + addButton((_w - kButtonWidth) / 2, 45, "OK", kCloseCmd, '\r'); // Close dialog - FIXME + + Common::String videoDriver("Using SDL driver "); + SDL_VideoDriverName(tempo, sizeof(tempo)); + videoDriver += tempo; + new StaticTextWidget(this, 0, 10, _w, kLineHeight, videoDriver, kTextAlignCenter); + Common::String displayInfos("Display "); + sprintf(tempo, "%dx%d", GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); + displayInfos += tempo; + new StaticTextWidget(this, 0, 20, _w, kLineHeight, displayInfos, kTextAlignCenter); + } +}; + CELauncherDialog::CELauncherDialog(GameDetector &detector) : GUI::LauncherDialog(detector) { } +void CELauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { + LauncherDialog::handleCommand(sender, cmd, data); + if (cmd == 'ABOU') { + CEAboutDialog about; + about.runModal(); + } +} + void CELauncherDialog::addCandidate(String &path, DetectedGameList &candidates) { int idx = -1; DetectedGame result; @@ -47,7 +79,7 @@ void CELauncherDialog::addCandidate(String &path, DetectedGameList &candidates) idx = 0; else { char candidateName[100]; - int i; + unsigned int i; for (i=path.size() - 2; i && path[i] != '\\'; i--); strcpy(candidateName, &path[i + 1]); candidateName[strlen(candidateName) - 1] = '\0'; diff --git a/backends/wince/CELauncherDialog.h b/backends/wince/CELauncherDialog.h index c035ca4ec1..6617b0250b 100644 --- a/backends/wince/CELauncherDialog.h +++ b/backends/wince/CELauncherDialog.h @@ -32,6 +32,7 @@ class CELauncherDialog : public GUI::LauncherDialog { public: CELauncherDialog(GameDetector &detector); + virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data); protected: void addGame(); void addCandidate(String &path, DetectedGameList &candidates); -- cgit v1.2.3