From: Václav Slavík Date: Sun, 16 Jan 2000 13:26:01 +0000 (+0000) Subject: fixed default button size, finally X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a63f2bec290ddf058718c8465a56c3ef421685eb?hp=37b8e6798782278fdfe4f3c1291aaff55cdbb8c9 fixed default button size, finally git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5453 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/button.cpp b/src/msw/button.cpp index a7df197b6c..86f833762c 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -95,19 +95,6 @@ bool wxButton::Create(wxWindow *parent, SetSize(pos.x, pos.y, size.x, size.y); - // bad hack added by Robert to make buttons at least - // 80 pixels wide. There are probably better ways... - // TODO. FIXME. - wxSize nsize( GetSize() ); - if ((nsize.x < 80) || (nsize.y < 23)) - { - if ((size.x == -1) && (nsize.x < 80)) - nsize.x = 80; - if ((size.y == -1) && (nsize.y < 23)) - nsize.y = 23; - SetSize( nsize ); - } - return TRUE; } @@ -143,7 +130,11 @@ wxSize wxButton::DoGetBestSize() const // the button height is proportional to the height of the font used int hBtn = BUTTON_HEIGHT_FROM_CHAR_HEIGHT(hChar); - return wxSize(wBtn, hBtn); + wxSize sz = GetDefaultSize(); + if (wBtn > sz.x) sz.x = wBtn; + if (hBtn > sz.y) sz.y = hBtn; + + return sz; } /* static */