// macros
// ----------------------------------------------------------------------------
+#if wxUSE_EXTENDED_RTTI
+IMPLEMENT_DYNAMIC_CLASS_XTI(wxButton, wxControl,"wx/button.h")
+
+WX_BEGIN_PROPERTIES_TABLE(wxButton)
+ WX_DELEGATE( OnClick , wxEVT_COMMAND_BUTTON_CLICKED , wxCommandEvent )
+ // default
+WX_END_PROPERTIES_TABLE()
+
+WX_BEGIN_HANDLERS_TABLE(wxButton)
+WX_END_HANDLERS_TABLE()
+
+WX_CONSTRUCTOR_5( wxButton , wxWindow* , Parent , wxWindowID , Id , wxString , Title , wxPoint , Position , wxSize , Size )
+
+
+#else
IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
+#endif
// this macro tries to adjust the default button height to a reasonable value
// using the char height as the base
static void DrawRect(HDC hdc, const RECT& r)
{
- MoveToEx(hdc, r.left, r.top, NULL);
- LineTo(hdc, r.right, r.top);
- LineTo(hdc, r.right, r.bottom);
- LineTo(hdc, r.left, r.bottom);
- LineTo(hdc, r.left, r.top);
+ wxDrawLine(hdc, r.left, r.top, r.right, r.top);
+ wxDrawLine(hdc, r.right, r.top, r.right, r.bottom);
+ wxDrawLine(hdc, r.right, r.bottom, r.left, r.bottom);
+ wxDrawLine(hdc, r.left, r.bottom, r.left, r.top);
}
void wxButton::MakeOwnerDrawn()
InflateRect(&r, -1, -1);
}
- MoveToEx(hdc, r.left, r.bottom, NULL);
- LineTo(hdc, r.right, r.bottom);
- LineTo(hdc, r.right, r.top - 1);
+ wxDrawLine(hdc, r.left, r.bottom, r.right, r.bottom);
+ wxDrawLine(hdc, r.right, r.bottom, r.right, r.top - 1);
(void)SelectObject(hdc, hpenWhite);
- MoveToEx(hdc, r.left, r.bottom - 1, NULL);
- LineTo(hdc, r.left, r.top);
- LineTo(hdc, r.right, r.top);
+ wxDrawLine(hdc, r.left, r.bottom - 1, r.left, r.top);
+ wxDrawLine(hdc, r.left, r.top, r.right, r.top);
(void)SelectObject(hdc, hpenLightGr);
- MoveToEx(hdc, r.left + 1, r.bottom - 2, NULL);
- LineTo(hdc, r.left + 1, r.top + 1);
- LineTo(hdc, r.right - 1, r.top + 1);
+ wxDrawLine(hdc, r.left + 1, r.bottom - 2, r.left + 1, r.top + 1);
+ wxDrawLine(hdc, r.left + 1, r.top + 1, r.right - 1, r.top + 1);
(void)SelectObject(hdc, hpenGrey);
- MoveToEx(hdc, r.left + 1, r.bottom - 1, NULL);
- LineTo(hdc, r.right - 1, r.bottom - 1);
- LineTo(hdc, r.right - 1, r.top);
+ wxDrawLine(hdc, r.left + 1, r.bottom - 1, r.right - 1, r.bottom - 1);
+ wxDrawLine(hdc, r.right - 1, r.bottom - 1, r.right - 1, r.top);
}
(void)SelectObject(hdc, hpenOld);