]>
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 // RCS-ID: $Id: bmpbuttn.cpp 54820 2008-07-29 20:04:11Z SC $
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 IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton
, wxButton
)
26 #include "wx/osx/private.h"
28 //---------------------------------------------------------------------------
30 bool wxBitmapButton::Create( wxWindow
*parent
,
32 const wxBitmap
& bitmap
,
36 const wxValidator
& validator
,
37 const wxString
& name
)
39 m_macIsUserPane
= false;
41 if ( !wxBitmapButtonBase::Create(parent
, id
, pos
, size
, style
,
45 if ( style
& wxBU_AUTODRAW
)
48 m_marginY
= wxDEFAULT_BUTTON_MARGIN
;
56 m_bitmaps
[State_Normal
] = bitmap
;
58 m_peer
= wxWidgetImpl::CreateBitmapButton( this, parent
, id
, bitmap
, pos
, size
, style
, GetExtraStyle() );
60 MacPostControlCreate( pos
, size
);
65 wxSize
wxBitmapButton::DoGetBestSize() const
67 wxSize
best(m_marginX
, m_marginY
);
71 if ( GetBitmapLabel().IsOk() )
73 best
+= GetBitmapLabel().GetSize();
79 #endif // wxUSE_BMPBUTTON