diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ScintillaBase.cxx | 51 | ||||
-rw-r--r-- | src/ScintillaBase.h | 1 |
2 files changed, 27 insertions, 25 deletions
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 27179bcdc..d2927fa9d 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -345,6 +345,29 @@ void ScintillaBase::AutoCompleteCompleted() { pdoc->EndUndoAction(); } +void ScintillaBase::CallTipShow(Point pt, const char *defn) { + AutoCompleteCancel(); + pt.y += vs.lineHeight; + PRectangle rc = ct.CallTipStart(currentPos, pt, + defn, + vs.styles[STYLE_DEFAULT].fontName, + vs.styles[STYLE_DEFAULT].sizeZoomed, + IsUnicodeMode(), + wMain); + // If the call-tip window would be out of the client + // space, adjust so it displays above the text. + PRectangle rcClient = GetClientRectangle(); + if (rc.bottom > rcClient.bottom) { + int offset = vs.lineHeight + rc.Height(); + rc.top -= offset; + rc.bottom -= offset; + } + // Now display the window. + CreateCallTipWindow(rc); + ct.wCallTip.SetPositionRelative(rc, wMain); + ct.wCallTip.Show(); +} + void ScintillaBase::CallTipClick() { SCNotification scn; scn.nmhdr.code = SCN_CALLTIPCLICK; @@ -533,31 +556,9 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara case SCI_AUTOCGETTYPESEPARATOR: return ac.GetTypesep(); - case SCI_CALLTIPSHOW: { - AutoCompleteCancel(); - //if (!ct.wCallTip.Created()) { - Point pt = LocationFromPosition(wParam); - pt.y += vs.lineHeight; - PRectangle rc = ct.CallTipStart(currentPos, pt, - reinterpret_cast<char *>(lParam), - vs.styles[STYLE_DEFAULT].fontName, - vs.styles[STYLE_DEFAULT].sizeZoomed, - IsUnicodeMode(), - wMain); - // If the call-tip window would be out of the client - // space, adjust so it displays above the text. - PRectangle rcClient = GetClientRectangle(); - if (rc.bottom > rcClient.bottom) { - int offset = vs.lineHeight + rc.Height(); - rc.top -= offset; - rc.bottom -= offset; - } - // Now display the window. - CreateCallTipWindow(rc); - ct.wCallTip.SetPositionRelative(rc, wMain); - ct.wCallTip.Show(); - //} - } + case SCI_CALLTIPSHOW: + CallTipShow(LocationFromPosition(wParam), + reinterpret_cast<const char *>(lParam)); break; case SCI_CALLTIPCANCEL: diff --git a/src/ScintillaBase.h b/src/ScintillaBase.h index 152d49f53..bf0b92d57 100644 --- a/src/ScintillaBase.h +++ b/src/ScintillaBase.h @@ -72,6 +72,7 @@ protected: static void AutoCompleteDoubleClick(void* p); void CallTipClick(); + void CallTipShow(Point pt, const char *defn); virtual void CreateCallTipWindow(PRectangle rc) = 0; virtual void AddToPopUp(const char *label, int cmd=0, bool enabled=true) = 0; |