- LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT) item;
-
- wxBitmap* bitmap = &m_buttonBitmap;
-
- UINT state = lpDIS->itemState;
- if ((state & ODS_SELECTED) && m_buttonBitmapSelected.Ok())
- bitmap = &m_buttonBitmapSelected;
- else if ((state & ODS_FOCUS) && m_buttonBitmapFocus.Ok())
- bitmap = &m_buttonBitmapFocus;
- else if ((state & ODS_DISABLED) && m_buttonBitmapDisabled.Ok())
- bitmap = &m_buttonBitmapDisabled;
-
- if ( !bitmap->Ok() )
- return FALSE;
-
- HDC hDC = lpDIS->hDC;
- HDC memDC = ::CreateCompatibleDC(hDC);
-
- HBITMAP old = (HBITMAP) ::SelectObject(memDC, (HBITMAP) bitmap->GetHBITMAP());
-
- if (!old)
- return FALSE;
-
- int x = lpDIS->rcItem.left;
- int y = lpDIS->rcItem.top;
- int width = lpDIS->rcItem.right - x;
- int height = lpDIS->rcItem.bottom - y;
-
- // Draw the face, if auto-drawing
- if ( GetWindowStyleFlag() & wxBU_AUTODRAW )
- DrawFace((WXHDC) hDC, lpDIS->rcItem.left, lpDIS->rcItem.top, lpDIS->rcItem.right, lpDIS->rcItem.bottom,
- ((state & ODS_SELECTED) == ODS_SELECTED));
-
- // Centre the bitmap in the control area
- int x1 = (int) (x + ((width - bitmap->GetWidth()) / 2));
- int y1 = (int) (y + ((height - bitmap->GetHeight()) / 2));
-
- if ( (state & ODS_SELECTED) && (GetWindowStyleFlag() & wxBU_AUTODRAW) )
- {
- x1 ++;
- y1 ++;
- }
-
- wxMask *mask = bitmap->GetMask();
- if ( mask )
- {
- ::MaskBlt(hDC, x1, y1, bitmap->GetWidth(), bitmap->GetHeight(), // dst
- memDC, 0, 0, // src
- (HBITMAP)mask->GetMaskBitmap(), 0, 0, // mask
- MAKEROP4(SRCPAINT, SRCCOPY));
- }
- else
- {
- ::BitBlt(hDC, x1, y1, bitmap->GetWidth(), bitmap->GetHeight(), // dst
- memDC, 0, 0, // src
- SRCCOPY);
- }
-
- if ( (state & ODS_DISABLED) && (GetWindowStyleFlag() & wxBU_AUTODRAW) )
- DrawButtonDisable( (WXHDC) hDC, lpDIS->rcItem.left, lpDIS->rcItem.top, lpDIS->rcItem.right, lpDIS->rcItem.bottom, TRUE ) ;
- else if ( (state & ODS_FOCUS) && (GetWindowStyleFlag() & wxBU_AUTODRAW) )
- DrawButtonFocus( (WXHDC) hDC, lpDIS->rcItem.left, lpDIS->rcItem.top, lpDIS->rcItem.right, lpDIS->rcItem.bottom, ((state & ODS_SELECTED) == ODS_SELECTED));
-
- ::SelectObject(memDC, old);
-
- ::DeleteDC(memDC);
-
- return TRUE;
-}
-
-void wxBitmapButton::DrawFace( WXHDC dc, int left, int top, int right, int bottom, bool sel )
+// ----------------------------------------------------------------------------
+// macros
+// ----------------------------------------------------------------------------
+
+BEGIN_EVENT_TABLE(wxBitmapButton, wxBitmapButtonBase)
+ EVT_SYS_COLOUR_CHANGED(wxBitmapButton::OnSysColourChanged)
+END_EVENT_TABLE()
+
+/*
+TODO PROPERTIES :
+
+long "style" , wxBU_AUTODRAW
+bool "default" , 0
+bitmap "selected" ,
+bitmap "focus" ,
+bitmap "disabled" ,
+*/
+
+bool wxBitmapButton::Create(wxWindow *parent,
+ wxWindowID id,
+ const wxBitmap& bitmap,
+ const wxPoint& pos,
+ const wxSize& size, long style,
+ const wxValidator& validator,
+ const wxString& name)