X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/169147c8be2d1a13e95aaa24259f83232aec8de9..8e509c4b0c60bc066958574e4122a3db8ffcf491:/include/wx/dc.h diff --git a/include/wx/dc.h b/include/wx/dc.h index da5bc5fde0..57e23f8aad 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -441,13 +441,27 @@ public: wxFont *theFont = NULL) const { DoGetTextExtent(string, x, y, descent, externalLeading, theFont); } + wxSize GetTextExtent(const wxString& string) const + { + wxCoord w, h; + DoGetTextExtent(string, &w, &h); + return wxSize(w, h); + } + // works for single as well as multi-line strings - virtual void GetMultiLineTextExtent(const wxString& text, + virtual void GetMultiLineTextExtent(const wxString& string, wxCoord *width, wxCoord *height, wxCoord *heightLine = NULL, wxFont *font = NULL) const; + wxSize GetMultiLineTextExtent(const wxString& string) const + { + wxCoord w, h; + GetMultiLineTextExtent(string, &w, &h); + return wxSize(w, h); + } + // Measure cumulative width of text after each character bool GetPartialTextExtents(const wxString& text, wxArrayInt& widths) const { return DoGetPartialTextExtents(text, widths); }