ReactOS 0.4.15-dev-8100-g1887773
numbers.c File Reference
#include "intl.h"
Include dependency graph for numbers.c:

Go to the source code of this file.

Macros

#define SAMPLE_NUMBER   L"123456789"
 
#define SAMPLE_NEG_NUMBER   L"-123456789"
 
#define MAX_NUM_SEP_SAMPLES   2
 
#define MAX_FRAC_NUM_SAMPLES   10
 
#define MAX_FIELD_SEP_SAMPLES   1
 
#define MAX_FIELD_DIG_SAMPLES   3
 
#define MAX_NEG_SIGN_SAMPLES   1
 
#define MAX_NEG_NUMBERS_SAMPLES   5
 
#define MAX_LEAD_ZEROES_SAMPLES   2
 
#define MAX_LIST_SEP_SAMPLES   1
 
#define MAX_UNITS_SYS_SAMPLES   2
 

Functions

static VOID InitNumDecimalSepCB (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID InitNumOfFracSymbCB (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID InitNumFieldSepCB (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID InitFieldDigNumCB (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID InitNegSignCB (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID InitNegNumFmtCB (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID InitLeadingZeroesCB (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID InitListSepCB (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID InitUnitsSysCB (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID UpdateNumSamples (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static BOOL GetNumberSetting (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
INT_PTR CALLBACK NumbersPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Variables

static PWSTR lpNumSepSamples [MAX_NUM_SEP_SAMPLES]
 
static PWSTR lpFieldSepSamples [MAX_FIELD_SEP_SAMPLES]
 
static PWSTR lpFieldDigNumSamples [MAX_FIELD_DIG_SAMPLES]
 
static PWSTR lpNegSignSamples [MAX_NEG_SIGN_SAMPLES]
 
static PWSTR lpNegNumFmtSamples [MAX_NEG_NUMBERS_SAMPLES]
 
static PWSTR lpLeadNumFmtSamples [MAX_LEAD_ZEROES_SAMPLES]
 
static PWSTR lpListSepSamples [MAX_LIST_SEP_SAMPLES]
 

Macro Definition Documentation

◆ MAX_FIELD_DIG_SAMPLES

#define MAX_FIELD_DIG_SAMPLES   3

Definition at line 34 of file numbers.c.

◆ MAX_FIELD_SEP_SAMPLES

#define MAX_FIELD_SEP_SAMPLES   1

Definition at line 33 of file numbers.c.

◆ MAX_FRAC_NUM_SAMPLES

#define MAX_FRAC_NUM_SAMPLES   10

Definition at line 32 of file numbers.c.

◆ MAX_LEAD_ZEROES_SAMPLES

#define MAX_LEAD_ZEROES_SAMPLES   2

Definition at line 37 of file numbers.c.

◆ MAX_LIST_SEP_SAMPLES

#define MAX_LIST_SEP_SAMPLES   1

Definition at line 38 of file numbers.c.

◆ MAX_NEG_NUMBERS_SAMPLES

#define MAX_NEG_NUMBERS_SAMPLES   5

Definition at line 36 of file numbers.c.

◆ MAX_NEG_SIGN_SAMPLES

#define MAX_NEG_SIGN_SAMPLES   1

Definition at line 35 of file numbers.c.

◆ MAX_NUM_SEP_SAMPLES

#define MAX_NUM_SEP_SAMPLES   2

Definition at line 31 of file numbers.c.

◆ MAX_UNITS_SYS_SAMPLES

#define MAX_UNITS_SYS_SAMPLES   2

Definition at line 39 of file numbers.c.

◆ SAMPLE_NEG_NUMBER

#define SAMPLE_NEG_NUMBER   L"-123456789"

Definition at line 30 of file numbers.c.

◆ SAMPLE_NUMBER

#define SAMPLE_NUMBER   L"123456789"

Definition at line 29 of file numbers.c.

Function Documentation

◆ GetNumberSetting()

static BOOL GetNumberSetting ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 474 of file numbers.c.

477{
478 WCHAR szNumDecimalSep[MAX_NUMDECIMALSEP];
479 WCHAR szNumThousandSep[MAX_NUMTHOUSANDSEP];
480 WCHAR szNumNegativeSign[MAX_NUMNEGATIVESIGN];
481 WCHAR szNumListSep[MAX_NUMLISTSEP];
482 INT nNumDigits;
483 INT nNumGrouping;
484 INT nNumNegFormat;
485 INT nNumLeadingZero;
486 INT nNumMeasure;
487
488 /* Decimal symbol */
491 szNumDecimalSep,
493
494 if (szNumDecimalSep[0] == L'\0')
495 {
496 /* TODO: Show error message */
497
498 return FALSE;
499 }
500
501 /* Number of digits after decimal */
504 &nNumDigits);
505
506 /* Digit grouping symbol */
509 szNumThousandSep,
511
512 if (szNumThousandSep[0] == L'\0')
513 {
514 /* TODO: Show error message */
515
516 return FALSE;
517 }
518
519 /* Digit grouping */
522 &nNumGrouping);
523
524 /* Negative sign symbol */
527 szNumNegativeSign,
529
530 if (szNumNegativeSign[0] == L'\0')
531 {
532 /* TODO: Show error message */
533
534 return FALSE;
535 }
536
537 /* Negative number format */
540 &nNumNegFormat);
541
542 /* Display leading zeros */
545 &nNumLeadingZero);
546
547 /* List separator */
550 szNumListSep,
552
553 if (szNumListSep[0] == L'\0')
554 {
555 /* TODO: Show error message */
556
557 return FALSE;
558 }
559
560 /* Measurement system */
563 &nNumMeasure);
564
565 /* Store settings in global data */
566 wcscpy(pGlobalData->szNumDecimalSep, szNumDecimalSep);
567 wcscpy(pGlobalData->szNumThousandSep, szNumThousandSep);
568 wcscpy(pGlobalData->szNumNegativeSign, szNumNegativeSign);
569 wcscpy(pGlobalData->szNumListSep, szNumListSep);
570 pGlobalData->nNumGrouping = nNumGrouping;
571 pGlobalData->nNumDigits = nNumDigits;
572 pGlobalData->nNumNegFormat = nNumNegFormat;
573 pGlobalData->nNumLeadingZero = nNumLeadingZero;
574 pGlobalData->nNumMeasure = nNumMeasure;
575
576 return TRUE;
577}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDC_NUMBERDSYMBOL
Definition: resource.h:36
#define IDC_NUMBERSNDIGDEC
Definition: resource.h:37
#define IDC_NUMBERSLSEP
Definition: resource.h:43
#define IDC_NUMBERSDIGITGRSYM
Definition: resource.h:38
#define IDC_NUMBERSMEASSYS
Definition: resource.h:44
#define IDC_NUMBERSNSIGNSYM
Definition: resource.h:40
#define IDC_NUMBERSNNUMFORMAT
Definition: resource.h:41
#define IDC_NUMBERSDISPLEADZER
Definition: resource.h:42
#define IDC_NUMBERSDGROUPING
Definition: resource.h:39
VOID GetSelectedComboBoxText(HWND hwndDlg, INT nIdDlgItem, PWSTR Buffer, UINT uSize)
Definition: misc.c:176
#define MAX_NUMNEGATIVESIGN
Definition: intl.h:28
#define MAX_NUMDECIMALSEP
Definition: intl.h:26
VOID GetSelectedComboBoxIndex(HWND hwndDlg, INT nIdDlgItem, PINT pValue)
Definition: misc.c:223
#define MAX_NUMLISTSEP
Definition: intl.h:30
#define MAX_NUMTHOUSANDSEP
Definition: intl.h:27
#define L(x)
Definition: ntvdm.h:50
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
INT nNumGrouping
Definition: intl.h:76
WCHAR szNumListSep[MAX_NUMLISTSEP]
Definition: intl.h:72
INT nNumNegFormat
Definition: intl.h:73
INT nNumDigits
Definition: intl.h:74
WCHAR szNumDecimalSep[MAX_NUMDECIMALSEP]
Definition: intl.h:69
INT nNumLeadingZero
Definition: intl.h:75
WCHAR szNumNegativeSign[MAX_NUMNEGATIVESIGN]
Definition: intl.h:71
INT nNumMeasure
Definition: intl.h:77
WCHAR szNumThousandSep[MAX_NUMTHOUSANDSEP]
Definition: intl.h:70
int32_t INT
Definition: typedefs.h:58
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by NumbersPageProc().

◆ InitFieldDigNumCB()

static VOID InitFieldDigNumCB ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 187 of file numbers.c.

188{
189 PWSTR pszFieldDigNumSmpl;
190 INT nCBIndex;
191
192 /* Clear all box content */
195 (WPARAM)0,
196 (LPARAM)0);
197
198 /* Create standard list of field digits num */
199 for (nCBIndex = 0; nCBIndex < MAX_FIELD_DIG_SAMPLES; nCBIndex++)
200 {
201 pszFieldDigNumSmpl = InsSpacesFmt(SAMPLE_NUMBER, lpFieldDigNumSamples[nCBIndex]);
202 if (pszFieldDigNumSmpl != NULL)
203 {
206 0,
207 (LPARAM)pszFieldDigNumSmpl);
208 HeapFree(GetProcessHeap(), 0, pszFieldDigNumSmpl);
209 }
210 }
211
214 (WPARAM)pGlobalData->nNumGrouping,
215 (LPARAM)0);
216}
#define MAX_FIELD_DIG_SAMPLES
Definition: numbers.c:34
#define SAMPLE_NUMBER
Definition: numbers.c:29
static PWSTR lpFieldDigNumSamples[MAX_FIELD_DIG_SAMPLES]
Definition: numbers.c:45
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
PWSTR InsSpacesFmt(PCWSTR szSourceStr, PCWSTR szFmtStr)
Definition: misc.c:39
uint16_t * PWSTR
Definition: typedefs.h:56
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define CB_SETCURSEL
Definition: winuser.h:1961
#define CB_RESETCONTENT
Definition: winuser.h:1959
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CB_ADDSTRING
Definition: winuser.h:1936

Referenced by NumbersPageProc().

◆ InitLeadingZeroesCB()

static VOID InitLeadingZeroesCB ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 315 of file numbers.c.

316{
317 PWSTR pszResultStr;
318 INT nCBIndex;
319
320 /* Clear all box content */
323 (WPARAM)0,
324 (LPARAM)0);
325
326 /* Create list of standard leading zeroes formats */
327 for (nCBIndex = 0; nCBIndex < MAX_LEAD_ZEROES_SAMPLES; nCBIndex++)
328 {
329 pszResultStr = ReplaceSubStr(lpLeadNumFmtSamples[nCBIndex],
330 pGlobalData->szNumDecimalSep,
331 L",");
332 if (pszResultStr != NULL)
333 {
336 0,
337 (LPARAM)pszResultStr);
338 HeapFree(GetProcessHeap(), 0, pszResultStr);
339 }
340 }
341
342 /* Set current item to value from registry */
345 (WPARAM)pGlobalData->nNumLeadingZero,
346 (LPARAM)0);
347}
#define MAX_LEAD_ZEROES_SAMPLES
Definition: numbers.c:37
static PWSTR lpLeadNumFmtSamples[MAX_LEAD_ZEROES_SAMPLES]
Definition: numbers.c:51
PWSTR ReplaceSubStr(PCWSTR szSourceStr, PCWSTR szStrToReplace, PCWSTR szTempl)
Definition: misc.c:118
#define SendDlgItemMessage
Definition: winuser.h:5842

