Put back wxMSW's wxStaticBitmap::DoGetBestSize because GetBitmap (used
in base DoGBS) is not able to be called until the control is fully constructed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26662 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -78,6 +78,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxBorder GetDefaultBorder() const;
|
virtual wxBorder GetDefaultBorder() const;
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
||||||
|
|
||||||
// ctor/dtor helpers
|
// ctor/dtor helpers
|
||||||
|
@@ -167,6 +167,9 @@ bool wxStaticBitmap::Create(wxWindow *parent,
|
|||||||
// no need to delete the new image
|
// no need to delete the new image
|
||||||
SetImageNoCopy(image);
|
SetImageNoCopy(image);
|
||||||
|
|
||||||
|
// GetBestSize will work properly now, so set the best size if needed
|
||||||
|
SetBestSize(size);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,6 +204,15 @@ void wxStaticBitmap::Free()
|
|||||||
m_image = NULL;
|
m_image = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxSize wxStaticBitmap::DoGetBestSize() const
|
||||||
|
{
|
||||||
|
if ( ImageIsOk() )
|
||||||
|
return wxSize(m_image->GetWidth(), m_image->GetHeight());
|
||||||
|
|
||||||
|
// this is completely arbitrary
|
||||||
|
return wxSize(16, 16);
|
||||||
|
}
|
||||||
|
|
||||||
void wxStaticBitmap::SetImage( const wxGDIImage* image )
|
void wxStaticBitmap::SetImage( const wxGDIImage* image )
|
||||||
{
|
{
|
||||||
wxGDIImage* convertedImage = ConvertImage( *image );
|
wxGDIImage* convertedImage = ConvertImage( *image );
|
||||||
|
Reference in New Issue
Block a user