]>
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
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
16 #include "wx/bmpbuttn.h"
20 #include "wx/dcmemory.h"
23 #include "wx/osx/private.h"
25 //---------------------------------------------------------------------------
27 bool wxBitmapButton::Create( wxWindow
*parent
,
29 const wxBitmap
& bitmap
,
33 const wxValidator
& validator
,
34 const wxString
& name
)
38 if ( !wxBitmapButtonBase::Create(parent
, id
, pos
, size
, style
,
42 if ( style
& wxBU_AUTODRAW
)
45 m_marginY
= wxDEFAULT_BUTTON_MARGIN
;
53 m_bitmaps
[State_Normal
] = bitmap
;
55 SetPeer(wxWidgetImpl::CreateBitmapButton( this, parent
, id
, bitmap
, pos
, size
, style
, GetExtraStyle() ));
57 MacPostControlCreate( pos
, size
);
62 wxSize
wxBitmapButton::DoGetBestSize() const
64 wxSize
best(m_marginX
, m_marginY
);
68 if ( GetBitmapLabel().IsOk() )
70 best
+= GetBitmapLabel().GetSize();
76 #endif // wxUSE_BMPBUTTON