Referenced by NumbersPageProc().

◆ InitListSepCB()

static VOID InitListSepCB ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 350 of file numbers.c.

352{
353 INT nCBIndex;
354 INT nRetCode;
355
356 /* Limit text length */
359 MAX_NUMLISTSEP - 1,
360 0);
361
362 /* Clear all box content */
365 (WPARAM)0,
366 (LPARAM)0);
367
368 /* Create standard list of signs */
369 for (nCBIndex = 0; nCBIndex < MAX_LIST_SEP_SAMPLES; nCBIndex++)
370 {
373 0,
374 (LPARAM)lpListSepSamples[nCBIndex]);
375 }
376
377 /* Set current item to value from registry */
378 nRetCode = SendDlgItemMessageW(hwndDlg, IDC_NUMBERSLSEP,
380 -1,
381 (LPARAM)pGlobalData->szNumListSep);
382
383 /* If it is not successful, add new values to list and select them */
384 if (nRetCode == CB_ERR)
385 {
388 0,
389 (LPARAM)pGlobalData->szNumListSep);
392 -1,
393 (LPARAM)pGlobalData->szNumListSep);
394 }
395}
#define MAX_LIST_SEP_SAMPLES
Definition: numbers.c:38
static PWSTR lpListSepSamples[MAX_LIST_SEP_SAMPLES]
Definition: numbers.c:53
#define CB_SELECTSTRING
Definition: winuser.h:1960
#define CB_ERR
Definition: winuser.h:2435
#define CB_LIMITTEXT
Definition: winuser.h:1958

