- wxSize calSize = wxGenericCalendarCtrl::GetBestSize();
- wxSize yearSize = yearControl->GetSize();
- yearSize.x = width;
-
- wxPoint yearPosition = yearControl->GetPosition();
-
- SetFormat("%x");
-
- width = yearPosition.x + yearSize.x+2+CALBORDER/2;
- if (width < calSize.x-4)
- width = calSize.x-4;
-
- int calPos = (width-calSize.x)/2;
- if (calPos == -1)
- {
- calPos = 0;
- width += 2;
- }
- wxGenericCalendarCtrl::SetSize(calPos, 0, calSize.x, calSize.y);
- yearControl->SetSize(width-yearSize.x-CALBORDER/2, yearPosition.y,
- yearSize.x, yearSize.y);
- wxGenericCalendarCtrl::GetMonthControl()->Move(0, 0);
-
- m_useSize.x = width+CALBORDER/2;
- m_useSize.y = calSize.y-2+CALBORDER;