]>
git.saurik.com Git - wxWidgets.git/blob - src/osx/bmpbuttn_osx.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/bmpbuttn_osx.cpp
3 // Purpose: wxBitmapButton
4 // Author: Stefan Csomor
7 // Copyright: (c) Stefan Csomor
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #include "wx/wxprec.h"
15 #include "wx/bmpbuttn.h"
19 #include "wx/dcmemory.h"
22 #include "wx/osx/private.h"
24 //---------------------------------------------------------------------------
26 bool wxBitmapButton::Create( wxWindow
*parent
,
28 const wxBitmap
& bitmap
,
32 const wxValidator
& validator
,
33 const wxString
& name
)
37 if ( !wxBitmapButtonBase::Create(parent
, id
, pos
, size
, style
,
41 if ( style
& wxBU_AUTODRAW
)
44 m_marginY
= wxDEFAULT_BUTTON_MARGIN
;
52 m_bitmaps
[State_Normal
] = bitmap
;
54 SetPeer(wxWidgetImpl::CreateBitmapButton( this, parent
, id
, bitmap
, pos
, size
, style
, GetExtraStyle() ));
56 MacPostControlCreate( pos
, size
);
61 wxSize
wxBitmapButton::DoGetBestSize() const
63 wxSize
best(m_marginX
, m_marginY
);
67 if ( GetBitmapLabel().IsOk() )
69 best
+= GetBitmapLabel().GetSize();
75 #endif // wxUSE_BMPBUTTON