From 179db36df4193919216af2a4ad7d578508792ef3 Mon Sep 17 00:00:00 2001 From: Stefan Neis Date: Fri, 6 Jan 2006 22:31:00 +0000 Subject: [PATCH] Fixed sizing&positioning and an error in subclassing. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/os2/statbmp.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/os2/statbmp.cpp b/src/os2/statbmp.cpp index 47a890f2ae..304f45835e 100644 --- a/src/os2/statbmp.cpp +++ b/src/os2/statbmp.cpp @@ -24,7 +24,7 @@ #include // --------------------------------------------------------------------------- -// macors +// macros // --------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl) @@ -121,7 +121,10 @@ bool wxStaticBitmap::Create( wxWindow* pParent, } wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create static bitmap") ); m_pImage = ConvertImage(rBitmap); - m_pImage->SetHandle((WXHWND)::WinSendMsg(m_hWnd, SM_QUERYHANDLE, (MPARAM)0, (MPARAM)0)); + ::WinSendMsg( m_hWnd, + SM_SETHANDLE, + MPFROMHWND(rBitmap.GetHandle()), + (MPARAM)0); // Subclass again for purposes of dialog editing mode SubclassWin(m_hWnd); @@ -193,13 +196,15 @@ void wxStaticBitmap::SetImage( GetPosition(&nX, &nY); GetSize(&nWidth, &nHeight); + // Convert to OS/2 coordinate system + nY = wxWindow::GetOS2ParentHeight(GetParent()) - nY - nHeight; RECTL vRect; vRect.xLeft = nX; - vRect.yTop = nY; + vRect.yTop = nY + nHeight; vRect.xRight = nX + nWidth; - vRect.yBottom = nY + nHeight; + vRect.yBottom = nY; ::WinInvalidateRect(GetHwndOf(GetParent()), &vRect, TRUE); } -- 2.45.2