mirror of
https://github.com/leozide/leocad
synced 2025-01-17 18:11:42 +01:00
Update the cursor when the user presses the control key.
This commit is contained in:
parent
323b7f4b34
commit
592d3b2c23
2 changed files with 26 additions and 60 deletions
|
@ -69,13 +69,15 @@ LC_CURSOR_TYPE View::GetCursor(int Ptx, int Pty) const
|
|||
case LC_ACTION_ROTATE_VIEW:
|
||||
switch (m_Project->GetOverlayMode())
|
||||
{
|
||||
case LC_OVERLAY_X: return LC_CURSOR_ROTATEX;
|
||||
case LC_OVERLAY_Y: return LC_CURSOR_ROTATEY;
|
||||
case LC_OVERLAY_Z: return LC_CURSOR_ROLL;
|
||||
case LC_OVERLAY_XYZ: return LC_CURSOR_ROTATE_VIEW;
|
||||
case LC_OVERLAY_X:
|
||||
return LC_CURSOR_ROTATEX;
|
||||
case LC_OVERLAY_Y:
|
||||
return LC_CURSOR_ROTATEY;
|
||||
case LC_OVERLAY_Z:
|
||||
return LC_CURSOR_ROLL;
|
||||
case LC_OVERLAY_XYZ:
|
||||
default:
|
||||
LC_ASSERT_FALSE("Unknown cursor type.");
|
||||
return LC_CURSOR_NONE;
|
||||
return LC_CURSOR_ROTATE_VIEW;
|
||||
}
|
||||
|
||||
case LC_ACTION_ROLL:
|
||||
|
|
|
@ -661,90 +661,54 @@ void CCADView::OnCaptureChanged(CWnd *pWnd)
|
|||
CView::OnCaptureChanged(pWnd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void CCADView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
|
||||
{
|
||||
char nKey = nChar;
|
||||
|
||||
switch (nChar)
|
||||
if (nChar >= VK_NUMPAD0 && nChar <= VK_NUMPAD9)
|
||||
{
|
||||
case VK_NUMPAD0 : case VK_NUMPAD1 : case VK_NUMPAD2 : case VK_NUMPAD3 : case VK_NUMPAD4 :
|
||||
case VK_NUMPAD5 : case VK_NUMPAD6 : case VK_NUMPAD7 : case VK_NUMPAD8 : case VK_NUMPAD9 :
|
||||
{
|
||||
nKey = nChar - VK_NUMPAD0 + 0x30;
|
||||
} break;
|
||||
|
||||
// select the next/previous piece on the pieces list
|
||||
case VK_HOME:
|
||||
case VK_END:
|
||||
{
|
||||
/*
|
||||
CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd ();
|
||||
CPiecesList& pList = pMain->m_wndPiecesBar.m_wndPiecesList;
|
||||
LV_FINDINFO lvfi;
|
||||
int sel;
|
||||
|
||||
lvfi.flags = LVFI_PARAM;
|
||||
lvfi.lParam = (LPARAM)pMain->m_wndPiecesBar.m_wndPiecePreview.GetPieceInfo ();
|
||||
sel = pList.FindItem (&lvfi);
|
||||
|
||||
if (sel != -1)
|
||||
{
|
||||
if (nChar == VK_HOME)
|
||||
sel--;
|
||||
else
|
||||
sel++;
|
||||
|
||||
pList.SetItemState (sel, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED);
|
||||
pList.EnsureVisible (sel, FALSE);
|
||||
}
|
||||
*/
|
||||
} break;
|
||||
nKey = nChar - VK_NUMPAD0 + '0';
|
||||
}
|
||||
|
||||
lcGetActiveProject()->OnKeyDown(nKey, GetKeyState (VK_CONTROL) < 0, GetKeyState (VK_SHIFT) < 0);
|
||||
/*
|
||||
switch (nChar)
|
||||
// Update cursor for multiple selection.
|
||||
if (nChar == VK_CONTROL)
|
||||
{
|
||||
// HANDLE CTRL if action == pan/zoom
|
||||
case VK_CONTROL:
|
||||
if (m_nCurAction == ACTION_SELECT)
|
||||
if (lcGetActiveProject()->GetAction() == LC_ACTION_SELECT)
|
||||
{
|
||||
POINT pt;
|
||||
|
||||
GetCursorPos(&pt);
|
||||
CRect rc;
|
||||
GetWindowRect(rc);
|
||||
|
||||
if (rc.PtInRect(pt))
|
||||
OnSetCursor(this, HTCLIENT, 0);
|
||||
} break;
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
lcGetActiveProject()->OnKeyDown(nKey, GetKeyState (VK_CONTROL) < 0, GetKeyState (VK_SHIFT) < 0);
|
||||
|
||||
CView::OnKeyDown(nChar, nRepCnt, nFlags);
|
||||
}
|
||||
|
||||
void CCADView::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
|
||||
{
|
||||
/* if (nChar == VK_CONTROL)
|
||||
// Update cursor for multiple selection.
|
||||
if (nChar == VK_CONTROL)
|
||||
{
|
||||
// HANDLE CTRL if action == pan/zoom
|
||||
CCADDoc* pDoc = GetDocument();
|
||||
if (pDoc->m_nCurAction == ACTION_SELECT)
|
||||
if (lcGetActiveProject()->GetAction() == LC_ACTION_SELECT)
|
||||
{
|
||||
POINT pt;
|
||||
|
||||
GetCursorPos(&pt);
|
||||
CRect rc;
|
||||
GetWindowRect(rc);
|
||||
|
||||
if (rc.PtInRect(pt))
|
||||
OnSetCursor(this, HTCLIENT, 0);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
CView::OnKeyUp(nChar, nRepCnt, nFlags);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue