Fix setting image margin in wxButton (wxMSW)
When button images are stored in the image list (BUTTON_IMAGELIST) their margins should be set with BCM_SETIMAGELIST message. BCM_SETTEXTMARGIN sets the margins around the text label and not the image. See #13130.
This commit is contained in:
@@ -256,13 +256,9 @@ public:
|
||||
|
||||
virtual void SetBitmapMargins(wxCoord x, wxCoord y) wxOVERRIDE
|
||||
{
|
||||
RECT& margin = m_data.margin;
|
||||
::SetRect(&margin, x, y, x, y);
|
||||
::SetRect(&m_data.margin, x, y, x, y);
|
||||
|
||||
if ( !::SendMessage(m_hwndBtn, BCM_SETTEXTMARGIN, 0, (LPARAM)&margin) )
|
||||
{
|
||||
wxLogDebug("SendMessage(BCM_SETTEXTMARGIN) failed");
|
||||
}
|
||||
UpdateImageInfo();
|
||||
}
|
||||
|
||||
virtual wxDirection GetBitmapPosition() const wxOVERRIDE
|
||||
|
Reference in New Issue
Block a user