// This function is called throughout the duration of the panning/inertia gesture bool CGestures::ProcessMove(HWND hWnd, const LONG ldx, const LONG ldy) { bool lbSent = false; if (ldy) { CVConGuard VCon; CRealConsole* pRCon = (CVConGroup::GetActiveVCon(&VCon) >= 0) ? VCon->RCon() : NULL; if (pRCon) { TODO("Если можно будет задавать разный шрифт для разных консолей - заменить gpSet->FontSizeY"); // Соотнести Pan с высотой шрифта int dy = ((ldy < 0) ? -ldy : ldy) / gpSet->FontSizeY; if (dy > 0) { short Delta = ((ldy < 0) ? -120 : 120) * dy; #ifdef _DEBUG wchar_t szDbg[128]; _wsprintf(szDbg, SKIPLEN(countof(szDbg)) L" ProcessMove(%i,%i), WheelDelta=%i\n", ldx, ldy, (int)Delta); DEBUGSTRPAN(szDbg); #endif POINT pt = _ptBegin; if (hWnd != VCon->GetView()) MapWindowPoints(hWnd, VCon->GetView(), &pt, 1); pRCon->OnMouse(WM_MOUSEWHEEL, MAKELPARAM(0,Delta), pt.x, pt.y, true, true); lbSent = true; // Запомнить обработанную координату } } } return lbSent; }
void CGestures::SendRClick(HWND hWnd, const LONG ldx, const LONG ldy) { CVConGuard VCon; CRealConsole* pRCon = (CVConGroup::GetActiveVCon(&VCon) >= 0) ? VCon->RCon() : NULL; if (pRCon) { POINT pt = {ldx, ldy}; if (hWnd != VCon->GetView()) MapWindowPoints(hWnd, VCon->GetView(), &pt, 1); pRCon->OnMouse(WM_RBUTTONDOWN, MK_RBUTTON, pt.x, pt.y); pRCon->OnMouse(WM_RBUTTONUP, 0, pt.x, pt.y); } }