Referenced by NumbersPageProc().

◆ InitNegNumFmtCB()

static VOID InitNegNumFmtCB ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 268 of file numbers.c.

269{
270 PWSTR pszString1, pszString2;
271 INT nCBIndex;
272
273 /* Clear all box content */
276 (WPARAM)0,
277 (LPARAM)0);
278
279 /* Create standard list of negative numbers formats */
280 for (nCBIndex = 0; nCBIndex < MAX_NEG_NUMBERS_SAMPLES; nCBIndex++)
281 {
282 /* Replace standard separator to setted */
283 pszString1 = ReplaceSubStr(lpNegNumFmtSamples[nCBIndex],
284 pGlobalData->szNumDecimalSep,
285 L",");
286 if (pszString1 != NULL)
287 {
288 /* Replace standard negative sign to setted */
289 pszString2 = ReplaceSubStr(pszString1,
290 pGlobalData->szNumNegativeSign,
291 L"-");
292 if (pszString2 != NULL)
293 {
296 0,
297 (LPARAM)pszString2);
298
299 HeapFree(GetProcessHeap(), 0, pszString2);
300 }
301
302 HeapFree(GetProcessHeap(), 0, pszString1);
303 }
304 }
305
306 /* Set current item to value from registry */
309 (WPARAM)pGlobalData->nNumNegFormat,
310 (LPARAM)0);
311}
static PWSTR lpNegNumFmtSamples[MAX_NEG_NUMBERS_SAMPLES]
Definition: numbers.c:49
#define MAX_NEG_NUMBERS_SAMPLES
Definition: numbers.c:36

