[Scummvm-cvs-logs] SF.net SVN: scummvm: [26554] scummvm/trunk/gui

knakos at users.sourceforge.net knakos at users.sourceforge.net
Sat Apr 21 16:01:37 CEST 2007


Revision: 26554
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26554&view=rev
Author:   knakos
Date:     2007-04-21 07:01:36 -0700 (Sat, 21 Apr 2007)

Log Message:
-----------
improve the looks of keysdialog

Modified Paths:
--------------
    scummvm/trunk/gui/KeysDialog.cpp
    scummvm/trunk/gui/theme-config.cpp

Modified: scummvm/trunk/gui/KeysDialog.cpp
===================================================================
--- scummvm/trunk/gui/KeysDialog.cpp	2007-04-21 12:51:40 UTC (rev 26553)
+++ scummvm/trunk/gui/KeysDialog.cpp	2007-04-21 14:01:36 UTC (rev 26554)
@@ -1,5 +1,5 @@
 /* ScummVM - Scumm Interpreter
- * Copyright (C) 2001-2006 The ScummVM project
+ * Copyright (C) 2001-2007 The ScummVM project
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -31,16 +31,6 @@
 
 namespace GUI {
 
-/*
-using GUI::ListWidget;
-using GUI::kListNumberingZero;
-using GUI::WIDGET_CLEARBG;
-using GUI::kListSelectionChangedCmd;
-using GUI::kCloseCmd;
-using GUI::StaticTextWidget;
-using GUI::CommandSender;
-*/
-
 enum {
 	kMapCmd					= 'map ',
 	kOKCmd					= 'ok  '
@@ -60,7 +50,7 @@
 	_actionsList->setNumberingMode(kListNumberingZero);
 
 	_actionTitle = new StaticTextWidget(this, "keysdialog_action", title);
-	_keyMapping = new StaticTextWidget(this, "keysdialog_mapping", "");
+	_keyMapping = new StaticTextWidget(this, "keysdialog_mapping", "Select an action and click 'Map'");
 
 	_actionTitle->setFlags(WIDGET_CLEARBG);
 	_keyMapping->setFlags(WIDGET_CLEARBG);
@@ -82,26 +72,26 @@
 
 	case kListSelectionChangedCmd:
 		if (_actionsList->getSelected() >= 0) {
-				char selection[100];
+			char selection[100];
 #ifdef __SYMBIAN32__
-				uint16 key = Actions::Instance()->getMapping(_actionsList->getSelected());
-				
-				if (key != 0) {
-					// ScummVM mappings for F1-F9 are different from SDL so remap back to sdl
-					if (key >= 315 && key <= 323) {
-						key = key - 315 + SDLK_F1;
-					}
+			uint16 key = Actions::Instance()->getMapping(_actionsList->getSelected());
+
+			if (key != 0) {
+				// ScummVM mappings for F1-F9 are different from SDL so remap back to sdl
+				if (key >= 315 && key <= 323) {
+					key = key - 315 + SDLK_F1;
 				}
+			}
 
-				if (key != 0)
-					sprintf(selection, "Associated key : %s", SDL_GetKeyName((SDLKey)key));
-				else
-					sprintf(selection, "Associated key : none");
+			if (key != 0)
+				sprintf(selection, "Associated key : %s", SDL_GetKeyName((SDLKey)key));
+			else
+				sprintf(selection, "Associated key : none");
 #else
-				sprintf(selection, "Associated key : %s", CEDevice::getKeyName(Actions::Instance()->getMapping((ActionType)(_actionsList->getSelected()))).c_str());
+			sprintf(selection, "Associated key : %s", CEDevice::getKeyName(Actions::Instance()->getMapping((ActionType)(_actionsList->getSelected()))).c_str());
 #endif
-				_keyMapping->setLabel(selection);
-				_keyMapping->draw();
+			_keyMapping->setLabel(selection);
+			_keyMapping->draw();
 		}
 		break;
 	case kMapCmd:
@@ -109,29 +99,29 @@
 				_actionTitle->setLabel("Please select an action");
 		}
 		else {
-				char selection[100];
+			char selection[100];
 
-				_actionSelected = _actionsList->getSelected();
+			_actionSelected = _actionsList->getSelected();
 #ifdef __SYMBIAN32__
-				uint16 key = Actions::Instance()->getMapping(_actionSelected);
-				if (key != 0) {
-					// ScummVM mappings for F1-F9 are different from SDL so remap back to sdl
-					if (key >= 315 && key <= 323) {
-						key = key - 315 + SDLK_F1;
-					}
-
-					sprintf(selection, "Associated key : %s", SDL_GetKeyName((SDLKey)key));
+			uint16 key = Actions::Instance()->getMapping(_actionSelected);
+			if (key != 0) {
+				// ScummVM mappings for F1-F9 are different from SDL so remap back to sdl
+				if (key >= 315 && key <= 323) {
+					key = key - 315 + SDLK_F1;
 				}
-				else
-					sprintf(selection, "Associated key : none");
+
+				sprintf(selection, "Associated key : %s", SDL_GetKeyName((SDLKey)key));
+			}
+			else
+				sprintf(selection, "Associated key : none");
 #else
-				sprintf(selection, "Associated key : %s", CEDevice::getKeyName(Actions::Instance()->getMapping((ActionType)_actionSelected)).c_str());
+			sprintf(selection, "Associated key : %s", CEDevice::getKeyName(Actions::Instance()->getMapping((ActionType)_actionSelected)).c_str());
 #endif
-				_actionTitle->setLabel("Press the key to associate");
-				_keyMapping->setLabel(selection);
-				_keyMapping->draw();
-				Actions::Instance()->beginMapping(true);
-				_actionsList->setEnabled(false);
+			_actionTitle->setLabel("Press the key to associate");
+			_keyMapping->setLabel(selection);
+			_keyMapping->draw();
+			Actions::Instance()->beginMapping(true);
+			_actionsList->setEnabled(false);
 		}
 		_actionTitle->draw();
 		break;
@@ -147,9 +137,9 @@
 }
 
 void KeysDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers){
-		if (!Actions::Instance()->mappingActive()) {
-			Dialog::handleKeyDown(ascii,keycode,modifiers);
-		}
+	if (!Actions::Instance()->mappingActive()) {
+		Dialog::handleKeyDown(ascii,keycode,modifiers);
+	}
 }
 
 void KeysDialog::handleKeyUp(uint16 ascii, int keycode, int modifiers) {

Modified: scummvm/trunk/gui/theme-config.cpp
===================================================================
--- scummvm/trunk/gui/theme-config.cpp	2007-04-21 12:51:40 UTC (rev 26553)
+++ scummvm/trunk/gui/theme-config.cpp	2007-04-21 14:01:36 UTC (rev 26554)
@@ -1,5 +1,5 @@
 /* ScummVM - Scumm Interpreter
- * Copyright (C) 2006 The ScummVM project
+ * Copyright (C) 2006-2007 The ScummVM project
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -284,14 +284,15 @@
 "gameoptions_ok=(prev.x2 + 10) prev.y prev.w prev.h\n"
 "\n"
 "### keys dialog\n"
-"keysdialog=(w / 20) (h / 10) (w - w / 10) (h - h / 5)\n"
+"keysdialog=(w / 20) (h / 10) (w - w / 10) (h - h / 4)\n"
 "set_parent=keysdialog\n"
-"keysdialog_map=(parent.w - buttonWidth - 10) 20 buttonWidth buttonHeight\n"
+"keysdialog_map=(parent.w - buttonWidth - 10) (10 + 2 * kLineHeight) buttonWidth buttonHeight\n"
 "keysdialog_ok=prev.x (prev.y2 + 4) prev.w prev.h\n"
 "keysdialog_cancel=prev.x (prev.y2 + 4) prev.w prev.h\n"
-"keysdialog_list=10 10 (prev.x - 20) (parent.h - kLineHeight * 4 - self.y)\n"
-"keysdialog_action=prev.x (parent.h - kLineHeight * 3) (parent.w - self.x * 2) kLineHeight\n"
-"keysdialog_mapping=prev.x (prev.y + kLineHeight) prev.w prev.h\n"
+"keysdialog_action=10 10 (parent.w - 20) kLineHeight\n"
+"keysdialog_action.align=kTextAlignCenter\n"
+"keysdialog_list=prev.x (prev.y + 2 * kLineHeight) (parent.w - buttonWidth - 30) (parent.h - kLineHeight * 6)\n"
+"keysdialog_mapping=prev.x (prev.y + prev.h + kLineHeight) (parent.w - buttonWidth - 20) kLineHeight\n"
 "\n"
 "### mass add dialog\n"
 "massadddialog=10 20 300 174\n"


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list