support for wxNO_BORDER
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36107 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -63,14 +63,24 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
|
|||||||
m_bmpNormal = bitmap;
|
m_bmpNormal = bitmap;
|
||||||
|
|
||||||
ControlButtonContentInfo info ;
|
ControlButtonContentInfo info ;
|
||||||
wxMacCreateBitmapButton( &info , m_bmpNormal ) ;
|
|
||||||
|
|
||||||
Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
|
Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
|
||||||
m_peer = new wxMacControl( this ) ;
|
m_peer = new wxMacControl( this ) ;
|
||||||
|
|
||||||
|
#ifdef __WXMAC_OSX__
|
||||||
|
if ( HasFlag( wxBORDER_NONE ) )
|
||||||
|
{
|
||||||
|
wxMacCreateBitmapButton( &info , m_bmpNormal , kControlContentIconRef ) ;
|
||||||
|
verify_noerr ( CreateIconControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , &info , false , m_peer->GetControlRefAddr() ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
wxMacCreateBitmapButton( &info , m_bmpNormal ) ;
|
||||||
verify_noerr ( CreateBevelButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") ,
|
verify_noerr ( CreateBevelButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") ,
|
||||||
(( style & wxBU_AUTODRAW ) ? kControlBevelButtonSmallBevel : kControlBevelButtonNormalBevel ) ,
|
(( style & wxBU_AUTODRAW ) ? kControlBevelButtonSmallBevel : kControlBevelButtonNormalBevel ) ,
|
||||||
kControlBehaviorOffsetContents , &info , 0 , 0 , 0 , m_peer->GetControlRefAddr() ) );
|
kControlBehaviorOffsetContents , &info , 0 , 0 , 0 , m_peer->GetControlRefAddr() ) );
|
||||||
|
}
|
||||||
wxMacReleaseBitmapButton( &info ) ;
|
wxMacReleaseBitmapButton( &info ) ;
|
||||||
wxASSERT_MSG( m_peer != NULL && m_peer->Ok() , wxT("No valid mac control") ) ;
|
wxASSERT_MSG( m_peer != NULL && m_peer->Ok() , wxT("No valid mac control") ) ;
|
||||||
|
|
||||||
@@ -85,11 +95,24 @@ void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
|
|||||||
InvalidateBestSize();
|
InvalidateBestSize();
|
||||||
|
|
||||||
ControlButtonContentInfo info ;
|
ControlButtonContentInfo info ;
|
||||||
|
#ifdef __WXMAC_OSX__
|
||||||
|
if ( HasFlag( wxBORDER_NONE ) )
|
||||||
|
{
|
||||||
|
wxMacCreateBitmapButton( &info , m_bmpNormal , kControlContentIconRef ) ;
|
||||||
|
if ( info.contentType != kControlNoContent )
|
||||||
|
{
|
||||||
|
m_peer->SetData( kControlIconPart , kControlIconContentTag , info ) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
wxMacCreateBitmapButton( &info , m_bmpNormal ) ;
|
wxMacCreateBitmapButton( &info , m_bmpNormal ) ;
|
||||||
if ( info.contentType != kControlNoContent )
|
if ( info.contentType != kControlNoContent )
|
||||||
{
|
{
|
||||||
m_peer->SetData( kControlButtonPart , kControlBevelButtonContentTag , info ) ;
|
m_peer->SetData( kControlButtonPart , kControlBevelButtonContentTag , info ) ;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
wxMacReleaseBitmapButton( &info ) ;
|
wxMacReleaseBitmapButton( &info ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user