mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Use string resources instead of hardcoded strings.
svn path=/trunk/; revision=12888
This commit is contained in:
parent
742da9ba73
commit
b8e8ef8580
4 changed files with 35 additions and 5 deletions
|
@ -37,4 +37,7 @@ STRINGTABLE
|
|||
BEGIN
|
||||
IDS_CPLNAME "Datum/Zeit"
|
||||
IDS_CPLDESCRIPTION "Ändert die Uhrzeit, Datum und Zeitzone."
|
||||
IDS_TIMEZONETEXT "Aktuelle Zeitzone: %s"
|
||||
IDS_TIMEZONEINVALID "Ungültig"
|
||||
IDS_TIMEZONEUNKNOWN "Unbekannt"
|
||||
END
|
||||
|
|
|
@ -16,7 +16,7 @@ BEGIN
|
|||
CONTROL "", IDC_TIMEPICKER, "SysDateTimePick32",
|
||||
DTS_TIMEFORMAT | WS_CHILD | WS_VISIBLE | WS_TABSTOP,
|
||||
144, 17, 90, 12
|
||||
LTEXT "Current time zone: %s", IDC_TIMEZONE, 4, 136, 241, 8
|
||||
LTEXT "", IDC_TIMEZONE, 4, 136, 241, 8
|
||||
END
|
||||
|
||||
|
||||
|
@ -36,4 +36,7 @@ STRINGTABLE
|
|||
BEGIN
|
||||
IDS_CPLNAME "Date/Time"
|
||||
IDS_CPLDESCRIPTION "Changes date, time and time zone information."
|
||||
IDS_TIMEZONETEXT "Current time zone: %s"
|
||||
IDS_TIMEZONEINVALID "Invalid"
|
||||
IDS_TIMEZONEUNKNOWN "Unknown"
|
||||
END
|
||||
|
|
|
@ -15,7 +15,10 @@
|
|||
#define IDC_AUTODAYLIGHT 113
|
||||
|
||||
#define IDS_CPLNAME 1001
|
||||
#define IDS_CPLDESCRIPTION 2001
|
||||
#define IDS_CPLDESCRIPTION 1002
|
||||
#define IDS_TIMEZONETEXT 1003
|
||||
#define IDS_TIMEZONEINVALID 1004
|
||||
#define IDS_TIMEZONEUNKNOWN 1005
|
||||
|
||||
#endif /* __CPL_RESOURCE_H */
|
||||
|
||||
|
|
|
@ -102,14 +102,35 @@ SetTimeZoneName(HWND hwnd)
|
|||
{
|
||||
TIME_ZONE_INFORMATION TimeZoneInfo;
|
||||
WCHAR TimeZoneString[128];
|
||||
WCHAR TimeZoneText[128];
|
||||
WCHAR TimeZoneName[128];
|
||||
DWORD TimeZoneId;
|
||||
|
||||
TimeZoneId = GetTimeZoneInformation(&TimeZoneInfo);
|
||||
|
||||
wsprintf(TimeZoneString,
|
||||
L"Current time zone: %s\n",
|
||||
(TimeZoneId == TIME_ZONE_ID_DAYLIGHT) ? TimeZoneInfo.DaylightName : TimeZoneInfo.StandardName);
|
||||
LoadString(hApplet, IDS_TIMEZONETEXT, TimeZoneText, 128);
|
||||
|
||||
switch (TimeZoneId)
|
||||
{
|
||||
case TIME_ZONE_ID_STANDARD:
|
||||
wcscpy(TimeZoneName, TimeZoneInfo.StandardName);
|
||||
break;
|
||||
|
||||
case TIME_ZONE_ID_DAYLIGHT:
|
||||
wcscpy(TimeZoneName, TimeZoneInfo.DaylightName);
|
||||
break;
|
||||
|
||||
case TIME_ZONE_ID_UNKNOWN:
|
||||
LoadString(hApplet, IDS_TIMEZONEUNKNOWN, TimeZoneName, 128);
|
||||
break;
|
||||
|
||||
case TIME_ZONE_ID_INVALID:
|
||||
default:
|
||||
LoadString(hApplet, IDS_TIMEZONEINVALID, TimeZoneName, 128);
|
||||
break;
|
||||
}
|
||||
|
||||
wsprintf(TimeZoneString, TimeZoneText, TimeZoneName);
|
||||
SendDlgItemMessageW(hwnd, IDC_TIMEZONE, WM_SETTEXT, 0, (LPARAM)TimeZoneString);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue