Invalidate best size when the bitmap or bitmap position changes. Add GetBitmapMargins
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63595 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -109,6 +109,7 @@ public:
|
|||||||
// set the margins around the image
|
// set the margins around the image
|
||||||
void SetBitmapMargins(wxCoord x, wxCoord y) { DoSetBitmapMargins(x, y); }
|
void SetBitmapMargins(wxCoord x, wxCoord y) { DoSetBitmapMargins(x, y); }
|
||||||
void SetBitmapMargins(const wxSize& sz) { DoSetBitmapMargins(sz.x, sz.y); }
|
void SetBitmapMargins(const wxSize& sz) { DoSetBitmapMargins(sz.x, sz.y); }
|
||||||
|
wxSize GetBitmapMargins() { return DoGetBitmapMargins(); }
|
||||||
|
|
||||||
// set the image position relative to the text, i.e. wxLEFT means that the
|
// set the image position relative to the text, i.e. wxLEFT means that the
|
||||||
// image is to the left of the text (this is the default)
|
// image is to the left of the text (this is the default)
|
||||||
|
@@ -65,6 +65,7 @@ protected:
|
|||||||
{
|
{
|
||||||
m_marginX = x;
|
m_marginX = x;
|
||||||
m_marginY = y;
|
m_marginY = y;
|
||||||
|
InvalidateBestSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
// the margins around the bitmap
|
// the margins around the bitmap
|
||||||
|
@@ -664,6 +664,7 @@ void wxButton::DoSetBitmapPosition(wxDirection dir)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gtk_button_set_image_position(GTK_BUTTON(m_widget), gtkpos);
|
gtk_button_set_image_position(GTK_BUTTON(m_widget), gtkpos);
|
||||||
|
InvalidateBestSize();
|
||||||
}
|
}
|
||||||
#endif // GTK+ 2.10+
|
#endif // GTK+ 2.10+
|
||||||
}
|
}
|
||||||
|
@@ -1040,6 +1040,7 @@ void wxButton::DoSetBitmapMargins(wxCoord x, wxCoord y)
|
|||||||
wxCHECK_RET( m_imageData, "SetBitmap() must be called first" );
|
wxCHECK_RET( m_imageData, "SetBitmap() must be called first" );
|
||||||
|
|
||||||
m_imageData->SetBitmapMargins(x, y);
|
m_imageData->SetBitmapMargins(x, y);
|
||||||
|
InvalidateBestSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxButton::DoSetBitmapPosition(wxDirection dir)
|
void wxButton::DoSetBitmapPosition(wxDirection dir)
|
||||||
@@ -1047,6 +1048,7 @@ void wxButton::DoSetBitmapPosition(wxDirection dir)
|
|||||||
wxCHECK_RET( m_imageData, "SetBitmap() must be called first" );
|
wxCHECK_RET( m_imageData, "SetBitmap() must be called first" );
|
||||||
|
|
||||||
m_imageData->SetBitmapPosition(dir);
|
m_imageData->SetBitmapPosition(dir);
|
||||||
|
InvalidateBestSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -104,11 +104,13 @@ void wxButton::DoSetBitmap(const wxBitmap& bitmap, State which)
|
|||||||
if ( bi )
|
if ( bi )
|
||||||
bi->SetPressedBitmap(bitmap);
|
bi->SetPressedBitmap(bitmap);
|
||||||
}
|
}
|
||||||
|
InvalidateBestSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxButton::DoSetBitmapPosition(wxDirection dir)
|
void wxButton::DoSetBitmapPosition(wxDirection dir)
|
||||||
{
|
{
|
||||||
m_peer->SetBitmapPosition(dir);
|
m_peer->SetBitmapPosition(dir);
|
||||||
|
InvalidateBestSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindow *wxButton::SetDefault()
|
wxWindow *wxButton::SetDefault()
|
||||||
|
Reference in New Issue
Block a user