updates for DoGetBestSize
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4639 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -72,14 +72,14 @@ wxButton::~wxButton()
|
||||
// size management including autosizing
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxSize wxButton::DoGetBestSize()
|
||||
wxSize wxButton::DoGetBestSize() const
|
||||
{
|
||||
wxString label = wxGetWindowText(GetHWND());
|
||||
int wBtn;
|
||||
GetTextExtent(label, &wBtn, NULL);
|
||||
|
||||
int wChar, hChar;
|
||||
wxGetCharSize(GetHWND(), &wChar, &hChar, &GetFont());
|
||||
wxGetCharSize(GetHWND(), &wChar, &hChar, (wxFont*)&GetFont());
|
||||
|
||||
// add a margin - the button is wider than just its label
|
||||
wBtn += 3*wChar;
|
||||
|
Reference in New Issue
Block a user