From 1d772be5dea42ff8cd8632806589bbc92effec35 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 3 Jul 2009 06:36:25 +0000 Subject: Use screen point for caret that includes virtual spcace so that, for example, the IME appears near the caret when the caret is in virtual space. Changed LocationFromPosition to work on a SelectionPosition and added convenience method for finding screen point of main caret. --- win32/ScintillaWin.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'win32') diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 9c8036aa9..248ae0d3d 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -524,7 +524,7 @@ sptr_t ScintillaWin::HandleComposition(uptr_t wParam, sptr_t lParam) { } } // Set new position after converted - Point pos = LocationFromPosition(sel.MainCaret()); + Point pos = PointMainCaret(); COMPOSITIONFORM CompForm; CompForm.dwStyle = CFS_POINT; CompForm.ptCurrentPos.x = pos.x; @@ -904,7 +904,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam Point pt = Point::FromLong(lParam); if ((pt.x == -1) && (pt.y == -1)) { // Caused by keyboard so display menu near caret - pt = LocationFromPosition(sel.MainCaret()); + pt = PointMainCaret(); POINT spt = {pt.x, pt.y}; ::ClientToScreen(MainHWND(), &spt); pt = Point(spt.x, spt.y); @@ -1136,7 +1136,7 @@ void ScintillaWin::UpdateSystemCaret() { DestroySystemCaret(); CreateSystemCaret(); } - Point pos = LocationFromPosition(sel.MainCaret()); + Point pos = PointMainCaret(); ::SetCaretPos(pos.x, pos.y); } } @@ -1817,7 +1817,7 @@ void ScintillaWin::ImeStartComposition() { if (caret.active) { // Move IME Window to current caret position HIMC hIMC = ::ImmGetContext(MainHWND()); - Point pos = LocationFromPosition(sel.MainCaret()); + Point pos = PointMainCaret(); COMPOSITIONFORM CompForm; CompForm.dwStyle = CFS_POINT; CompForm.ptCurrentPos.x = pos.x; -- cgit v1.2.3