//------------------------------------------------------------------------------------------- // McoStatus LogoWin2::DoEvents(short item, Point clickPoint, WindowCode *wc, int32 *numwc, void **data, Boolean &changed) { EventRecord event; WindowPtr window; short thePart; Rect screenRect, updateRect; Point aPoint = {100, 100}; Boolean QuitFlag = FALSE; McoStatus status; Window_Events code2; Changed = FALSE; *numwc = 0; status = MCO_SUCCESS; if (TickCount() - tick_start > 100) tick_start = 0; if (item == TIMER_ITEM) // close the window { *numwc = 1; wc[0].code = WE_Close_Window; wc[0].wintype = WinType; wc[0].winnum = WinNum; wc[0].doc = 0L; } if (item == ids[QD3D_Zoom]) { Enable(dp,Current_Button); Disable(dp,ids[QD3D_Zoom]); Current_Button = item; } else if (item == ids[QD3D_Rotate]) { Enable(dp,Current_Button); Disable(dp,ids[QD3D_Rotate]); Current_Button = item; } else if (item == ids[QD3D_Translate]) { Enable(dp,Current_Button); Disable(dp,ids[QD3D_Translate]); Current_Button = item; } else if (item == ids[QD3D_Info]) { Enable(dp,Current_Button); Disable(dp,ids[QD3D_Info]); Current_Button = item; } else if (item == ids[QD3D_Box]) { if (Current_Button == ids[QD3D_Rotate]) { code2 = WE_Rotate; } else if (Current_Button == ids[QD3D_Zoom]) { code2 = WE_Scale; } else if (Current_Button == ids[QD3D_Translate]) { code2 = WE_Translate; } else if (Current_Button == ids[QD3D_Info]) { status = get3Dinfo(clickPoint); } ProcessMouseDown(clickPoint,code2); } return status; }
LRESULT CMenuFocusManager::GetMsgHook(INT nCode, WPARAM hookWParam, LPARAM hookLParam) { BOOL isLButton = FALSE; if (nCode < 0) return CallNextHookEx(m_hGetMsgHook, nCode, hookWParam, hookLParam); if (nCode == HC_ACTION) { BOOL callNext = TRUE; MSG* msg = reinterpret_cast<MSG*>(hookLParam); POINT pt = msg->pt; switch (msg->message) { case WM_CAPTURECHANGED: if (m_captureHwnd) { TRACE("Capture lost.\n"); m_captureHwnd = NULL; } break; case WM_NCLBUTTONDOWN: case WM_LBUTTONDOWN: isLButton = TRUE; TRACE("LB\n"); // fallthrough; case WM_NCRBUTTONDOWN: case WM_RBUTTONDOWN: if (m_menuBar && m_current->type == MenuPopupEntry) { POINT pt = msg->pt; HWND child = WindowFromPoint(pt); BOOL hoveringMenuBar = m_menuBar->mb->IsWindowOwner(child) == S_OK; if (hoveringMenuBar) { m_current->mb->_MenuItemSelect(MPOS_FULLCANCEL); break; } } if (m_current->type == MenuPopupEntry) { HWND child = WindowFromPoint(pt); if (IsTrackedWindowOrParent(child) != S_OK) { m_current->mb->_MenuItemSelect(MPOS_FULLCANCEL); break; } } ProcessMouseDown(msg, isLButton); break; case WM_NCLBUTTONUP: case WM_LBUTTONUP: ProcessMouseUp(msg); break; case WM_MOUSEMOVE: callNext = ProcessMouseMove(msg); break; case WM_MOUSELEAVE: callNext = ProcessMouseMove(msg); //callNext = ProcessMouseLeave(msg); break; case WM_SYSKEYDOWN: case WM_KEYDOWN: if (m_current->type == MenuPopupEntry) { DisableMouseTrack(m_current->hwnd, TRUE); switch (msg->wParam) { case VK_ESCAPE: case VK_MENU: case VK_LMENU: case VK_RMENU: m_current->mb->_MenuItemSelect(MPOS_FULLCANCEL); break; case VK_RETURN: m_current->mb->_MenuItemSelect(MPOS_EXECUTE); break; case VK_LEFT: m_current->mb->_MenuItemSelect(VK_LEFT); break; case VK_RIGHT: m_current->mb->_MenuItemSelect(VK_RIGHT); break; case VK_UP: m_current->mb->_MenuItemSelect(VK_UP); break; case VK_DOWN: m_current->mb->_MenuItemSelect(VK_DOWN); break; } msg->message = WM_NULL; msg->lParam = 0; msg->wParam = 0; } break; } if (!callNext) return 1; } return CallNextHookEx(m_hGetMsgHook, nCode, hookWParam, hookLParam); }