X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b85db900cdc04cd70dfa940c7d99469f7f4c2b41..032bc940fcde34cc649eaa111cd6aff1cda66104:/src/generic/hyperlink.cpp?ds=sidebyside diff --git a/src/generic/hyperlink.cpp b/src/generic/hyperlink.cpp index ffb3608554..21f80fc131 100644 --- a/src/generic/hyperlink.cpp +++ b/src/generic/hyperlink.cpp @@ -115,10 +115,8 @@ bool wxHyperlinkCtrl::Create(wxWindow *parent, wxWindowID id, f.SetUnderlined(true); SetFont(f); - CacheBestSize(DoGetBestSize()); - SetMinSize(GetBestSize()); - SetSize (DoGetBestSize()); - + SetInitialSize(size); + return true; } @@ -130,14 +128,11 @@ wxSize wxHyperlinkCtrl::DoGetBestSize() const dc.SetFont(GetFont()); dc.GetTextExtent(GetLabel(), &w, &h); - return wxSize(w, h); + wxSize best(w, h); + CacheBestSize(best); + return best; } -void wxHyperlinkCtrl::DoGetSize(int *width, int *height) const -{ - if (width) *width = GetBestSize().GetWidth(); - if (height) *height = GetBestSize().GetHeight(); -} void wxHyperlinkCtrl::SetNormalColour(const wxColour &colour) {