+void wxStaticBitmap::SetImage(
+ const wxGDIImage& rBitmap
+)
+{
+ Free();
+
+ m_bIsIcon = rBitmap.IsKindOf(CLASSINFO(wxIcon));
+ if (m_bIsIcon)
+ m_pImage = new wxIcon((const wxIcon&)rBitmap);
+ else
+ m_pImage = new wxBitmap((const wxBitmap &)rBitmap);
+
+ int nX;
+ int nY;
+ int nW;
+ int nH;
+
+ GetPosition(&nX, &nY);
+ GetSize(&nW, &nH);
+
+ ::WinSendMsg( GetHwnd()
+ ,SM_SETHANDLE
+ ,MPFROMHWND(m_pImage->GetHandle())
+ ,NULL
+ );
+ if (ImageIsOk())
+ {
+ int nWidth = rBitmap.GetWidth();
+ int nHeight = rBitmap.GetHeight();
+
+ if (nWidth && nHeight)
+ {
+ nW = nWidth;
+ nW = nHeight;
+
+ ::WinSetWindowPos( GetHwnd()
+ ,HWND_TOP
+ ,nX
+ ,nY
+ ,nWidth
+ ,nHeight
+ ,SWP_SIZE | SWP_MOVE | SWP_SHOW
+ );
+ }
+ }
+
+ RECTL vRect;
+
+ vRect.xLeft = nW;
+ vRect.yTop = nY;
+ vRect.xRight = nX + nW;
+ vRect.yBottom = nY + nH;
+
+ ::WinInvalidateRect(GetHwndOf(GetParent()), &vRect, TRUE);
+}
+
+MRESULT wxStaticBitmap::OS2WindowProc(
+ WXUINT uMsg
+, WXWPARAM wParam
+, WXLPARAM lParam
+)
+{
+ return wxWindow::OS2WindowProc(uMsg, wParam, lParam);
+} // end of wxStaticBitmap::OS2WindowProc