Use the DrawFocusRect function to draw the focus rect, instead of a
broken home-brewed solution.
This commit is contained in:
parent
3dad1f9043
commit
fbcc21be62
|
@ -337,7 +337,6 @@ static void MONTHCAL_DrawDay(MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month
|
|||
RECT r;
|
||||
static int haveBoldFont, haveSelectedDay = FALSE;
|
||||
HBRUSH hbr;
|
||||
HPEN hNewPen, hOldPen = 0;
|
||||
COLORREF oldCol = 0;
|
||||
COLORREF oldBk = 0;
|
||||
|
||||
|
@ -394,12 +393,8 @@ static void MONTHCAL_DrawDay(MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month
|
|||
DrawTextA(hdc, buf, -1, &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE );
|
||||
|
||||
/* draw a rectangle around the currently selected days text */
|
||||
if((day==infoPtr->curSelDay) && (month==infoPtr->currentMonth)) {
|
||||
hNewPen = CreatePen(PS_ALTERNATE, 0, GetSysColor(COLOR_WINDOWTEXT) );
|
||||
hbr = GetSysColorBrush(COLOR_WINDOWTEXT);
|
||||
FrameRect(hdc, &r, hbr);
|
||||
SelectObject(hdc, hOldPen);
|
||||
}
|
||||
if((day==infoPtr->curSelDay) && (month==infoPtr->currentMonth))
|
||||
DrawFocusRect(hdc, &r);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue