git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34402
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxClientDC dc(this);
dc.SetFont(GetFont());
wxClientDC dc(this);
dc.SetFont(GetFont());
- // determine the column width (we assume that the weekday names are always
- // wider (in any language) than the numbers)
+ // determine the column width (weekday names are not necessarily wider
+ // than the numbers (in some languages), so let's not assume that they are)
+ for ( day = 10; day <= 31; day++)
+ {
+ wxCoord width;
+ dc.GetTextExtent(wxString::Format(wxT("%d"), day), &width, &m_heightRow);
+ if ( width > m_widthCol )
+ {
+ // 1.5 times the width gives nice margins even if the weekday
+ // names are short
+ m_widthCol = width+width/2;
+ }
+ }
wxDateTime::WeekDay wd;
for ( wd = wxDateTime::Sun; wd < wxDateTime::Inv_WeekDay; wxNextWDay(wd) )
{
wxDateTime::WeekDay wd;
for ( wd = wxDateTime::Sun; wd < wxDateTime::Inv_WeekDay; wxNextWDay(wd) )
{