ReactOS  0.4.15-dev-1397-g19779b3
currency.c File Reference
#include "intl.h"
Include dependency graph for currency.c:

Go to the source code of this file.

Macros

#define POSITIVE_EXAMPLE   L"123456789.00"
 
#define NEGATIVE_EXAMPLE   L"-123456789.00"
 

Functions

static VOID UpdateExamples (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID InitCurrencySymbols (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID InitCurrencyPositiveFormats (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID InitCurrencyNegativeFormats (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID InitCurrencyDecimalSeparators (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID InitCurrencyNumFracDigits (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID InitCurrencyGroupSeparators (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static VOID InitDigitGroupCB (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
static BOOL GetCurrencySetting (HWND hwndDlg, PGLOBALDATA pGlobalData)
 
INT_PTR CALLBACK CurrencyPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Macro Definition Documentation

◆ NEGATIVE_EXAMPLE

#define NEGATIVE_EXAMPLE   L"-123456789.00"

Definition at line 30 of file currency.c.

◆ POSITIVE_EXAMPLE

#define POSITIVE_EXAMPLE   L"123456789.00"

Definition at line 29 of file currency.c.

Function Documentation

◆ CurrencyPageProc()

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

Definition at line 351 of file currency.c.

355 {
356  PGLOBALDATA pGlobalData;
357 
358  pGlobalData = (PGLOBALDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
359 
360  switch (uMsg)
361  {
362  case WM_INITDIALOG:
363  pGlobalData = (PGLOBALDATA)((LPPROPSHEETPAGE)lParam)->lParam;
364  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
365 
366  InitCurrencySymbols(hwndDlg, pGlobalData);
367  InitCurrencyPositiveFormats(hwndDlg, pGlobalData);
368  InitCurrencyNegativeFormats(hwndDlg, pGlobalData);
369  InitCurrencyDecimalSeparators(hwndDlg, pGlobalData);
370  InitCurrencyNumFracDigits(hwndDlg, pGlobalData);
371  InitCurrencyGroupSeparators(hwndDlg, pGlobalData);
372  InitDigitGroupCB(hwndDlg, pGlobalData);
373  UpdateExamples(hwndDlg, pGlobalData);
374  break;
375 
376  case WM_COMMAND:
377  switch (LOWORD(wParam))
378  {
379  case IDC_CURRENCYSYMBOL:
382  case IDC_CURRENCYDECSEP:
383  case IDC_CURRENCYDECNUM:
384  case IDC_CURRENCYGRPSEP:
385  case IDC_CURRENCYGRPNUM:
386  if (HIWORD(wParam) == CBN_SELCHANGE ||
388  {
389  /* Enable the Apply button */
390  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
391  }
392  }
393  break;
394 
395  case WM_NOTIFY:
396  if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
397  {
398  if (GetCurrencySetting(hwndDlg, pGlobalData))
399  {
400  pGlobalData->bUserLocaleChanged = TRUE;
401  UpdateExamples(hwndDlg, pGlobalData);
402  }
403  }
404  break;
405  }
406  return FALSE;
407 }
static VOID InitCurrencyNumFracDigits(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:182
struct _GLOBALDATA * PGLOBALDATA
static VOID UpdateExamples(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:34
static VOID InitCurrencyPositiveFormats(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:87
#define TRUE
Definition: types.h:120
#define IDC_CURRENCYGRPSEP
Definition: resource.h:32
BOOL bUserLocaleChanged
Definition: intl.h:115
static VOID InitDigitGroupCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:229
#define PSN_APPLY
Definition: prsht.h:117
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define FALSE
Definition: types.h:117
static VOID InitCurrencySymbols(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:65
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define CBN_EDITCHANGE
Definition: winuser.h:1957
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define IDC_CURRENCYGRPNUM
Definition: resource.h:33
static BOOL GetCurrencySetting(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:266
#define IDC_CURRENCYNEGVALUE
Definition: resource.h:29
static VOID InitCurrencyDecimalSeparators(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:159
#define IDC_CURRENCYDECNUM
Definition: resource.h:31
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1722
Definition: inflate.c:139
#define IDC_CURRENCYSYMBOL
Definition: resource.h:27
#define IDC_CURRENCYPOSVALUE
Definition: resource.h:28
HWND WINAPI GetParent(_In_ HWND)
static VOID InitCurrencyNegativeFormats(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:123
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define IDC_CURRENCYDECSEP
Definition: resource.h:30
#define CBN_SELCHANGE
Definition: winuser.h:1961
#define HIWORD(l)
Definition: typedefs.h:247
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61
static VOID InitCurrencyGroupSeparators(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:207

Referenced by CustomizeLocalePropertySheet().

◆ GetCurrencySetting()

static BOOL GetCurrencySetting ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 266 of file currency.c.

269 {
270  WCHAR szCurrSymbol[MAX_CURRSYMBOL];
271  WCHAR szCurrDecimalSep[MAX_CURRDECIMALSEP];
272  WCHAR szCurrThousandSep[MAX_CURRTHOUSANDSEP];
273  INT nCurrPosFormat;
274  INT nCurrNegFormat;
275  INT nCurrDigits;
276  INT nCurrGrouping;
277 
278  /* Currency symbol */
279  GetSelectedComboBoxText(hwndDlg,
281  szCurrSymbol,
283 
284  if (szCurrSymbol[0] == L'\0')
285  {
286  /* TODO: Show error message */
287 
288  return FALSE;
289  }
290 
291  /* Positive Amount */
292  GetSelectedComboBoxIndex(hwndDlg,
294  &nCurrPosFormat);
295 
296  /* Negative Amount */
297  GetSelectedComboBoxIndex(hwndDlg,
299  &nCurrNegFormat);
300 
301  /* Decimal separator */
302  GetSelectedComboBoxText(hwndDlg,
304  szCurrDecimalSep,
306 
307  if (szCurrDecimalSep[0] == L'\0')
308  {
309  /* TODO: Show error message */
310 
311  return FALSE;
312  }
313 
314  /* Number of fractional digits */
315  GetSelectedComboBoxIndex(hwndDlg,
317  &nCurrDigits);
318 
319  /* Grouping symbol */
320  GetSelectedComboBoxText(hwndDlg,
322  szCurrThousandSep,
324 
325  if (szCurrThousandSep[0] == L'\0')
326  {
327  /* TODO: Show error message */
328 
329  return FALSE;
330  }
331 
332  /* Digit grouping */
333  GetSelectedComboBoxIndex(hwndDlg,
335  &nCurrGrouping);
336 
337  /* Store settings in global data */
338  wcscpy(pGlobalData->szCurrSymbol, szCurrSymbol);
339  pGlobalData->nCurrGrouping = nCurrGrouping;
340  wcscpy(pGlobalData->szCurrDecimalSep, szCurrDecimalSep);
341  wcscpy(pGlobalData->szCurrThousandSep, szCurrThousandSep);
342  pGlobalData->nCurrPosFormat = nCurrPosFormat;
343  pGlobalData->nCurrNegFormat = nCurrNegFormat;
344  pGlobalData->nCurrDigits = nCurrDigits;
345 
346  return TRUE;
347 }
WCHAR szCurrSymbol[MAX_CURRSYMBOL]
Definition: intl.h:81
VOID GetSelectedComboBoxText(HWND hwndDlg, INT nIdDlgItem, PWSTR Buffer, UINT uSize)
Definition: misc.c:176
VOID GetSelectedComboBoxIndex(HWND hwndDlg, INT nIdDlgItem, PINT pValue)
Definition: misc.c:223
#define TRUE
Definition: types.h:120
#define IDC_CURRENCYGRPSEP
Definition: resource.h:32
INT nCurrNegFormat
Definition: intl.h:85
int32_t INT
Definition: typedefs.h:58
#define FALSE
Definition: types.h:117
WCHAR szCurrDecimalSep[MAX_CURRDECIMALSEP]
Definition: intl.h:82
INT nCurrGrouping
Definition: intl.h:87
#define MAX_CURRSYMBOL
Definition: intl.h:33
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDC_CURRENCYGRPNUM
Definition: resource.h:33
#define IDC_CURRENCYNEGVALUE
Definition: resource.h:29
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define IDC_CURRENCYDECNUM
Definition: resource.h:31
static const WCHAR L[]
Definition: oid.c:1250
WCHAR szCurrThousandSep[MAX_CURRTHOUSANDSEP]
Definition: intl.h:83
#define IDC_CURRENCYSYMBOL
Definition: resource.h:27
#define IDC_CURRENCYPOSVALUE
Definition: resource.h:28
INT nCurrPosFormat
Definition: intl.h:84
#define IDC_CURRENCYDECSEP
Definition: resource.h:30
#define MAX_CURRTHOUSANDSEP
Definition: intl.h:35
#define MAX_CURRDECIMALSEP
Definition: intl.h:34
INT nCurrDigits
Definition: intl.h:86

Referenced by CurrencyPageProc().

◆ InitCurrencyDecimalSeparators()

static VOID InitCurrencyDecimalSeparators ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 159 of file currency.c.

160 {
161  /* Limit text length */
163  CB_LIMITTEXT,
164  MAX_CURRDECIMALSEP - 1,
165  0);
166 
167  /* Decimal separator */
169  CB_ADDSTRING,
170  0,
171  (LPARAM)pGlobalData->szCurrDecimalSep);
172 
174  CB_SETCURSEL,
175  0, /* Index */
176  0);
177 }
#define CB_ADDSTRING
Definition: winuser.h:1918
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_LIMITTEXT
Definition: winuser.h:1940
WCHAR szCurrDecimalSep[MAX_CURRDECIMALSEP]
Definition: intl.h:82
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CB_SETCURSEL
Definition: winuser.h:1943
#define IDC_CURRENCYDECSEP
Definition: resource.h:30
#define MAX_CURRDECIMALSEP
Definition: intl.h:34

Referenced by CurrencyPageProc().

◆ InitCurrencyGroupSeparators()

static VOID InitCurrencyGroupSeparators ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 207 of file currency.c.

208 {
209  /* Limit text length */
211  CB_LIMITTEXT,
213  0);
214 
215  /* Digit group separator */
217  CB_ADDSTRING,
218  0,
219  (LPARAM)pGlobalData->szCurrThousandSep);
220 
222  CB_SETCURSEL,
223  0, /* Index */
224  0);
225 }
#define IDC_CURRENCYGRPSEP
Definition: resource.h:32
#define CB_ADDSTRING
Definition: winuser.h:1918
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_LIMITTEXT
Definition: winuser.h:1940
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WCHAR szCurrThousandSep[MAX_CURRTHOUSANDSEP]
Definition: intl.h:83
#define CB_SETCURSEL
Definition: winuser.h:1943
#define MAX_CURRTHOUSANDSEP
Definition: intl.h:35

Referenced by CurrencyPageProc().

◆ InitCurrencyNegativeFormats()

static VOID InitCurrencyNegativeFormats ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 123 of file currency.c.

124 {
125  WCHAR szBuffer[MAX_FMT_SIZE];
126  CURRENCYFMTW cyFmt;
127  int i;
128 
129  /* negative currency values */
130  cyFmt.NumDigits = pGlobalData->nCurrDigits;
131  cyFmt.LeadingZero = 0;
132  cyFmt.Grouping = 3;
133  cyFmt.lpDecimalSep = pGlobalData->szCurrDecimalSep;
134  cyFmt.lpThousandSep = pGlobalData->szCurrThousandSep;
135  cyFmt.lpCurrencySymbol = pGlobalData->szCurrSymbol;
136  cyFmt.PositiveOrder = 0;
137 
138  for (i = 0; i < 16; i++)
139  {
140  cyFmt.NegativeOrder = i;
141  GetCurrencyFormatW(pGlobalData->UserLCID, 0,
142  L"-1.1",
143  &cyFmt, szBuffer, MAX_FMT_SIZE);
144 
147  -1,
148  (LPARAM)szBuffer);
149  }
150 
152  CB_SETCURSEL,
153  pGlobalData->nCurrNegFormat,
154  0);
155 }
WCHAR szCurrSymbol[MAX_CURRSYMBOL]
Definition: intl.h:81
UINT PositiveOrder
Definition: winnls.h:615
UINT Grouping
Definition: winnls.h:611
UINT NegativeOrder
Definition: winnls.h:614
UINT LeadingZero
Definition: winnls.h:610
INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags, LPCWSTR lpszValue, const CURRENCYFMTW *lpFormat, LPWSTR lpCurrencyStr, int cchOut)
Definition: lcformat.c:1564
INT nCurrNegFormat
Definition: intl.h:85
LPWSTR lpThousandSep
Definition: winnls.h:613
#define CB_INSERTSTRING
Definition: winuser.h:1939
LONG_PTR LPARAM
Definition: windef.h:208
WCHAR szCurrDecimalSep[MAX_CURRDECIMALSEP]
Definition: intl.h:82
__wchar_t WCHAR
Definition: xmlstorage.h:180
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDC_CURRENCYNEGVALUE
Definition: resource.h:29
LPWSTR lpDecimalSep
Definition: winnls.h:612
static const WCHAR L[]
Definition: oid.c:1250
WCHAR szCurrThousandSep[MAX_CURRTHOUSANDSEP]
Definition: intl.h:83
#define CB_SETCURSEL
Definition: winuser.h:1943
#define MAX_FMT_SIZE
Definition: intl.h:22
LPWSTR lpCurrencySymbol
Definition: winnls.h:616
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
UINT NumDigits
Definition: winnls.h:609
INT nCurrDigits
Definition: intl.h:86
LCID UserLCID
Definition: intl.h:113

Referenced by CurrencyPageProc().

◆ InitCurrencyNumFracDigits()

static VOID InitCurrencyNumFracDigits ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 182 of file currency.c.

183 {
184  WCHAR szBuffer[MAX_FMT_SIZE];
185  int i;
186 
187  /* Create standard list of fractional symbols */
188  for (i = 0; i < 10; i++)
189  {
190  szBuffer[0] = L'0' + i;
191  szBuffer[1] = 0;
193  CB_ADDSTRING,
194  0,
195  (LPARAM)szBuffer);
196  }
197 
199  CB_SETCURSEL,
200  pGlobalData->nCurrDigits,
201  0);
202 }
#define CB_ADDSTRING
Definition: winuser.h:1918
LONG_PTR LPARAM
Definition: windef.h:208
__wchar_t WCHAR
Definition: xmlstorage.h:180
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDC_CURRENCYDECNUM
Definition: resource.h:31
static const WCHAR L[]
Definition: oid.c:1250
#define CB_SETCURSEL
Definition: winuser.h:1943
#define MAX_FMT_SIZE
Definition: intl.h:22
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
INT nCurrDigits
Definition: intl.h:86

Referenced by CurrencyPageProc().

◆ InitCurrencyPositiveFormats()

static VOID InitCurrencyPositiveFormats ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 87 of file currency.c.

88 {
89  WCHAR szBuffer[MAX_FMT_SIZE];
90  CURRENCYFMTW cyFmt;
91  INT i;
92 
93  /* positive currency values */
94  cyFmt.NumDigits = pGlobalData->nCurrDigits;
95  cyFmt.LeadingZero = 0;
96  cyFmt.Grouping = 3;
97  cyFmt.lpDecimalSep = pGlobalData->szCurrDecimalSep;
98  cyFmt.lpThousandSep = pGlobalData->szCurrThousandSep;
99  cyFmt.lpCurrencySymbol = pGlobalData->szCurrSymbol;
100  cyFmt.NegativeOrder = 0;
101 
102  for (i = 0; i < 4; i++)
103  {
104  cyFmt.PositiveOrder = i;
105  GetCurrencyFormatW(pGlobalData->UserLCID, 0,
106  L"1.1",
107  &cyFmt, szBuffer, MAX_FMT_SIZE);
108 
111  -1,
112  (LPARAM)szBuffer);
113  }
114 
116  CB_SETCURSEL,
117  pGlobalData->nCurrPosFormat,
118  0);
119 }
WCHAR szCurrSymbol[MAX_CURRSYMBOL]
Definition: intl.h:81
UINT PositiveOrder
Definition: winnls.h:615
UINT Grouping
Definition: winnls.h:611
UINT NegativeOrder
Definition: winnls.h:614
UINT LeadingZero
Definition: winnls.h:610
INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags, LPCWSTR lpszValue, const CURRENCYFMTW *lpFormat, LPWSTR lpCurrencyStr, int cchOut)
Definition: lcformat.c:1564
LPWSTR lpThousandSep
Definition: winnls.h:613
int32_t INT
Definition: typedefs.h:58
#define CB_INSERTSTRING
Definition: winuser.h:1939
LONG_PTR LPARAM
Definition: windef.h:208
WCHAR szCurrDecimalSep[MAX_CURRDECIMALSEP]
Definition: intl.h:82
__wchar_t WCHAR
Definition: xmlstorage.h:180
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPWSTR lpDecimalSep
Definition: winnls.h:612
static const WCHAR L[]
Definition: oid.c:1250
WCHAR szCurrThousandSep[MAX_CURRTHOUSANDSEP]
Definition: intl.h:83
#define CB_SETCURSEL
Definition: winuser.h:1943
#define MAX_FMT_SIZE
Definition: intl.h:22
#define IDC_CURRENCYPOSVALUE
Definition: resource.h:28
LPWSTR lpCurrencySymbol
Definition: winnls.h:616
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
INT nCurrPosFormat
Definition: intl.h:84
UINT NumDigits
Definition: winnls.h:609
INT nCurrDigits
Definition: intl.h:86
LCID UserLCID
Definition: intl.h:113

Referenced by CurrencyPageProc().

◆ InitCurrencySymbols()

static VOID InitCurrencySymbols ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 65 of file currency.c.

66 {
67  /* Limit text length */
70  MAX_CURRSYMBOL - 1,
71  0);
72 
73  /* Set currency symbols */
76  0,
77  (LPARAM)pGlobalData->szCurrSymbol);
78 
81  0, /* Index */
82  0);
83 }
WCHAR szCurrSymbol[MAX_CURRSYMBOL]
Definition: intl.h:81
#define CB_ADDSTRING
Definition: winuser.h:1918
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_LIMITTEXT
Definition: winuser.h:1940
#define MAX_CURRSYMBOL
Definition: intl.h:33
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CB_SETCURSEL
Definition: winuser.h:1943
#define IDC_CURRENCYSYMBOL
Definition: resource.h:27

Referenced by CurrencyPageProc().

◆ InitDigitGroupCB()

static VOID InitDigitGroupCB ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 229 of file currency.c.

230 {
231  WCHAR szBuffer[MAX_FMT_SIZE];
232  CURRENCYFMTW cyFmt;
233  INT i;
234 
235  /* Digit grouping */
236  cyFmt.NumDigits = 0;
237  cyFmt.LeadingZero = 0;
238  cyFmt.lpDecimalSep = L"";
239  cyFmt.lpThousandSep = pGlobalData->szCurrThousandSep;
240  cyFmt.PositiveOrder = 0;
241  cyFmt.NegativeOrder = 0;
242  cyFmt.lpCurrencySymbol = L"";
243 
244  for (i = 0 ; i < MAX_GROUPINGFORMATS ; i++)
245  {
247 
248  GetCurrencyFormatW(pGlobalData->UserLCID, 0,
249  L"123456789",
250  &cyFmt, szBuffer, MAX_FMT_SIZE);
253  -1,
254  (LPARAM)szBuffer);
255  }
256 
258  CB_SETCURSEL,
259  pGlobalData->nCurrGrouping,
260  0);
261 }
UINT PositiveOrder
Definition: winnls.h:615
UINT Grouping
Definition: winnls.h:611
UINT NegativeOrder
Definition: winnls.h:614
UINT LeadingZero
Definition: winnls.h:610
INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags, LPCWSTR lpszValue, const CURRENCYFMTW *lpFormat, LPWSTR lpCurrencyStr, int cchOut)
Definition: lcformat.c:1564
LPWSTR lpThousandSep
Definition: winnls.h:613
int32_t INT
Definition: typedefs.h:58
#define CB_INSERTSTRING
Definition: winuser.h:1939
LONG_PTR LPARAM
Definition: windef.h:208
INT nCurrGrouping
Definition: intl.h:87
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_GROUPINGFORMATS
Definition: intl.h:51
#define IDC_CURRENCYGRPNUM
Definition: resource.h:33
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GROUPINGDATA GroupingFormats[MAX_GROUPINGFORMATS]
Definition: generalp.c:44
LPWSTR lpDecimalSep
Definition: winnls.h:612
static const WCHAR L[]
Definition: oid.c:1250
WCHAR szCurrThousandSep[MAX_CURRTHOUSANDSEP]
Definition: intl.h:83
#define CB_SETCURSEL
Definition: winuser.h:1943
#define MAX_FMT_SIZE
Definition: intl.h:22
LPWSTR lpCurrencySymbol
Definition: winnls.h:616
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
UINT NumDigits
Definition: winnls.h:609
UINT nInteger
Definition: intl.h:127
LCID UserLCID
Definition: intl.h:113

Referenced by CurrencyPageProc().

◆ UpdateExamples()

static VOID UpdateExamples ( HWND  hwndDlg,
PGLOBALDATA  pGlobalData 
)
static

Definition at line 34 of file currency.c.

35 {
36  WCHAR szBuffer[MAX_FMT_SIZE];
37  CURRENCYFMTW CurrencyFormat;
38 
39  CurrencyFormat.NumDigits = pGlobalData->nCurrDigits;
40  CurrencyFormat.LeadingZero = pGlobalData->nNumLeadingZero;
41  CurrencyFormat.Grouping = GroupingFormats[pGlobalData->nCurrGrouping].nInteger;
42  CurrencyFormat.lpDecimalSep = pGlobalData->szCurrDecimalSep;
43  CurrencyFormat.lpThousandSep = pGlobalData->szCurrThousandSep;
44  CurrencyFormat.NegativeOrder = pGlobalData->nCurrNegFormat;
45  CurrencyFormat.PositiveOrder = pGlobalData->nCurrPosFormat;
46  CurrencyFormat.lpCurrencySymbol = pGlobalData->szCurrSymbol;
47 
48  /* Positive example */
49  GetCurrencyFormatW(pGlobalData->UserLCID, 0,
51  &CurrencyFormat, szBuffer, MAX_FMT_SIZE);
52 
54 
55  /* Negative example */
56  GetCurrencyFormatW(pGlobalData->UserLCID, 0,
58  &CurrencyFormat, szBuffer, MAX_FMT_SIZE);
59 
61 }
WCHAR szCurrSymbol[MAX_CURRSYMBOL]
Definition: intl.h:81
UINT PositiveOrder
Definition: winnls.h:615
UINT Grouping
Definition: winnls.h:611
UINT NegativeOrder
Definition: winnls.h:614
UINT LeadingZero
Definition: winnls.h:610
INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags, LPCWSTR lpszValue, const CURRENCYFMTW *lpFormat, LPWSTR lpCurrencyStr, int cchOut)
Definition: lcformat.c:1564
INT nCurrNegFormat
Definition: intl.h:85
LPWSTR lpThousandSep
Definition: winnls.h:613
INT nNumLeadingZero
Definition: intl.h:75
LONG_PTR LPARAM
Definition: windef.h:208
WCHAR szCurrDecimalSep[MAX_CURRDECIMALSEP]
Definition: intl.h:82
#define WM_SETTEXT
Definition: winuser.h:1599
INT nCurrGrouping
Definition: intl.h:87
#define IDC_CURRENCYPOSSAMPLE
Definition: resource.h:25
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDC_CURRENCYNEGSAMPLE
Definition: resource.h:26
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GROUPINGDATA GroupingFormats[MAX_GROUPINGFORMATS]
Definition: generalp.c:44
LPWSTR lpDecimalSep
Definition: winnls.h:612
WCHAR szCurrThousandSep[MAX_CURRTHOUSANDSEP]
Definition: intl.h:83
#define POSITIVE_EXAMPLE
Definition: currency.c:29
#define MAX_FMT_SIZE
Definition: intl.h:22
#define NEGATIVE_EXAMPLE
Definition: currency.c:30
LPWSTR lpCurrencySymbol
Definition: winnls.h:616
INT nCurrPosFormat
Definition: intl.h:84
UINT NumDigits
Definition: winnls.h:609
INT nCurrDigits
Definition: intl.h:86
UINT nInteger
Definition: intl.h:127
LCID UserLCID
Definition: intl.h:113

Referenced by CurrencyPageProc().