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
This commit is contained in:
Stefan Neis
2006-01-06 22:31:00 +00:00
parent 154daa940e
commit 179db36df4

View File

@@ -24,7 +24,7 @@
#include <stdio.h> #include <stdio.h>
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// macors // macros
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl) 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") ); wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create static bitmap") );
m_pImage = ConvertImage(rBitmap); 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 // Subclass again for purposes of dialog editing mode
SubclassWin(m_hWnd); SubclassWin(m_hWnd);
@@ -193,13 +196,15 @@ void wxStaticBitmap::SetImage(
GetPosition(&nX, &nY); GetPosition(&nX, &nY);
GetSize(&nWidth, &nHeight); GetSize(&nWidth, &nHeight);
// Convert to OS/2 coordinate system
nY = wxWindow::GetOS2ParentHeight(GetParent()) - nY - nHeight;
RECTL vRect; RECTL vRect;
vRect.xLeft = nX; vRect.xLeft = nX;
vRect.yTop = nY; vRect.yTop = nY + nHeight;
vRect.xRight = nX + nWidth; vRect.xRight = nX + nWidth;
vRect.yBottom = nY + nHeight; vRect.yBottom = nY;
::WinInvalidateRect(GetHwndOf(GetParent()), &vRect, TRUE); ::WinInvalidateRect(GetHwndOf(GetParent()), &vRect, TRUE);
} }