diff options
author | nyamatongwe <devnull@localhost> | 2001-05-14 07:07:03 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2001-05-14 07:07:03 +0000 |
commit | ab1d033a7867f4557948a9511e795add6d5242d9 (patch) | |
tree | 53dd12404e66094dee6fc11b359650de3716628f | |
parent | f2f4b9c5c4917528024a9e21337bc42438b6e349 (diff) | |
download | scintilla-mirror-ab1d033a7867f4557948a9511e795add6d5242d9.tar.gz |
When context menu caused by keyboard rather than mouse, show menu
near caret.
-rw-r--r-- | win32/ScintillaWin.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index c0756938b..2ab5db13c 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -610,7 +610,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam case WM_IME_COMPOSITION: if (lParam & GCS_RESULTSTR) { - Platform::DebugPrintf("Result\n"); + //Platform::DebugPrintf("Result\n"); } return ::DefWindowProc(wMain.GetID(), iMessage, wParam, lParam); @@ -622,7 +622,15 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam case WM_CONTEXTMENU: #ifdef TOTAL_CONTROL if (displayPopupMenu) { - ContextMenu(Point::FromLong(lParam)); + Point pt = Point::FromLong(lParam); + if ((pt.x == -1) && (pt.y == -1)) { + // Caused by keyboard so display menu near caret + pt = LocationFromPosition(currentPos); + POINT spt = {pt.x, pt.y}; + ::ClientToScreen(wMain.GetID(), &spt); + pt = Point(spt.x, spt.y); + } + ContextMenu(pt); return 0; } #endif |