Load tab titles and property sheet caption from string resources.

This commit is contained in:
Frank Richter 2005-08-25 19:19:33 +00:00 committed by Alexandre Julliard
parent 8aa1a919bf
commit 33e8e88e81
8 changed files with 61 additions and 35 deletions

View File

@ -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 wählen Sie ein Unix-Verzeichnis für 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

View File

@ -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

View File

@ -170,7 +170,6 @@ END
STRINGTABLE DISCARDABLE
BEGIN
IDS_WINE_VERSION "CVS"
IDS_TAB_GENERAL "Général"
IDS_TAB_DLLS "Bibliothèques"
IDS_TAB_DRIVES "Lecteurs"
IDS_CHOOSE_PATH "Veuillez sélectionner le répertoire unix à assigner."

View File

@ -172,7 +172,6 @@ END
STRINGTABLE DISCARDABLE
BEGIN
IDS_WINE_VERSION "CVS"
IDS_TAB_GENERAL "S”Ê"
IDS_TAB_DLLS "ライブラリ"
IDS_TAB_DRIVES "ドライブ"
IDS_CHOOSE_PATH "マッピングするUnixディレクトリーを選んでください"

View File

@ -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."

View File

@ -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 êàòàëîã äëÿ äèñêà."

View File

@ -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);
}
/******************************************************************************

View File

@ -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