Referenced by NumbersPageProc().

◆ InitNegSignCB()

static VOID InitNegSignCB ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 220 of file numbers.c.

221{
222 INT nCBIndex;
223 INT nRetCode;
224
225 /* Limit text length */
229 0);
230
231 /* Clear all box content */
234 (WPARAM)0,
235 (LPARAM)0);
236
237 /* Create standard list of signs */
238 for (nCBIndex = 0; nCBIndex < MAX_NEG_SIGN_SAMPLES; nCBIndex++)
239 {
242 0,
243 (LPARAM)lpNegSignSamples[nCBIndex]);
244 }
245
246 /* Set current item to value from registry */
247 nRetCode = SendDlgItemMessageW(hwndDlg, IDC_NUMBERSNSIGNSYM,
249 -1,
250 (LPARAM)pGlobalData->szNumNegativeSign);
251
252 /* If it is not successful, add new values to list and select them */
253 if (nRetCode == CB_ERR)
254 {
257 0,
258 (LPARAM)pGlobalData->szNumNegativeSign);
261 -1,
262 (LPARAM)pGlobalData->szNumNegativeSign);
263 }
264}
#define MAX_NEG_SIGN_SAMPLES
Definition: numbers.c:35
static PWSTR lpNegSignSamples[MAX_NEG_SIGN_SAMPLES]
Definition: numbers.c:47

