Improve calculating wxButton best size under wxMSW

We can use BCM_GETIDEALSIZE message to get the size of the button that
best fits its text and image (if present).
It gives better results for text wxButton with wxBU_EXACTFIT style.
This commit is contained in:
Artur Wieczorek
2021-04-08 19:16:38 +02:00
parent a02690f957
commit de10f054c4
2 changed files with 49 additions and 20 deletions

View File

@@ -59,6 +59,7 @@ protected:
// Should only be called if we do have a button, i.e. if m_imageData is
// non-NULL.
void AdjustForBitmapSize(wxSize& size) const;
void AdjustForBitmapMargins(wxSize& size) const;
class wxButtonImageData *m_imageData;