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
|
virtual void SetBitmapMargins(wxCoord x, wxCoord y) wxOVERRIDE
|
||||||
{
|
{
|
||||||
RECT& margin = m_data.margin;
|
::SetRect(&m_data.margin, x, y, x, y);
|
||||||
::SetRect(&margin, x, y, x, y);
|
|
||||||
|
|
||||||
if ( !::SendMessage(m_hwndBtn, BCM_SETTEXTMARGIN, 0, (LPARAM)&margin) )
|
UpdateImageInfo();
|
||||||
{
|
|
||||||
wxLogDebug("SendMessage(BCM_SETTEXTMARGIN) failed");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual wxDirection GetBitmapPosition() const wxOVERRIDE
|
virtual wxDirection GetBitmapPosition() const wxOVERRIDE
|
||||||
|
Reference in New Issue
Block a user