Referenced by NumbersPageProc().

◆ InitNumDecimalSepCB()

static VOID InitNumDecimalSepCB ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 59 of file numbers.c.

60{
61 INT nCBIndex;
62 INT nRetCode;
63
64 /* Limit text length */
68 0);
69
70 /* Clear all box content */
73 (WPARAM)0,
74 (LPARAM)0);
75
76 /* Create standard list of decimal separators */
77 for (nCBIndex = 0; nCBIndex < MAX_NUM_SEP_SAMPLES; nCBIndex++)
78 {
81 0,
82 (LPARAM)lpNumSepSamples[nCBIndex]);
83 }
84
85 /* Set current item to value from registry */
86 nRetCode = SendDlgItemMessageW(hwndDlg, IDC_NUMBERDSYMBOL,
88 -1,
89 (LPARAM)pGlobalData->szNumDecimalSep);
90
91 /* If it is not successful, add new values to list and select them */
92 if (nRetCode == CB_ERR)
93 {
97 (LPARAM)pGlobalData->szNumDecimalSep);
100 -1,
101 (LPARAM)pGlobalData->szNumDecimalSep);
102 }
103}
#define MAX_NUM_SEP_SAMPLES
Definition: numbers.c:31
static PWSTR lpNumSepSamples[MAX_NUM_SEP_SAMPLES]
Definition: numbers.c:41

Referenced by NumbersPageProc().

◆ InitNumFieldSepCB()

static VOID InitNumFieldSepCB ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 139 of file numbers.c.

140{
141 INT nCBIndex;
142 INT nRetCode;
143
144 /* Limit text length */
148 0);
149
150 /* Clear all box content */
153 (WPARAM)0,
154 (LPARAM)0);
155
156 /* Create standard list of field separators */
157 for (nCBIndex = 0; nCBIndex < MAX_FIELD_SEP_SAMPLES; nCBIndex++)
158 {
161 0,
162 (LPARAM)lpFieldSepSamples[nCBIndex]);
163 }
164
165 /* Set current item to value from registry */
166 nRetCode = SendDlgItemMessageW(hwndDlg, IDC_NUMBERSDIGITGRSYM,
168 -1,
169 (LPARAM)pGlobalData->szNumThousandSep);
170
171 /* If it is not success, add new values to list and select them */
172 if (nRetCode == CB_ERR)
173 {
176 0,
177 (LPARAM)pGlobalData->szNumThousandSep);
180 -1,
181 (LPARAM)pGlobalData->szNumThousandSep);
182 }
183}
static PWSTR lpFieldSepSamples[MAX_FIELD_SEP_SAMPLES]
Definition: numbers.c:43
#define MAX_FIELD_SEP_SAMPLES
Definition: numbers.c:33

Referenced by NumbersPageProc().

◆ InitNumOfFracSymbCB()

static VOID InitNumOfFracSymbCB ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 107 of file numbers.c.

108{
109 WCHAR szFracCount[MAX_SAMPLES_STR_SIZE];
110 INT nCBIndex;
111
112 /* Clear all box content */
115 (WPARAM)0,
116 (LPARAM)0);
117
118 /* Create standard list of fractional symbols */
119 for (nCBIndex = 0; nCBIndex < MAX_FRAC_NUM_SAMPLES; nCBIndex++)
120 {
121 /* Convert to wide char */
122 _itow(nCBIndex, szFracCount, DECIMAL_RADIX);
123
126 0,
127 (LPARAM)szFracCount);
128 }
129
130 /* Set current item to value from registry */
133 (WPARAM)pGlobalData->nNumDigits,
134 (LPARAM)0);
135}
#define MAX_FRAC_NUM_SAMPLES
Definition: numbers.c:32
_CRTIMP wchar_t *__cdecl _itow(_In_ int _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
#define DECIMAL_RADIX
Definition: intl.h:19
#define MAX_SAMPLES_STR_SIZE
Definition: intl.h:24

Referenced by NumbersPageProc().

◆ InitUnitsSysCB()

static VOID InitUnitsSysCB ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 399 of file numbers.c.

401{
402 WCHAR szUnitName[128];
403 INT nCBIndex;
404
405 /* Clear all box content */
408 (WPARAM)0,
409 (LPARAM)0);
410
411 /* Create list of standard system of units */
412 for (nCBIndex = 0; nCBIndex < MAX_UNITS_SYS_SAMPLES; nCBIndex++)
413 {
414 LoadStringW(hApplet, IDS_METRIC + nCBIndex, szUnitName, 128);
415
418 0,
419 (LPARAM)szUnitName);
420 }
421
422 /* Set current item to value from registry */
425 (WPARAM)pGlobalData->nNumMeasure,
426 (LPARAM)0);
427}
#define MAX_UNITS_SYS_SAMPLES
Definition: numbers.c:39
HINSTANCE hApplet
Definition: access.c:17
#define IDS_METRIC
Definition: resource.h:77
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)

