From ef92dee8c63435f60be7aecb95b37abf1e6e4109 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 21 Feb 2009 22:04:13 +0000 Subject: [PATCH] Win32 - Message Log - Remembers X,Y Position --- changelog.txt | 3 ++- src/drivers/win/config.cpp | 3 +++ src/drivers/win/log.cpp | 11 +++++++++++ src/drivers/win/res.rc | 5 +++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 6bbe1f31..0da7ad9b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,6 @@ ---version 2.0.4 yet to be released--- -19-feb-2009 - adelikat - win32 - memory watch - fixed recent file menu - no longer crashes when attempting to load a non existent recent file +21-feb-2009 - adelikat - win32 - Message Log - remembers X,Y position +19-feb-2009 - adelikat - win32 - Memory Watch - fixed recent file menu - no longer crashes when attempting to load a non existent recent file 07-feb-2009 - adelikat - win32 - Fix bug in screenshot numbering that caused numbering to not reset when changing ROMs 06-feb-2009 - adelikat - win32 - Hex editor - remembers window size 06-feb-2009 - adelikat - Win32 - sound config dialog - added sliders for individual sound channel volume control diff --git a/src/drivers/win/config.cpp b/src/drivers/win/config.cpp index 4073cc51..98a32af9 100644 --- a/src/drivers/win/config.cpp +++ b/src/drivers/win/config.cpp @@ -72,6 +72,7 @@ extern int CDLogger_wndx, CDLogger_wndy; extern int GGConv_wndx, GGConv_wndy; extern int TasEdit_wndx, TasEdit_wndy; extern int MetaPosX,MetaPosY; +extern int MLogPosX,MLogPosY; //Structure that contains configuration information static CFGSTRUCT fceuconfig[] = { @@ -222,6 +223,8 @@ static CFGSTRUCT fceuconfig[] = { AC(TextHookerPosY), AC(MetaPosX), AC(MetaPosY), + AC(MLogPosX), + AC(MLogPosY), AC(pauseAfterPlayback), AC(AFon), diff --git a/src/drivers/win/log.cpp b/src/drivers/win/log.cpp index f1b3fc7a..aa9c9bcb 100644 --- a/src/drivers/win/log.cpp +++ b/src/drivers/win/log.cpp @@ -6,6 +6,8 @@ static HWND logwin = 0; static char *logtext[MAXIMUM_NUMBER_OF_LOGS]; static unsigned int logcount=0; +int MLogPosX=0,MLogPosY=0; //X,Y coordinates of dialog + unsigned int truncated_logcount() { return logcount & ( MAXIMUM_NUMBER_OF_LOGS - 1 ); @@ -56,9 +58,18 @@ void RedoText(void) **/ BOOL CALLBACK LogCon(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { + RECT wrect; //For remembering window position switch(uMsg) { case WM_INITDIALOG: + if (MLogPosX==-32000) MLogPosX=0; //Just in case + if (MLogPosY==-32000) MLogPosY=0; + SetWindowPos(hwndDlg,0,MLogPosX,MLogPosY,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOOWNERZORDER); + break; + case WM_MOVE: + GetWindowRect(hwndDlg,&wrect); //Remember X,Y coordinates + MLogPosX = wrect.left; + MLogPosY = wrect.top; break; case WM_COMMAND: if(HIWORD(wParam)==BN_CLICKED) diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc index 906fae0e..a3ad9f41 100644 --- a/src/drivers/win/res.rc +++ b/src/drivers/win/res.rc @@ -1510,6 +1510,11 @@ BEGIN BOTTOMMARGIN, 191 END + "MESSAGELOG", DIALOG + BEGIN + BOTTOMMARGIN, 184 + END + "NETMOO", DIALOG BEGIN LEFTMARGIN, 10