diff options
author | Neil <nyamatongwe@gmail.com> | 2014-01-14 19:08:34 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-01-14 19:08:34 +1100 |
commit | 9ea7245b440aa3de91ff532ce102ea9fa7e34d6c (patch) | |
tree | c28dbc6f2d760773f6c3a849154ef80f22ffe707 | |
parent | 8c585027b90cf0281273fb4693afb097a956c53a (diff) | |
download | scintilla-mirror-9ea7245b440aa3de91ff532ce102ea9fa7e34d6c.tar.gz |
CallTipSetPosStart API added.
-rw-r--r-- | doc/ScintillaDoc.html | 6 | ||||
-rw-r--r-- | doc/ScintillaHistory.html | 5 | ||||
-rw-r--r-- | include/Scintilla.h | 1 | ||||
-rw-r--r-- | include/Scintilla.iface | 3 | ||||
-rw-r--r-- | src/ScintillaBase.cxx | 4 | ||||
-rw-r--r-- | test/simpleTests.py | 21 |
6 files changed, 37 insertions, 3 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 2a4c1f8b7..1aaab5307 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -82,7 +82,7 @@ <h1>Scintilla Documentation</h1> - <p>Last edited 10 January 2014 NH</p> + <p>Last edited 14 January 2014 NH</p> <p>There is <a class="jump" href="Design.html">an overview of the internal design of Scintilla</a>.<br /> @@ -4446,6 +4446,7 @@ struct Sci_TextToFind { <a class="message" href="#SCI_CALLTIPCANCEL">SCI_CALLTIPCANCEL</a><br /> <a class="message" href="#SCI_CALLTIPACTIVE">SCI_CALLTIPACTIVE</a><br /> <a class="message" href="#SCI_CALLTIPPOSSTART">SCI_CALLTIPPOSSTART</a><br /> + <a class="message" href="#SCI_CALLTIPSETPOSSTART">SCI_CALLTIPSETPOSSTART(int posStart)</a><br /> <a class="message" href="#SCI_CALLTIPSETHLT">SCI_CALLTIPSETHLT(int highlightStart, int highlightEnd)</a><br /> <a class="message" href="#SCI_CALLTIPSETBACK">SCI_CALLTIPSETBACK(int colour)</a><br /> @@ -4481,7 +4482,8 @@ struct Sci_TextToFind { This returns 1 if a call tip is active and 0 if it is not active.</p> <p><b id="SCI_CALLTIPPOSSTART">SCI_CALLTIPPOSSTART</b><br /> - This message returns the value of the current position when <code>SCI_CALLTIPSHOW</code> + <b id="SCI_CALLTIPSETPOSSTART">SCI_CALLTIPSETPOSSTART(int posStart)</b><br /> + This message returns or sets the value of the current position when <code>SCI_CALLTIPSHOW</code> started to display the tip.</p> <p><b id="SCI_CALLTIPSETHLT">SCI_CALLTIPSETHLT(int hlStart, int hlEnd)</b><br /> diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index ec1e76982..1a96ad1db 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -459,7 +459,10 @@ Released 12 December 2013. </li> <li> - Added DropSelectionN API to drop a selection from a multiple selection. + DropSelectionN API added to drop a selection from a multiple selection. + </li> + <li> + CallTipSetPosStart API added to change the position at which backspacing removes the calltip. </li> <li> Basic lexer highlights hex, octal, and binary numbers in FreeBASIC which use the prefixes diff --git a/include/Scintilla.h b/include/Scintilla.h index 39171bad4..dda068d75 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -417,6 +417,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_CALLTIPCANCEL 2201 #define SCI_CALLTIPACTIVE 2202 #define SCI_CALLTIPPOSSTART 2203 +#define SCI_CALLTIPSETPOSSTART 2214 #define SCI_CALLTIPSETHLT 2204 #define SCI_CALLTIPSETBACK 2205 #define SCI_CALLTIPSETFORE 2206 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 7b38eb852..32a797251 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -1042,6 +1042,9 @@ fun bool CallTipActive=2202(,) # Retrieve the position where the caret was before displaying the call tip. fun position CallTipPosStart=2203(,) +# Set the start position in order to change when backspacing removes the calltip. +set void CallTipSetPosStart=2214(int posStart,) + # Highlight a segment of the definition. fun void CallTipSetHlt=2204(int start, int end) diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index ad45a5ad2..7850316e9 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -893,6 +893,10 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara case SCI_CALLTIPPOSSTART: return ct.posStartCallTip; + case SCI_CALLTIPSETPOSSTART: + ct.posStartCallTip = wParam; + break; + case SCI_CALLTIPSETHLT: ct.SetHighlight(wParam, lParam); break; diff --git a/test/simpleTests.py b/test/simpleTests.py index 151ee33e8..3ca01f569 100644 --- a/test/simpleTests.py +++ b/test/simpleTests.py @@ -1803,6 +1803,27 @@ class TestSubStyles(unittest.TestCase): inactiveDistance = self.ed.DistanceToSecondaryStyles() self.assertEquals(self.ed.GetPrimaryStyleFromStyle(self.ed.SCE_C_IDENTIFIER+inactiveDistance), self.ed.SCE_C_IDENTIFIER) +class TestCallTip(unittest.TestCase): + + def setUp(self): + self.xite = Xite.xiteFrame + self.ed = self.xite.ed + self.ed.ClearAll() + self.ed.EmptyUndoBuffer() + # 1 line of 4 characters + t = b"fun(" + self.ed.AddText(len(t), t) + + def testBasics(self): + self.assertEquals(self.ed.CallTipActive(), 0) + self.ed.CallTipShow(1, "fun(int x)") + self.assertEquals(self.ed.CallTipActive(), 1) + self.assertEquals(self.ed.CallTipPosStart(), 4) + self.ed.CallTipSetPosStart(1) + self.assertEquals(self.ed.CallTipPosStart(), 1) + self.ed.CallTipCancel() + self.assertEquals(self.ed.CallTipActive(), 0) + class TestAutoComplete(unittest.TestCase): def setUp(self): |