Referenced by NumbersPageProc().

◆ NumbersPageProc()

INT_PTR CALLBACK NumbersPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 581 of file numbers.c.

585{
586 PGLOBALDATA pGlobalData;
587
588 pGlobalData = (PGLOBALDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
589
590 switch (uMsg)
591 {
592 case WM_INITDIALOG:
593 pGlobalData = (PGLOBALDATA)((LPPROPSHEETPAGE)lParam)->lParam;
594 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
595
596 InitNumDecimalSepCB(hwndDlg, pGlobalData);
597 InitNumOfFracSymbCB(hwndDlg, pGlobalData);
598 InitNumFieldSepCB(hwndDlg, pGlobalData);
599 InitFieldDigNumCB(hwndDlg, pGlobalData);
600 InitNegSignCB(hwndDlg, pGlobalData);
601 InitNegNumFmtCB(hwndDlg, pGlobalData);
602 InitLeadingZeroesCB(hwndDlg, pGlobalData);
603 InitListSepCB(hwndDlg, pGlobalData);
604 InitUnitsSysCB(hwndDlg, pGlobalData);
605 UpdateNumSamples(hwndDlg, pGlobalData);
606 break;
607
608 case WM_COMMAND:
609 switch (LOWORD(wParam))
610 {
618 case IDC_NUMBERSLSEP:
621 {
622 /* Enable the Apply button */
623 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
624 }
625 }
626 break;
627
628 case WM_NOTIFY:
629 if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
630 {
631 if (GetNumberSetting(hwndDlg, pGlobalData))
632 {
633 pGlobalData->bUserLocaleChanged = TRUE;
634 UpdateNumSamples(hwndDlg, pGlobalData);
635 }
636 }
637 break;
638 }
639 return FALSE;
640}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static VOID InitNumDecimalSepCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:59
static VOID InitUnitsSysCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:399
static VOID UpdateNumSamples(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:431
static VOID InitNumOfFracSymbCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:107
static VOID InitFieldDigNumCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:187
static VOID InitNegNumFmtCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:268
static VOID InitNumFieldSepCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:139
static BOOL GetNumberSetting(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:474
static VOID InitLeadingZeroesCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:315
static VOID InitNegSignCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:220
static VOID InitListSepCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:350
struct _GLOBALDATA * PGLOBALDATA
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_APPLY
Definition: prsht.h:117
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define WM_NOTIFY
Definition: richedit.h:61
BOOL bUserLocaleChanged
Definition: intl.h:115
Definition: inflate.c:139
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define HIWORD(l)
Definition: typedefs.h:247
#define DWLP_USER
Definition: winuser.h:872
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
#define CBN_SELCHANGE
Definition: winuser.h:1979
HWND WINAPI GetParent(_In_ HWND)
#define CBN_EDITCHANGE
Definition: winuser.h:1975

Referenced by CustomizeLocalePropertySheet().

◆ UpdateNumSamples()

static VOID UpdateNumSamples ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 431 of file numbers.c.

433{
435 NUMBERFMT NumberFormat;
436
437 NumberFormat.NumDigits = pGlobalData->nNumDigits;
438 NumberFormat.LeadingZero = pGlobalData->nNumLeadingZero;
439 NumberFormat.Grouping = GroupingFormats[pGlobalData->nNumGrouping].nInteger;
440 NumberFormat.lpDecimalSep = pGlobalData->szNumDecimalSep;
441 NumberFormat.lpThousandSep = pGlobalData->szNumThousandSep;
442 NumberFormat.NegativeOrder = pGlobalData->nNumNegFormat;
443
444 /* Get positive number format sample */
445 GetNumberFormatW(pGlobalData->UserLCID,
446 0,
448 &NumberFormat,
449 OutBuffer,
451
454 0,
456
457 /* Get positive number format sample */
458 GetNumberFormatW(pGlobalData->UserLCID,
459 0,
461 &NumberFormat,
462 OutBuffer,
464
467 0,
469}
#define SAMPLE_NEG_NUMBER
Definition: numbers.c:30
#define IDC_NUMBERSPOSSAMPLE
Definition: resource.h:34
#define IDC_NUMBERSNEGSAMPLE
Definition: resource.h:35
GROUPINGDATA GroupingFormats[MAX_GROUPINGFORMATS]
Definition: generalp.c:44
#define MAX_FMT_SIZE
Definition: intl.h:22
INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags, LPCWSTR lpszValue, const NUMBERFMTW *lpFormat, LPWSTR lpNumberStr, int cchOut)
Definition: lcformat.c:1212
_In_ UCHAR _In_ ULONG _Out_ PUCHAR _Outptr_result_bytebuffer_ OutBufferLength PVOID * OutBuffer
Definition: scsi.h:4071
UINT nInteger
Definition: intl.h:127
LCID UserLCID
Definition: intl.h:113
UINT LeadingZero
Definition: winnls.h:635
UINT NegativeOrder
Definition: winnls.h:639
LPSTR lpDecimalSep
Definition: winnls.h:637
LPSTR lpThousandSep
Definition: winnls.h:638
UINT Grouping
Definition: winnls.h:636
UINT NumDigits
Definition: winnls.h:634
#define WM_SETTEXT
Definition: winuser.h:1617

Referenced by NumbersPageProc().

Variable Documentation

◆ lpFieldDigNumSamples

PWSTR lpFieldDigNumSamples[MAX_FIELD_DIG_SAMPLES]
static
Initial value:
=
{L"0;0", L"3;0", L"3;2;0"}

Definition at line 45 of file numbers.c.

Referenced by InitFieldDigNumCB().

◆ lpFieldSepSamples

PWSTR lpFieldSepSamples[MAX_FIELD_SEP_SAMPLES]
static
Initial value:
=
{L" "}

Definition at line 43 of file numbers.c.

Referenced by InitNumFieldSepCB().

◆ lpLeadNumFmtSamples

PWSTR lpLeadNumFmtSamples[MAX_LEAD_ZEROES_SAMPLES]
static
Initial value:
=
{L",7", L"0,7"}

Definition at line 51 of file numbers.c.

Referenced by InitLeadingZeroesCB().

◆ lpListSepSamples

PWSTR lpListSepSamples[MAX_LIST_SEP_SAMPLES]
static
Initial value:
=
{L";"}

Definition at line 53 of file numbers.c.

Referenced by InitListSepCB().

◆ lpNegNumFmtSamples

PWSTR lpNegNumFmtSamples[MAX_NEG_NUMBERS_SAMPLES]
static
Initial value:
=
{L"(1,1)", L"-1,1", L"- 1,1", L"1,1-", L"1,1 -"}

Definition at line 49 of file numbers.c.

Referenced by InitNegNumFmtCB().

◆ lpNegSignSamples

PWSTR lpNegSignSamples[MAX_NEG_SIGN_SAMPLES]
static
Initial value:
=
{L"-"}

Definition at line 47 of file numbers.c.

Referenced by InitNegSignCB().

◆ lpNumSepSamples

PWSTR lpNumSepSamples[MAX_NUM_SEP_SAMPLES]
static
Initial value:
=
{L",", L"."}

Definition at line 41 of file numbers.c.

Referenced by InitNumDecimalSepCB().