-
-void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap )
-{
- if ( HasFlag( wxBORDER_NONE ) )
- m_bmpNormal = wxMakeStdSizeBitmap(bitmap);
- else
- m_bmpNormal = bitmap;
-
- InvalidateBestSize();
-
- ControlButtonContentInfo info;
-
- if ( HasFlag( wxBORDER_NONE ) )
- {
- wxMacCreateBitmapButton( &info, m_bmpNormal, kControlContentIconRef );
- if ( info.contentType != kControlNoContent )
- m_peer->SetData( kControlIconPart, kControlIconContentTag, info );
- }
- else
- {
- wxMacCreateBitmapButton( &info, m_bmpNormal );
- if ( info.contentType != kControlNoContent )
- m_peer->SetData( kControlButtonPart, kControlBevelButtonContentTag, info );
- }
-
- wxMacReleaseBitmapButton( &info );
-}
-
-wxSize wxBitmapButton::DoGetBestSize() const
-{
- wxSize best;
-
- best.x = 2 * m_marginX;
- best.y = 2 * m_marginY;
- if ( m_bmpNormal.Ok() )
- {
- best.x += m_bmpNormal.GetWidth();
- best.y += m_bmpNormal.GetHeight();
- }
-
- return best;
-}
-