From 33e8e88e81aaf6a4199edd3baf88df5c25ae0b2b Mon Sep 17 00:00:00 2001 From: Frank Richter Date: Thu, 25 Aug 2005 19:19:33 +0000 Subject: [PATCH] Load tab titles and property sheet caption from string resources. --- programs/winecfg/De.rc | 7 +++- programs/winecfg/En.rc | 9 +++-- programs/winecfg/Fr.rc | 1 - programs/winecfg/Ja.rc | 1 - programs/winecfg/Nl.rc | 1 - programs/winecfg/Ru.rc | 1 - programs/winecfg/main.c | 69 ++++++++++++++++++++++--------------- programs/winecfg/resource.h | 7 +++- 8 files changed, 61 insertions(+), 35 deletions(-) diff --git a/programs/winecfg/De.rc b/programs/winecfg/De.rc index 729b52c3cb4..94d8c512406 100644 --- a/programs/winecfg/De.rc +++ b/programs/winecfg/De.rc @@ -183,11 +183,16 @@ END STRINGTABLE DISCARDABLE BEGIN IDS_WINE_VERSION "CVS" - IDS_TAB_GENERAL "Allgemein" + IDS_TAB_APPLICATIONS "Anwendungen" IDS_TAB_DLLS "Bibliotheken" IDS_TAB_DRIVES "Laufwerke" IDS_CHOOSE_PATH "Bitte whlen Sie ein Unix-Verzeichnis fr das Laufwerk." IDS_HIDE_ADVANCED "Verstecke Erweitert" IDS_SHOW_ADVANCED "Zeige Erweitert" IDS_NOTHEME "(Kein Motiv)" + IDS_TAB_GRAPHICS "Grafik" + IDS_TAB_APPEARANCE "Darstellung" + IDS_TAB_AUDIO "Audio" + IDS_TAB_ABOUT "ber" + IDS_WINECFG_TITLE "Wine-Konfiguration" END diff --git a/programs/winecfg/En.rc b/programs/winecfg/En.rc index 9f33d0e72ad..c75abaca551 100644 --- a/programs/winecfg/En.rc +++ b/programs/winecfg/En.rc @@ -185,13 +185,18 @@ END STRINGTABLE DISCARDABLE BEGIN IDS_WINE_VERSION "CVS" - IDS_TAB_GENERAL "General" + IDS_TAB_APPLICATIONS "Applications" IDS_TAB_DLLS "Libraries" IDS_TAB_DRIVES "Drives" IDS_CHOOSE_PATH "Select the unix directory to be mapped, please." IDS_HIDE_ADVANCED "Hide Advanced" IDS_SHOW_ADVANCED "Show Advanced" - IDS_NOTHEME "(No Theme)" + IDS_NOTHEME "(No Theme)" + IDS_TAB_GRAPHICS "Graphics" + IDS_TAB_APPEARANCE "Appearance" + IDS_TAB_AUDIO "Audio" + IDS_TAB_ABOUT "About" + IDS_WINECFG_TITLE "Wine configuration" END diff --git a/programs/winecfg/Fr.rc b/programs/winecfg/Fr.rc index 1eb67dbd08e..94a3534c49f 100644 --- a/programs/winecfg/Fr.rc +++ b/programs/winecfg/Fr.rc @@ -170,7 +170,6 @@ END STRINGTABLE DISCARDABLE BEGIN IDS_WINE_VERSION "CVS" - IDS_TAB_GENERAL "Gnral" IDS_TAB_DLLS "Bibliothques" IDS_TAB_DRIVES "Lecteurs" IDS_CHOOSE_PATH "Veuillez slectionner le rpertoire unix assigner." diff --git a/programs/winecfg/Ja.rc b/programs/winecfg/Ja.rc index 34ba6926791..42d5ba98bf3 100644 --- a/programs/winecfg/Ja.rc +++ b/programs/winecfg/Ja.rc @@ -172,7 +172,6 @@ END STRINGTABLE DISCARDABLE BEGIN IDS_WINE_VERSION "CVS" - IDS_TAB_GENERAL "S" IDS_TAB_DLLS "Cu" IDS_TAB_DRIVES "hCu" IDS_CHOOSE_PATH "}bsOUnixfBNg[Ił" diff --git a/programs/winecfg/Nl.rc b/programs/winecfg/Nl.rc index a922f81d966..e488a4245f5 100644 --- a/programs/winecfg/Nl.rc +++ b/programs/winecfg/Nl.rc @@ -169,7 +169,6 @@ END STRINGTABLE DISCARDABLE BEGIN IDS_WINE_VERSION "CVS" - IDS_TAB_GENERAL "Algemeen" IDS_TAB_DLLS "Bibliotheken" IDS_TAB_DRIVES "Stations" IDS_CHOOSE_PATH "Selecteer een unix folder voor dit station." diff --git a/programs/winecfg/Ru.rc b/programs/winecfg/Ru.rc index 6a06f9a1c42..5d387ca5b28 100644 --- a/programs/winecfg/Ru.rc +++ b/programs/winecfg/Ru.rc @@ -173,7 +173,6 @@ END STRINGTABLE DISCARDABLE BEGIN IDS_WINE_VERSION "CVS" - IDS_TAB_GENERAL "" IDS_TAB_DLLS "" IDS_TAB_DRIVES "" IDS_CHOOSE_PATH " unix ." diff --git a/programs/winecfg/main.c b/programs/winecfg/main.c index c7b2ec22c85..f9ea205e128 100644 --- a/programs/winecfg/main.c +++ b/programs/winecfg/main.c @@ -86,26 +86,41 @@ AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) return FALSE; } +static WCHAR* load_string (UINT id) +{ + WCHAR buf[100]; + int len; + WCHAR* newStr; + + LoadStringW (GetModuleHandle (NULL), id, buf, sizeof(buf)/sizeof(buf[0])); + + len = lstrlenW (buf); + newStr = HeapAlloc (GetProcessHeap(), 0, (len + 1) * sizeof (WCHAR)); + memcpy (newStr, buf, len * sizeof (WCHAR)); + newStr[len] = 0; + return newStr; +} + #define NUM_PROPERTY_PAGES 7 static INT_PTR doPropertySheet (HINSTANCE hInstance, HWND hOwner) { - PROPSHEETPAGE psp[NUM_PROPERTY_PAGES]; - PROPSHEETHEADER psh; + PROPSHEETPAGEW psp[NUM_PROPERTY_PAGES]; + PROPSHEETHEADERW psh; int pg = 0; /* start with page 0 */ /* * Fill out the (Applications) PROPSHEETPAGE data structure * for the property sheet */ - psp[pg].dwSize = sizeof (PROPSHEETPAGE); + psp[pg].dwSize = sizeof (PROPSHEETPAGEW); psp[pg].dwFlags = PSP_USETITLE; psp[pg].hInstance = hInstance; - psp[pg].u.pszTemplate = MAKEINTRESOURCE (IDD_APPCFG); + psp[pg].u.pszTemplate = MAKEINTRESOURCEW (IDD_APPCFG); psp[pg].u2.pszIcon = NULL; psp[pg].pfnDlgProc = AppDlgProc; - psp[pg].pszTitle = "Applications"; + psp[pg].pszTitle = load_string (IDS_TAB_APPLICATIONS); psp[pg].lParam = 0; pg++; @@ -113,13 +128,13 @@ doPropertySheet (HINSTANCE hInstance, HWND hOwner) * Fill out the (Libraries) PROPSHEETPAGE data structure * for the property sheet */ - psp[pg].dwSize = sizeof (PROPSHEETPAGE); + psp[pg].dwSize = sizeof (PROPSHEETPAGEW); psp[pg].dwFlags = PSP_USETITLE; psp[pg].hInstance = hInstance; - psp[pg].u.pszTemplate = MAKEINTRESOURCE (IDD_DLLCFG); + psp[pg].u.pszTemplate = MAKEINTRESOURCEW (IDD_DLLCFG); psp[pg].u2.pszIcon = NULL; psp[pg].pfnDlgProc = LibrariesDlgProc; - psp[pg].pszTitle = "Libraries"; + psp[pg].pszTitle = load_string (IDS_TAB_DLLS); psp[pg].lParam = 0; pg++; @@ -127,43 +142,43 @@ doPropertySheet (HINSTANCE hInstance, HWND hOwner) * Fill out the (X11Drv) PROPSHEETPAGE data structure * for the property sheet */ - psp[pg].dwSize = sizeof (PROPSHEETPAGE); + psp[pg].dwSize = sizeof (PROPSHEETPAGEW); psp[pg].dwFlags = PSP_USETITLE; psp[pg].hInstance = hInstance; - psp[pg].u.pszTemplate = MAKEINTRESOURCE (IDD_GRAPHCFG); + psp[pg].u.pszTemplate = MAKEINTRESOURCEW (IDD_GRAPHCFG); psp[pg].u2.pszIcon = NULL; psp[pg].pfnDlgProc = GraphDlgProc; - psp[pg].pszTitle = "Graphics"; + psp[pg].pszTitle = load_string (IDS_TAB_GRAPHICS); psp[pg].lParam = 0; pg++; - psp[pg].dwSize = sizeof (PROPSHEETPAGE); + psp[pg].dwSize = sizeof (PROPSHEETPAGEW); psp[pg].dwFlags = PSP_USETITLE; psp[pg].hInstance = hInstance; - psp[pg].u.pszTemplate = MAKEINTRESOURCE (IDD_APPEARANCE); + psp[pg].u.pszTemplate = MAKEINTRESOURCEW (IDD_APPEARANCE); psp[pg].u2.pszIcon = NULL; psp[pg].pfnDlgProc = ThemeDlgProc; - psp[pg].pszTitle = "Appearance"; + psp[pg].pszTitle = load_string (IDS_TAB_APPEARANCE); psp[pg].lParam = 0; pg++; - psp[pg].dwSize = sizeof (PROPSHEETPAGE); + psp[pg].dwSize = sizeof (PROPSHEETPAGEW); psp[pg].dwFlags = PSP_USETITLE; psp[pg].hInstance = hInstance; - psp[pg].u.pszTemplate = MAKEINTRESOURCE (IDD_DRIVECFG); + psp[pg].u.pszTemplate = MAKEINTRESOURCEW (IDD_DRIVECFG); psp[pg].u2.pszIcon = NULL; psp[pg].pfnDlgProc = DriveDlgProc; - psp[pg].pszTitle = "Drives"; + psp[pg].pszTitle = load_string (IDS_TAB_DRIVES); psp[pg].lParam = 0; pg++; - psp[pg].dwSize = sizeof (PROPSHEETPAGE); + psp[pg].dwSize = sizeof (PROPSHEETPAGEW); psp[pg].dwFlags = PSP_USETITLE; psp[pg].hInstance = hInstance; - psp[pg].u.pszTemplate = MAKEINTRESOURCE (IDD_AUDIOCFG); + psp[pg].u.pszTemplate = MAKEINTRESOURCEW (IDD_AUDIOCFG); psp[pg].u2.pszIcon = NULL; psp[pg].pfnDlgProc = AudioDlgProc; - psp[pg].pszTitle = "Audio"; + psp[pg].pszTitle = load_string (IDS_TAB_AUDIO); psp[pg].lParam = 0; pg++; @@ -171,34 +186,34 @@ doPropertySheet (HINSTANCE hInstance, HWND hOwner) * Fill out the (General) PROPSHEETPAGE data structure * for the property sheet */ - psp[pg].dwSize = sizeof (PROPSHEETPAGE); + psp[pg].dwSize = sizeof (PROPSHEETPAGEW); psp[pg].dwFlags = PSP_USETITLE; psp[pg].hInstance = hInstance; - psp[pg].u.pszTemplate = MAKEINTRESOURCE (IDD_ABOUTCFG); + psp[pg].u.pszTemplate = MAKEINTRESOURCEW (IDD_ABOUTCFG); psp[pg].u2.pszIcon = NULL; psp[pg].pfnDlgProc = AboutDlgProc; - psp[pg].pszTitle = "About"; + psp[pg].pszTitle = load_string (IDS_TAB_ABOUT); psp[pg].lParam = 0; pg++; /* * Fill out the PROPSHEETHEADER */ - psh.dwSize = sizeof (PROPSHEETHEADER); + psh.dwSize = sizeof (PROPSHEETHEADERW); psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK; psh.hwndParent = hOwner; psh.hInstance = hInstance; psh.u.pszIcon = NULL; - psh.pszCaption = "Wine Configuration"; + psh.pszCaption = load_string (IDS_WINECFG_TITLE); psh.nPages = NUM_PROPERTY_PAGES; - psh.u3.ppsp = (LPCPROPSHEETPAGE) & psp; + psh.u3.ppsp = (LPCPROPSHEETPAGEW) & psp; psh.pfnCallback = (PFNPROPSHEETCALLBACK) PropSheetCallback; psh.u2.nStartPage = 0; /* * Display the modal property sheet */ - return PropertySheet (&psh); + return PropertySheetW (&psh); } /****************************************************************************** diff --git a/programs/winecfg/resource.h b/programs/winecfg/resource.h index 1e37735421c..fa6bbc5fd62 100644 --- a/programs/winecfg/resource.h +++ b/programs/winecfg/resource.h @@ -25,13 +25,18 @@ #define IDC_STATIC -1 #define IDS_WINE_VERSION 1 -#define IDS_TAB_GENERAL 2 +#define IDS_TAB_APPLICATIONS 2 #define IDS_TAB_DLLS 3 #define IDS_TAB_DRIVES 4 #define IDS_CHOOSE_PATH 5 #define IDS_SHOW_ADVANCED 6 #define IDS_HIDE_ADVANCED 7 #define IDS_NOTHEME 8 +#define IDS_TAB_GRAPHICS 9 +#define IDS_TAB_APPEARANCE 10 +#define IDS_TAB_AUDIO 11 +#define IDS_TAB_ABOUT 12 +#define IDS_WINECFG_TITLE 13 #define IDD_MAINDLG 101 #define IDB_WINE 104 #define IDD_ABOUTCFG 107