comctl32/monthcal: Get/set unicode format flag using MCM_[GET|SET]UNICODEFORMAT.

This commit is contained in:
Nikolay Sivov 2009-10-15 20:16:27 +04:00 committed by Alexandre Julliard
parent baac2a6c59
commit cbdc99cdba
2 changed files with 23 additions and 2 deletions

View File

@ -100,6 +100,8 @@ typedef struct
stored in SYSTEMTIME format */
BOOL firstDaySet; /* first week day differs from locale defined */
BOOL isUnicode; /* value set with MCM_SETUNICODE format */
int monthRange;
MONTHDAYSTATE *monthdayState;
SYSTEMTIME todaysDate;
@ -2412,6 +2414,7 @@ MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs)
infoPtr->minSel = infoPtr->todaysDate;
infoPtr->maxSel = infoPtr->todaysDate;
infoPtr->curSel = infoPtr->todaysDate;
infoPtr->isUnicode = TRUE;
/* call MONTHCAL_UpdateSize to set all of the dimensions */
/* of the control */
@ -2465,6 +2468,20 @@ MONTHCAL_Notify(MONTHCAL_INFO *infoPtr, NMHDR *hdr)
return 0;
}
static inline BOOL
MONTHCAL_SetUnicodeFormat(MONTHCAL_INFO *infoPtr, BOOL isUnicode)
{
BOOL prev = infoPtr->isUnicode;
infoPtr->isUnicode = isUnicode;
return prev;
}
static inline BOOL
MONTHCAL_GetUnicodeFormat(const MONTHCAL_INFO *infoPtr)
{
return infoPtr->isUnicode;
}
static LRESULT WINAPI
MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
@ -2540,6 +2557,12 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case MCM_GETMAXTODAYWIDTH:
return MONTHCAL_GetMaxTodayWidth(infoPtr);
case MCM_SETUNICODEFORMAT:
return MONTHCAL_SetUnicodeFormat(infoPtr, (BOOL)wParam);
case MCM_GETUNICODEFORMAT:
return MONTHCAL_GetUnicodeFormat(infoPtr);
case WM_GETDLGCODE:
return DLGC_WANTARROWS | DLGC_WANTCHARS;

View File

@ -901,14 +901,12 @@ static void test_monthcal_unicode(void)
/* current setting is 1, so, should return 1 */
res = SendMessage(hwnd, MCM_GETUNICODEFORMAT, 0, 0);
todo_wine
ok(1 == res ||
broken(0 == res), /* comctl32 <= 4.70 */
"Expected 1, got %d\n", res);
/* setting to 0, should return previous settings */
res = SendMessage(hwnd, MCM_SETUNICODEFORMAT, 0, 0);
todo_wine
ok(1 == res ||
broken(0 == res), /* comctl32 <= 4.70 */
"Expected 1, got %d\n", res);