/////////////////////////////////////////////////////////////////////////////
-// Name: bmpbuttn.cpp
+// Name: src/mac/classic/bmpbuttn.cpp
// Purpose: wxBitmapButton
// Author: Stefan Csomor
// Modified by:
// Created: 1998-01-01
// RCS-ID: $Id$
// Copyright: (c) Stefan Csomor
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
-#pragma implementation "bmpbuttn.h"
-#endif
+#include "wx/wxprec.h"
+
+#if wxUSE_BMPBUTTON
-#include "wx/window.h"
#include "wx/bmpbuttn.h"
-#if !USE_SHARED_LIBRARY
-IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton)
+#ifndef WX_PRECOMP
+ #include "wx/window.h"
#endif
+IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton)
+
#include "wx/mac/uma.h"
#include "wx/bitmap.h"
return false;
m_bmpNormal = bitmap;
-
+
if (style & wxBU_AUTODRAW)
{
m_marginX = wxDEFAULT_BUTTON_MARGIN;
Str255 title ;
m_bmpNormal = bitmap;
wxBitmapRefData * bmap = NULL ;
-
+
if ( m_bmpNormal.Ok() )
bmap = (wxBitmapRefData*) ( m_bmpNormal.GetRefData()) ;
-
+
MacPreControlCreate( parent , id , wxEmptyString , pos , wxSize( width , height ) ,style, validator , name , &bounds , title ) ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 ,
- kControlBehaviorOffsetContents +
- ( bmap && bmap->m_bitmapType == kMacBitmapTypeIcon ?
- kControlContentCIconHandle : kControlContentPictHandle ) , 0,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 ,
+ kControlBehaviorOffsetContents +
+ ( bmap && bmap->m_bitmapType == kMacBitmapTypeIcon ?
+ kControlContentCIconHandle : kControlContentPictHandle ) , 0,
(( style & wxBU_AUTODRAW ) ? kControlBevelButtonSmallBevelProc : kControlBevelButtonNormalBevelProc ), (long) this ) ;
wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
-
+
ControlButtonContentInfo info ;
wxMacCreateBitmapButton( &info , m_bmpNormal ) ;
if ( info.contentType != kControlNoContent )
}
MacPostControlCreate() ;
- return TRUE;
+ return true;
}
void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
{
m_bmpNormal = bitmap;
+ InvalidateBestSize();
ControlButtonContentInfo info ;
wxMacCreateBitmapButton( &info , m_bmpNormal ) ;
}
return best;
}
+
+#endif // wxUSE_BMPBUTTON