diff options
author | Sébastien Granjoux <seb.sfo@free.fr> | 2011-09-23 23:16:12 +0200 |
---|---|---|
committer | Sébastien Granjoux <seb.sfo@free.fr> | 2011-09-23 23:16:12 +0200 |
commit | c89ae1e2153477f2d369b82dacafa10cd417c704 (patch) | |
tree | 212fce702cde5bf0ceafedbd7bd115d267cef200 /src/ScintillaBase.cxx | |
parent | a407a6330fa1d41aecc2816cf5f079bac5dd3304 (diff) | |
download | scintilla-mirror-c89ae1e2153477f2d369b82dacafa10cd417c704.tar.gz |
Allow to display calltip above or below the text
Diffstat (limited to 'src/ScintillaBase.cxx')
-rw-r--r-- | src/ScintillaBase.cxx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 0f1c9cda3..e6f208ccc 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -400,7 +400,6 @@ int ScintillaBase::AutoCompleteGetCurrentText(char *buffer) { void ScintillaBase::CallTipShow(Point pt, const char *defn) { ac.Cancel(); - pt.y += vs.lineHeight; // If container knows about STYLE_CALLTIP then use it in place of the // STYLE_DEFAULT for the face name, size and character set. Also use it // for the foreground and background colour. @@ -409,6 +408,7 @@ void ScintillaBase::CallTipShow(Point pt, const char *defn) { ct.SetForeBack(vs.styles[STYLE_CALLTIP].fore, vs.styles[STYLE_CALLTIP].back); } PRectangle rc = ct.CallTipStart(sel.MainCaret(), pt, + vs.lineHeight, defn, vs.styles[ctStyle].fontName, vs.styles[ctStyle].sizeZoomed, @@ -417,10 +417,16 @@ void ScintillaBase::CallTipShow(Point pt, const char *defn) { vs.technology, wMain); // If the call-tip window would be out of the client - // space, adjust so it displays above the text. + // space PRectangle rcClient = GetClientRectangle(); + int offset = vs.lineHeight + rc.Height(); + // adjust so it displays below the text. + if (rc.top < rcClient.top) { + rc.top += offset; + rc.bottom += offset; + } + // adjust so it displays above the text. if (rc.bottom > rcClient.bottom) { - int offset = vs.lineHeight + rc.Height(); rc.top -= offset; rc.bottom -= offset; } @@ -814,6 +820,11 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara InvalidateStyleRedraw(); break; + case SCI_CALLTIPSETPOSITION: + ct.SetPosition((bool)wParam); + InvalidateStyleRedraw(); + break; + case SCI_USEPOPUP: displayPopupMenu = wParam != 0; break; |