mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[INTL]
Update number and currency examples according to the current settings. CORE-10074 #resolve svn path=/trunk/; revision=69501
This commit is contained in:
parent
5e05f2675b
commit
bc538be477
4 changed files with 74 additions and 50 deletions
|
@ -33,18 +33,28 @@ static VOID
|
|||
UpdateExamples(HWND hwndDlg, PGLOBALDATA pGlobalData)
|
||||
{
|
||||
WCHAR szBuffer[MAX_FMT_SIZE];
|
||||
CURRENCYFMTW CurrencyFormat;
|
||||
|
||||
CurrencyFormat.NumDigits = pGlobalData->nCurrDigits;
|
||||
CurrencyFormat.LeadingZero = pGlobalData->nNumLeadingZero;
|
||||
CurrencyFormat.Grouping = GroupingFormats[pGlobalData->nCurrGrouping].nInteger;
|
||||
CurrencyFormat.lpDecimalSep = pGlobalData->szCurrDecimalSep;
|
||||
CurrencyFormat.lpThousandSep = pGlobalData->szCurrThousandSep;
|
||||
CurrencyFormat.NegativeOrder = pGlobalData->nCurrNegFormat;
|
||||
CurrencyFormat.PositiveOrder = pGlobalData->nCurrPosFormat;
|
||||
CurrencyFormat.lpCurrencySymbol = pGlobalData->szCurrSymbol;
|
||||
|
||||
/* Positive example */
|
||||
GetCurrencyFormatW(pGlobalData->UserLCID, 0,
|
||||
POSITIVE_EXAMPLE,
|
||||
NULL, szBuffer, MAX_FMT_SIZE);
|
||||
&CurrencyFormat, szBuffer, MAX_FMT_SIZE);
|
||||
|
||||
SendDlgItemMessageW(hwndDlg, IDC_CURRENCYPOSSAMPLE, WM_SETTEXT, 0, (LPARAM)szBuffer);
|
||||
|
||||
/* Negative example */
|
||||
GetCurrencyFormatW(pGlobalData->UserLCID, 0,
|
||||
NEGATIVE_EXAMPLE,
|
||||
NULL, szBuffer, MAX_FMT_SIZE);
|
||||
&CurrencyFormat, szBuffer, MAX_FMT_SIZE);
|
||||
|
||||
SendDlgItemMessageW(hwndDlg, IDC_CURRENCYNEGSAMPLE, WM_SETTEXT, 0, (LPARAM)szBuffer);
|
||||
}
|
||||
|
@ -219,6 +229,7 @@ InitDigitGroupCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
|
|||
{
|
||||
WCHAR szBuffer[MAX_FMT_SIZE];
|
||||
CURRENCYFMTW cyFmt;
|
||||
INT i;
|
||||
|
||||
/* Digit grouping */
|
||||
cyFmt.NumDigits = 0;
|
||||
|
@ -228,37 +239,19 @@ InitDigitGroupCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
|
|||
cyFmt.PositiveOrder = 0;
|
||||
cyFmt.NegativeOrder = 0;
|
||||
cyFmt.lpCurrencySymbol = L"";
|
||||
cyFmt.Grouping = 0;
|
||||
GetCurrencyFormatW(pGlobalData->UserLCID, 0,
|
||||
L"123456789",
|
||||
&cyFmt, szBuffer, MAX_FMT_SIZE);
|
||||
SendDlgItemMessageW(hwndDlg, IDC_CURRENCYGRPNUM,
|
||||
CB_INSERTSTRING,
|
||||
-1,
|
||||
(LPARAM)szBuffer);
|
||||
|
||||
cyFmt.Grouping = 3;
|
||||
GetCurrencyFormatW(pGlobalData->UserLCID, 0,
|
||||
L"123456789",
|
||||
&cyFmt, szBuffer, MAX_FMT_SIZE);
|
||||
SendDlgItemMessageW(hwndDlg, IDC_CURRENCYGRPNUM,
|
||||
CB_INSERTSTRING,
|
||||
-1,
|
||||
(LPARAM)szBuffer);
|
||||
for (i = 0 ; i < MAX_GROUPINGFORMATS ; i++)
|
||||
{
|
||||
cyFmt.Grouping = GroupingFormats[i].nInteger;
|
||||
|
||||
cyFmt.Grouping = 32;
|
||||
GetCurrencyFormatW(pGlobalData->UserLCID, 0,
|
||||
L"123456789",
|
||||
&cyFmt, szBuffer, MAX_FMT_SIZE);
|
||||
SendDlgItemMessageW(hwndDlg, IDC_CURRENCYGRPNUM,
|
||||
CB_INSERTSTRING,
|
||||
-1,
|
||||
(LPARAM)szBuffer);
|
||||
|
||||
SendDlgItemMessageW(hwndDlg, IDC_CURRENCYGRPNUM,
|
||||
CB_SETCURSEL,
|
||||
pGlobalData->nCurrGrouping, /* Index */
|
||||
0);
|
||||
GetCurrencyFormatW(pGlobalData->UserLCID, 0,
|
||||
L"123456789",
|
||||
&cyFmt, szBuffer, MAX_FMT_SIZE);
|
||||
SendDlgItemMessageW(hwndDlg, IDC_CURRENCYGRPNUM,
|
||||
CB_INSERTSTRING,
|
||||
-1,
|
||||
(LPARAM)szBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -30,28 +30,22 @@
|
|||
#include <debug.h>
|
||||
|
||||
#define SAMPLE_NUMBER L"123456789"
|
||||
#define NO_FLAG 0
|
||||
|
||||
#define NUM_SHEETS 4
|
||||
|
||||
#define MAX_FIELD_DIG_SAMPLES 3
|
||||
|
||||
typedef struct
|
||||
{
|
||||
LCTYPE lcType;
|
||||
PWSTR pKeyName;
|
||||
} LOCALE_KEY_DATA, *PLOCALE_KEY_DATA;
|
||||
|
||||
HWND hList;
|
||||
HWND hLocaleList, hGeoList;
|
||||
BOOL bSpain = FALSE;
|
||||
|
||||
|
||||
PWSTR szCurrencyGrouping[3] =
|
||||
GROUPINGDATA
|
||||
GroupingFormats[MAX_GROUPINGFORMATS] =
|
||||
{
|
||||
L"0;0",
|
||||
L"3;0",
|
||||
L"3;2;0"
|
||||
{0, L"0;0"},
|
||||
{3, L"3;0"},
|
||||
{32, L"3;2;0"}
|
||||
};
|
||||
|
||||
static BOOL CALLBACK
|
||||
|
@ -111,16 +105,36 @@ UpdateLocaleSample(
|
|||
PGLOBALDATA pGlobalData)
|
||||
{
|
||||
WCHAR OutBuffer[MAX_SAMPLES_STR_SIZE];
|
||||
NUMBERFMT NumberFormat;
|
||||
CURRENCYFMTW CurrencyFormat;
|
||||
|
||||
NumberFormat.NumDigits = pGlobalData->nNumDigits;
|
||||
NumberFormat.LeadingZero = pGlobalData->nNumLeadingZero;
|
||||
NumberFormat.Grouping = GroupingFormats[pGlobalData->nNumGrouping].nInteger;
|
||||
NumberFormat.lpDecimalSep = pGlobalData->szNumDecimalSep;
|
||||
NumberFormat.lpThousandSep = pGlobalData->szNumThousandSep;
|
||||
NumberFormat.NegativeOrder = pGlobalData->nNumNegFormat;
|
||||
|
||||
CurrencyFormat.NumDigits = pGlobalData->nCurrDigits;
|
||||
CurrencyFormat.LeadingZero = pGlobalData->nNumLeadingZero;
|
||||
CurrencyFormat.Grouping = GroupingFormats[pGlobalData->nCurrGrouping].nInteger;
|
||||
CurrencyFormat.lpDecimalSep = pGlobalData->szCurrDecimalSep;
|
||||
CurrencyFormat.lpThousandSep = pGlobalData->szCurrThousandSep;
|
||||
CurrencyFormat.NegativeOrder = pGlobalData->nCurrNegFormat;
|
||||
CurrencyFormat.PositiveOrder = pGlobalData->nCurrPosFormat;
|
||||
CurrencyFormat.lpCurrencySymbol = pGlobalData->szCurrSymbol;
|
||||
|
||||
/* Get number format sample */
|
||||
GetNumberFormatW(pGlobalData->UserLCID, NO_FLAG, SAMPLE_NUMBER, NULL,
|
||||
GetNumberFormatW(pGlobalData->UserLCID, 0, SAMPLE_NUMBER,
|
||||
&NumberFormat,
|
||||
OutBuffer, MAX_SAMPLES_STR_SIZE);
|
||||
SendDlgItemMessageW(hwndDlg, IDC_NUMSAMPLE_EDIT,
|
||||
WM_SETTEXT, 0, (LPARAM)OutBuffer);
|
||||
ZeroMemory(OutBuffer, MAX_SAMPLES_STR_SIZE * sizeof(WCHAR));
|
||||
|
||||
/* Get monetary format sample */
|
||||
GetCurrencyFormatW(pGlobalData->UserLCID, NO_FLAG, SAMPLE_NUMBER, NULL,
|
||||
GetCurrencyFormatW(pGlobalData->UserLCID, 0, SAMPLE_NUMBER,
|
||||
&CurrencyFormat,
|
||||
OutBuffer, MAX_SAMPLES_STR_SIZE);
|
||||
SendDlgItemMessageW(hwndDlg, IDC_MONEYSAMPLE_EDIT,
|
||||
WM_SETTEXT, 0, (LPARAM)OutBuffer);
|
||||
|
@ -833,8 +847,8 @@ SaveUserLocale(
|
|||
L"sGrouping",
|
||||
0,
|
||||
REG_SZ,
|
||||
(PBYTE)szCurrencyGrouping[pGlobalData->nNumGrouping],
|
||||
(wcslen(szCurrencyGrouping[pGlobalData->nNumGrouping]) + 1) * sizeof(WCHAR));
|
||||
(PBYTE)GroupingFormats[pGlobalData->nNumGrouping].pszString,
|
||||
(wcslen(GroupingFormats[pGlobalData->nNumGrouping].pszString) + 1) * sizeof(WCHAR));
|
||||
|
||||
RegSetValueExW(hLocaleKey,
|
||||
L"sList",
|
||||
|
@ -921,8 +935,8 @@ SaveUserLocale(
|
|||
L"sMonGrouping",
|
||||
0,
|
||||
REG_SZ,
|
||||
(PBYTE)szCurrencyGrouping[pGlobalData->nCurrGrouping],
|
||||
(wcslen(szCurrencyGrouping[pGlobalData->nCurrGrouping]) + 1) * sizeof(WCHAR));
|
||||
(PBYTE)GroupingFormats[pGlobalData->nCurrGrouping].pszString,
|
||||
(wcslen(GroupingFormats[pGlobalData->nCurrGrouping].pszString) + 1) * sizeof(WCHAR));
|
||||
|
||||
_itow(pGlobalData->nCurrPosFormat,
|
||||
szBuffer, DECIMAL_RADIX);
|
||||
|
|
|
@ -49,6 +49,8 @@
|
|||
#define MAX_MISCCOUNTRY 80
|
||||
#define MAX_MISCLANGUAGE 80
|
||||
|
||||
#define MAX_GROUPINGFORMATS 3
|
||||
|
||||
|
||||
typedef struct _APPLET
|
||||
{
|
||||
|
@ -116,9 +118,16 @@ typedef struct _GLOBALDATA
|
|||
|
||||
} GLOBALDATA, *PGLOBALDATA;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT nInteger;
|
||||
PWSTR pszString;
|
||||
} GROUPINGDATA;
|
||||
|
||||
extern HINSTANCE hApplet;
|
||||
extern DWORD IsUnattendedSetupEnabled;
|
||||
extern DWORD UnattendLCID;
|
||||
extern GROUPINGDATA GroupingFormats[MAX_GROUPINGFORMATS];
|
||||
|
||||
/* intl.c */
|
||||
VOID PrintErrorMsgBox(UINT msg);
|
||||
|
|
|
@ -420,12 +420,20 @@ UpdateNumSamples(HWND hwndDlg,
|
|||
PGLOBALDATA pGlobalData)
|
||||
{
|
||||
WCHAR OutBuffer[MAX_FMT_SIZE];
|
||||
NUMBERFMT NumberFormat;
|
||||
|
||||
NumberFormat.NumDigits = pGlobalData->nNumDigits;
|
||||
NumberFormat.LeadingZero = pGlobalData->nNumLeadingZero;
|
||||
NumberFormat.Grouping = GroupingFormats[pGlobalData->nNumGrouping].nInteger;
|
||||
NumberFormat.lpDecimalSep = pGlobalData->szNumDecimalSep;
|
||||
NumberFormat.lpThousandSep = pGlobalData->szNumThousandSep;
|
||||
NumberFormat.NegativeOrder = pGlobalData->nNumNegFormat;
|
||||
|
||||
/* Get positive number format sample */
|
||||
GetNumberFormatW(pGlobalData->UserLCID,
|
||||
0,
|
||||
SAMPLE_NUMBER,
|
||||
NULL,
|
||||
&NumberFormat,
|
||||
OutBuffer,
|
||||
MAX_FMT_SIZE);
|
||||
|
||||
|
@ -438,7 +446,7 @@ UpdateNumSamples(HWND hwndDlg,
|
|||
GetNumberFormatW(pGlobalData->UserLCID,
|
||||
0,
|
||||
SAMPLE_NEG_NUMBER,
|
||||
NULL,
|
||||
&NumberFormat,
|
||||
OutBuffer,
|
||||
MAX_FMT_SIZE);
|
||||
|
||||
|
|
Loading…
Reference in a new issue