+ const wxWindowBase * const parent = wxGetTopLevelParent((wxWindow*)this);
+
+ if ( !parent->m_font.IsOk() )
+ {
+ // Default GUI font is used. This is the most common case, so
+ // cache the results.
+ static wxSize s_defFontSize;
+ if ( s_defFontSize.x == 0 )
+ s_defFontSize = wxPrivate::GetAverageASCIILetterSize(*parent);
+ return s_defFontSize;
+ }
+ else
+ {
+ // Custom font, we always need to compute the result
+ return wxPrivate::GetAverageASCIILetterSize(*parent);
+ }
+}
+
+wxPoint wxWindowBase::ConvertPixelsToDialog(const wxPoint& pt) const
+{
+ const wxSize base = GetDlgUnitBase();
+
+ // NB: wxMulDivInt32() is used, because it correctly rounds the result
+