X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a086de984d366b97e91b39aaba7acd84430d963a..09d350c0bc105653e7cd59a8290684a3c4e70d7e:/src/os2/checkbox.cpp diff --git a/src/os2/checkbox.cpp b/src/os2/checkbox.cpp index 720eff958e..83480a8ef2 100644 --- a/src/os2/checkbox.cpp +++ b/src/os2/checkbox.cpp @@ -29,6 +29,10 @@ IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox) +extern void wxAssociateWinWithHandle( HWND hWnd + ,wxWindowOS2* pWin + ); + // ============================================================================ // implementation // ============================================================================ @@ -58,35 +62,44 @@ bool wxCheckBox::Create( , const wxPoint& rPos , const wxSize& rSize , long lStyle -#if wxUSE_VALIDATORS , const wxValidator& rValidator -#endif , const wxString& rsName ) { + LONG lColor; + bool bOk; + if (!CreateControl( pParent ,vId ,rPos ,rSize ,lStyle -#if wxUSE_VALIDATORS - ,wxDefaultValidator -#endif + ,rValidator ,rsName )) return FALSE; + long osStyle = BS_AUTOCHECKBOX | WS_TABSTOP | WS_VISIBLE; - return OS2CreateControl( wxT("BUTTON") - ,osStyle - ,rPos - ,rSize - ,rsLabel - ,0 - ); + bOk = OS2CreateControl( wxT("BUTTON") + ,osStyle + ,rPos + ,rSize + ,rsLabel + ,0 + ); + m_backgroundColour = pParent->GetBackgroundColour(); + lColor = (LONG)m_backgroundColour.GetPixel(); + ::WinSetPresParam( m_hWnd + ,PP_BACKGROUNDCOLOR + ,sizeof(LONG) + ,(PVOID)&lColor + ); + wxAssociateWinWithHandle(m_hWnd, this); + return bOk; } // end of wxCheckBox::Create void wxCheckBox::SetLabel( @@ -175,9 +188,7 @@ bool wxBitmapCheckBox::Create( , const wxPoint& rPos , const wxSize& rSize , long lStyle -#if wxUSE_VALIDATORS , const wxValidator& rValidator -#endif , const wxString& rsName ) {