Refactor and simplify wxChoice::DoGetBestSize().

Use wxTextMeasure instead of duplicating its code and also reuse the code
between different ports.

Closes #14706.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72848 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-11-01 17:15:28 +00:00
parent c236dbaed2
commit 7eb0acefc2
5 changed files with 42 additions and 80 deletions

View File

@@ -58,6 +58,13 @@ public:
// override wxItemContainer::IsSorted
virtual bool IsSorted() const { return HasFlag(wxCB_SORT); }
protected:
// The generic implementation doesn't determine the height correctly and
// doesn't account for the width of the arrow but does take into account
// the string widths, so the derived classes should override it and set the
// height and add the arrow width to the size returned by this version.
virtual wxSize DoGetBestSize() const;
private:
wxDECLARE_NO_COPY_CLASS(wxChoiceBase);
};