Datetime scroll fixes
Duane Clark
dclark at akamail.com
Thu Apr 14 13:24:13 CDT 2005
Changelog:
Hour '0' corresponds to 12AM.
Scroll cleanly.
-------------- next part --------------
Index: dlls/comctl32/datetime.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/datetime.c,v
retrieving revision 1.55
diff -u -p -r1.55 datetime.c
--- dlls/comctl32/datetime.c 14 Apr 2005 11:31:17 -0000 1.55
+++ dlls/comctl32/datetime.c 14 Apr 2005 18:20:35 -0000
@@ -339,10 +339,22 @@ DATETIME_ReturnTxt (DATETIME_INFO *infoP
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDAYNAME1+(date.wDayOfWeek+6)%7, result, resultSize);
break;
case ONEDIGIT12HOUR:
- wsprintfW (result, fmt_dW, date.wHour - (date.wHour > 12 ? 12 : 0));
+ if (date.wHour == 0) {
+ result[0] = '1';
+ result[1] = '2';
+ result[2] = 0;
+ }
+ else
+ wsprintfW (result, fmt_dW, date.wHour - (date.wHour > 12 ? 12 : 0));
break;
case TWODIGIT12HOUR:
- wsprintfW (result, fmt__2dW, date.wHour - (date.wHour > 12 ? 12 : 0));
+ if (date.wHour == 0) {
+ result[0] = '1';
+ result[1] = '2';
+ result[2] = 0;
+ }
+ else
+ wsprintfW (result, fmt__2dW, date.wHour - (date.wHour > 12 ? 12 : 0));
break;
case ONEDIGIT24HOUR:
wsprintfW (result, fmt_dW, date.wHour);
@@ -630,8 +642,12 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr
DeleteObject (hbr);
oldTextColor = SetTextColor (hdc, comctl32_color.clrWindow);
}
- else
+ else {
+ HBRUSH hbr = CreateSolidBrush (comctl32_color.clrWindow);
+ FillRect(hdc, field, hbr);
+ DeleteObject (hbr);
oldTextColor = SetTextColor (hdc, comctl32_color.clrWindowText);
+ }
/* draw the date text using the colour set above */
DrawTextW (hdc, txt, strlenW(txt), field, DT_RIGHT | DT_VCENTER | DT_SINGLELINE);
More information about the wine-patches
mailing list