#include <stdio.h>
#endif
+#define DEBUG_PRINTF(NAME) { static int raz=0; \
+ printf( #NAME " %i\n",raz); fflush(stdout); \
+ raz++; \
+ }
+
#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
, WXWORD WXUNUSED(uId)
)
{
+
+DEBUG_PRINTF(wxWindow::OS2Command);
+
return(FALSE);
}
m_lLastMouseY = -1;
m_nLastMouseEvent = -1;
#endif // wxUSE_MOUSEEVENT_HACK
+
+DEBUG_PRINTF(wxWindow::Init-End);
+
} // wxWindow::Init
//
//
wxWindow::~wxWindow()
{
+DEBUG_PRINTF(wxWindow::~wxWindow-Start);
m_isBeingDeleted = TRUE;
OS2DetachWindowMenu();
//
wxRemoveHandleAssociation(this);
}
+DEBUG_PRINTF(wxWindow::~wxWindow-End);
} // end of wxWindow::~wxWindow
bool wxWindow::Create(
const wxFont& rFont
)
{
+DEBUG_PRINTF(wxWindow::SetFont);
if (!wxWindowBase::SetFont(rFont))
{
// nothing to do
, WXLPARAM lParam
)
{
+DEBUG_PRINTF(wxWindow::OS2DefWindowProc);
+
if (m_fnOldWndProc)
return (MRESULT)m_fnOldWndProc(GetHWND(), (ULONG)uMsg, (MPARAM)wParam, (MPARAM)lParam);
else
{
QMSG* pQMsg = (QMSG*)pMsg;
+DEBUG_PRINTF(OS2ProcessMessage);
+
if (m_hWnd != 0 && (GetWindowStyleFlag() & wxTAB_TRAVERSAL))
{
//
WXMSG* pMsg
)
{
- return m_acceleratorTable.Translate(m_hWnd, pMsg);
+#if wxUSE_ACCEL
+ return m_acceleratorTable.Translate(m_hWnd, pMsg);
+#else
+ return FALSE;
+#endif //wxUSE_ACCEL
} // end of wxWindow::OS2TranslateMessage
// ---------------------------------------------------------------------------
// Trace all ulMsgs - useful for the debugging
//
#ifdef __WXDEBUG__
+DEBUG_PRINTF(__WXDEBUG__wxWndProc);
wxLogTrace(wxTraceMessages, wxT("Processing %s(wParam=%8lx, lParam=%8lx)"),
wxGetMessageName(ulMsg), wParam, lParam);
#endif // __WXDEBUG__
break;
case WM_PAINT:
+DEBUG_PRINTF(WM_PAINT)
bProcessed = HandlePaint();
break;
//
bProcessed = TRUE;
mResult = (MRESULT)TRUE;
+DEBUG_PRINTF(WM_CLOSE)
break;
case WM_SHOW:
+DEBUG_PRINTF(WM_SHOW)
bProcessed = HandleShow(wParam != 0, (int)lParam);
break;
{
WORD id, cmd;
WXHWND hwnd;
+DEBUG_PRINTF(WM_COMMAND-in)
UnpackCommand(wParam, lParam, &id, &hwnd, &cmd);
bProcessed = HandleCommand(id, cmd, hwnd);
+DEBUG_PRINTF(WM_COMMAND-out)
}
break;
wxAssociateWinWithHandle((HWND)m_hWnd
,this
);
- //
+ //
// Now need to subclass window.
//
wxLogLastError("CreateRectRgn");
return FALSE;
}
+ //
+ // Debug code
+ //
+#ifdef __WXDEBUG__
+ {
+ HWND hWnd;
+ HWND hWnd0 = NULLHANDLE;
+
+ hWnd = GetHwnd();
+ if(hWnd != hWnd0)
+ printf("HandlePaint hWnd=%x ",hWnd);
+ }
+#endif
+
m_updateRegion = wxRegion(hRgn);
-/*
- hPS = WinBeginPaint(GetHWND(), 0L, &vRect);
- WinFillRect(hPS, &vRect, SYSCLR_WINDOW);
- WinEndPaint(hPS);
-*/
vEvent.SetEventObject(this);
return (GetEventHandler()->ProcessEvent(vEvent));
} // end of wxWindow::HandlePaint
pWin->ScreenToClient(pX, pY);
} // end of TranslateKbdEventToMouse
+// Find the wxWindow at the current mouse position, returning the mouse
+// position.
+wxWindow* wxFindWindowAtPointer(
+ wxPoint& rPt
+)
+{
+ return wxFindWindowAtPoint(wxGetMousePosition());
+}
+
+wxWindow* wxFindWindowAtPoint(
+ const wxPoint& rPt
+)
+{
+ POINTL vPt2;
+
+ vPt2.x = rPt.x;
+ vPt2.y = rPt.y;
+
+ HWND hWndHit = ::WinWindowFromPoint(HWND_DESKTOP, &vPt2, FALSE);
+ wxWindow* pWin = wxFindWinFromHandle((WXHWND)hWndHit) ;
+ HWND hWnd = hWndHit;
+
+ //
+ // Try to find a window with a wxWindow associated with it
+ //
+ while (!pWin && (hWnd != 0))
+ {
+ hWnd = ::WinQueryWindow(hWnd, QW_PARENT);
+ pWin = wxFindWinFromHandle((WXHWND)hWnd) ;
+ }
+ return pWin;
+}
+
+// Get the current mouse position.
+wxPoint wxGetMousePosition()
+{
+ POINTL vPt;
+
+ ::WinQueryPointerPos(HWND_DESKTOP, &vPt);
+ return wxPoint(vPt.x, vPt.y);
+}
+