- wxWindow *yearControl = wxCalendarCtrl::GetYearControl();
-
- wxClientDC dc(yearControl);
- dc.SetFont(yearControl->GetFont());
- wxCoord width, dummy;
- dc.GetTextExtent(wxT("2000"), &width, &dummy);
- width += ConvertDialogToPixels(wxSize(20, 0)).x;
-
- wxSize calSize = wxCalendarCtrl::GetBestSize();
- wxSize yearSize = yearControl->GetSize();
- yearSize.x = width;
-
- wxPoint yearPosition = yearControl->GetPosition();
-
- SetFormat(wxT("%x"));
-
- width = yearPosition.x + yearSize.x+2+CALBORDER/2;
- if (width < calSize.x-4)
- width = calSize.x-4;