[ros-diffs] [ekohl] 29135: Don't use hardcoded strings in the configuration message box. Use string resources instead.

ekohl at svn.reactos.org ekohl at svn.reactos.org
Sat Sep 22 11:09:58 CEST 2007


Author: ekohl
Date: Sat Sep 22 13:09:57 2007
New Revision: 29135

URL: http://svn.reactos.org/svn/reactos?rev=29135&view=rev
Log:
Don't use hardcoded strings in the configuration message box. Use string resources instead.

Added:
    trunk/reactos/base/applications/screensavers/scrnsave/lang/   (with props)
    trunk/reactos/base/applications/screensavers/scrnsave/lang/en-US.rc   (with props)
Modified:
    trunk/reactos/base/applications/screensavers/scrnsave/resource.h
    trunk/reactos/base/applications/screensavers/scrnsave/scrnsave.c
    trunk/reactos/base/applications/screensavers/scrnsave/scrnsave.rc

Propchange: trunk/reactos/base/applications/screensavers/scrnsave/lang/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Sep 22 13:09:57 2007
@@ -1,0 +1,7 @@
+GNUmakefile
+*.vcproj
+*.user
+*.cbp
+*.ncb
+*.suo
+*.sln

Added: trunk/reactos/base/applications/screensavers/scrnsave/lang/en-US.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/screensavers/scrnsave/lang/en-US.rc?rev=29135&view=auto
==============================================================================
--- trunk/reactos/base/applications/screensavers/scrnsave/lang/en-US.rc (added)
+++ trunk/reactos/base/applications/screensavers/scrnsave/lang/en-US.rc Sat Sep 22 13:09:57 2007
@@ -1,0 +1,8 @@
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_DESCRIPTION "Default ScreenSaver"
+    IDS_TITLE       "About"
+    IDS_TEXT        "No options need to be set."
+END

Propchange: trunk/reactos/base/applications/screensavers/scrnsave/lang/en-US.rc
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/reactos/base/applications/screensavers/scrnsave/resource.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/screensavers/scrnsave/resource.h?rev=29135&r1=29134&r2=29135&view=diff
==============================================================================
--- trunk/reactos/base/applications/screensavers/scrnsave/resource.h (original)
+++ trunk/reactos/base/applications/screensavers/scrnsave/resource.h Sat Sep 22 13:09:57 2007
@@ -1,2 +1,4 @@
 
-#define IDS_DESCRIPTION                 1
+#define IDS_DESCRIPTION 1
+#define IDS_TITLE       2
+#define IDS_TEXT        3

Modified: trunk/reactos/base/applications/screensavers/scrnsave/scrnsave.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/screensavers/scrnsave/scrnsave.c?rev=29135&r1=29134&r2=29135&view=diff
==============================================================================
--- trunk/reactos/base/applications/screensavers/scrnsave/scrnsave.c (original)
+++ trunk/reactos/base/applications/screensavers/scrnsave/scrnsave.c Sat Sep 22 13:09:57 2007
@@ -19,6 +19,7 @@
 
 #include <windows.h>
 #include <tchar.h>
+#include "resource.h"
 
 #define APPNAME _T("Scrnsave")
 
@@ -151,6 +152,28 @@
 		*hwndParent = 0;
 }
 
+void Configure(void)
+{
+	TCHAR szTitle[256];
+	TCHAR szText[256];
+
+	LoadString(hInstance,
+		   IDS_TITLE,
+		   szTitle,
+		   256);
+
+	LoadString(hInstance,
+		   IDS_TEXT,
+		   szText,
+		   256);
+
+	MessageBox(0,
+	           szText,
+	           szTitle,
+	           MB_OK | MB_ICONWARNING);
+}
+
+
 int WINAPI WinMain (HINSTANCE hInst,
                     HINSTANCE hPrev,
                     LPSTR lpCmdLine,
@@ -179,10 +202,7 @@
 
 		case 'c':
 		default:
-			MessageBox(0,
-			           _T("No options need to be set."),
-			           _T("About"),
-			           MB_OK | MB_ICONWARNING);
+			Configure();
 			return 0;
 	}
 

Modified: trunk/reactos/base/applications/screensavers/scrnsave/scrnsave.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/screensavers/scrnsave/scrnsave.rc?rev=29135&r1=29134&r2=29135&view=diff
==============================================================================
--- trunk/reactos/base/applications/screensavers/scrnsave/scrnsave.rc (original)
+++ trunk/reactos/base/applications/screensavers/scrnsave/scrnsave.rc Sat Sep 22 13:09:57 2007
@@ -10,10 +10,4 @@
 
 #include <reactos/version.rc>
 
-
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-
-STRINGTABLE DISCARDABLE
-BEGIN
-    IDS_DESCRIPTION         "Default ScreenSaver"
-END
+#include "lang/en-US.rc"




More information about the Ros-diffs mailing list