#include <stdio.h>
#endif
+#include "wx/os2/dcclient.h"
+
#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
QMSG s_currentMsg;
#if wxUSE_MENUS_NATIVE
-wxMenu* wxCurrentPopupMenu = NULL;
+extern wxMenu* wxCurrentPopupMenu;
#endif // wxUSE_MENUS_NATIVE
// ---------------------------------------------------------------------------
::WinUpdateWindow(GetHwnd());
} // end of wxWindowOS2::Update
-void wxWindowOS2::Freeze()
+void wxWindowOS2::DoFreeze()
{
::WinSendMsg(GetHwnd(), WM_VRNDISABLED, (MPARAM)0, (MPARAM)0);
} // end of wxWindowOS2::Freeze
-void wxWindowOS2::Thaw()
+void wxWindowOS2::DoThaw()
{
::WinSendMsg(GetHwnd(), WM_VRNENABLED, (MPARAM)TRUE, (MPARAM)0);
bool bIsWaiting = true;
int nHeight;
- // Protect against recursion
- if (wxCurrentPopupMenu)
- return false;
-
pMenu->SetInvokingWindow(this);
pMenu->UpdateUI();
DoGetSize(0,&nHeight);
nY = nHeight - nY;
}
- wxCurrentPopupMenu = pMenu;
::WinPopupMenu( hWndParent
,hWndOwner
::WinDispatchMsg(vHabmain, (PQMSG)&vMsg);
}
- wxCurrentPopupMenu = NULL;
pMenu->SetInvokingWindow(NULL);
return true;
} // end of wxWindowOS2::DoPopupMenu
WXDRAWITEMSTRUCT* pItemStruct )
{
#if wxUSE_OWNER_DRAWN
- wxDC vDc;
+ wxClientDC vDc(this);
#if wxUSE_MENUS_NATIVE
//
,pMeasureStruct->rclItem.xRight - pMeasureStruct->rclItem.xLeft
,pMeasureStruct->rclItem.yTop - pMeasureStruct->rclItem.yBottom
);
- vDc.SetHDC( hDC, false );
- vDc.SetHPS( pMeasureStruct->hps );
+
+ wxPMDCImpl *impl = (wxPMDCImpl*) vDc.GetImpl();
+ impl->SetHDC( hDC, false );
+ impl->SetHPS( pMeasureStruct->hps );
//
// Load the wxWidgets Pallete and set to RGB mode
//
wxPaintEvent& rEvent
)
{
- HDC hDC = (HDC)wxPaintDC::FindDCInCache((wxWindow*) rEvent.GetEventObject());
+ HDC hDC = (HDC)wxPaintDCImpl::FindDCInCache((wxWindow*) rEvent.GetEventObject());
if (hDC != 0)
{
if (vSwp.fl & SWP_MINIMIZE)
return true;
- wxDC vDC;
-
- vDC.m_hPS = (HPS)hDC; // this is really a PS
- vDC.SetWindow((wxWindow*)this);
+ wxClientDC vDC(this);
+ wxPMDCImpl *impl = (wxPMDCImpl*) vDC.GetImpl();
+ impl->SetHDC(hDC);
+ impl->SetHPS((HPS)hDC); // this is really a PS
wxEraseEvent vEvent(m_windowId, &vDC);
rc = HandleWindowEvent(vEvent);
- vDC.m_hPS = NULLHANDLE;
+ impl->SetHPS(NULLHANDLE);
return true;
} // end of wxWindowOS2::HandleEraseBkgnd
void wxWindowOS2::OnEraseBackground(wxEraseEvent& rEvent)
{
RECTL vRect;
- HPS hPS = rEvent.GetDC()->GetHPS();
+ wxPMDCImpl *impl = (wxPMDCImpl*) rEvent.GetDC()->GetImpl();
+ HPS hPS = impl->GetHPS();
APIRET rc;
LONG lColor = m_backgroundColour.GetPixel();