]>
git.saurik.com Git - wxWidgets.git/blob - src/qt/bmpbuttn.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxBitmapButton
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "bmpbuttn.h"
16 #include "wx/bmpbuttn.h"
18 IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton
, wxButton
)
20 bool wxBitmapButton::Create(wxWindow
*parent
, wxWindowID id
, const wxBitmap
& bitmap
,
22 const wxSize
& size
, long style
,
23 const wxValidator
& validator
,
26 m_buttonBitmap
= bitmap
;
28 SetValidator(validator
);
29 parent
->AddChild(this);
31 m_backgroundColour
= parent
->GetDefaultBackgroundColour() ;
32 m_foregroundColour
= parent
->GetDefaultForegroundColour() ;
33 m_windowStyle
= style
;
43 m_windowId
= NewControlId();
47 if ( width
== -1 && bitmap
.Ok())
48 width
= bitmap
.GetWidth() + 2*m_marginX
;
50 if ( height
== -1 && bitmap
.Ok())
51 height
= bitmap
.GetHeight() + 2*m_marginY
;
53 /* TODO: create bitmap button
59 void wxBitmapButton::SetBitmapLabel(const wxBitmap
& bitmap
)
61 m_buttonBitmap
= bitmap
;