Applied patch [ 1207531 ] Fix for wxCalendarCtrl being UNUSABLE with some languages
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -840,10 +840,22 @@ void wxCalendarCtrl::RecalcGeometry()
|
|||||||
wxClientDC dc(this);
|
wxClientDC dc(this);
|
||||||
|
|
||||||
dc.SetFont(GetFont());
|
dc.SetFont(GetFont());
|
||||||
|
int day = 10;
|
||||||
|
|
||||||
// determine the column width (we assume that the weekday names are always
|
// determine the column width (weekday names are not necessarily wider
|
||||||
// wider (in any language) than the numbers)
|
// than the numbers (in some languages), so let's not assume that they are)
|
||||||
m_widthCol = 0;
|
m_widthCol = 0;
|
||||||
|
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;
|
wxDateTime::WeekDay wd;
|
||||||
for ( wd = wxDateTime::Sun; wd < wxDateTime::Inv_WeekDay; wxNextWDay(wd) )
|
for ( wd = wxDateTime::Sun; wd < wxDateTime::Inv_WeekDay; wxNextWDay(wd) )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user