now cache GetCharWidth() too (and not only height)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8856 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-11-28 17:19:11 +00:00
parent be18e65726
commit 8c27f612e5
2 changed files with 22 additions and 11 deletions

View File

@@ -394,8 +394,11 @@ protected:
return m_heightLine;
}
// recalc the line height (to call when the font changes)
void RecalcLineHeight();
// get the average char width
wxCoord GetAverageWidth() const { return m_widthAvg; }
// recalc the line height and char width (to call when the font changes)
void RecalcFontMetrics();
// event handlers
void OnIdle(wxIdleEvent& event);
@@ -460,7 +463,10 @@ private:
// the height of one line (cached value of GetCharHeight)
wxCoord m_heightLine;
// and the average char width (cached value of GetCharWidth)
wxCoord m_widthAvg;
// we have some data which depends on the kind of control (single or multi
// line)
union