[NEW] (Author: Ben) Remove Calltip restriction from plugins side.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@701 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2010-11-13 23:49:39 +00:00
parent 3a6ebc0885
commit 45481e65af
2 changed files with 8 additions and 4 deletions

View File

@ -102,12 +102,13 @@ void FunctionCallTip::showPrevOverload() {
showCalltip(); showCalltip();
} }
void FunctionCallTip::close() { void FunctionCallTip::close()
if (!isVisible()) { {
if (!isVisible() || !_selfActivated)
return; return;
}
_pEditView->execute(SCI_CALLTIPCANCEL); _pEditView->execute(SCI_CALLTIPCANCEL);
_selfActivated = false;
_currentOverload = 0; _currentOverload = 0;
} }
@ -406,6 +407,7 @@ void FunctionCallTip::showCalltip()
_startPos = _curPos; _startPos = _curPos;
_pEditView->showCallTip(_startPos, textBuffer); _pEditView->showCallTip(_startPos, textBuffer);
_selfActivated = true;
if (highlightstart != highlightend) { if (highlightstart != highlightend) {
_pEditView->execute(SCI_CALLTIPSETHLT, highlightstart, highlightend); _pEditView->execute(SCI_CALLTIPSETHLT, highlightstart, highlightend);
} }

View File

@ -30,7 +30,8 @@ public:
FunctionCallTip(ScintillaEditView * pEditView) : _pEditView(pEditView), _pXmlKeyword(NULL), _curPos(0), _startPos(0), FunctionCallTip(ScintillaEditView * pEditView) : _pEditView(pEditView), _pXmlKeyword(NULL), _curPos(0), _startPos(0),
_curFunction(NULL), _currentNrOverloads(0), _currentOverload(0), _curFunction(NULL), _currentNrOverloads(0), _currentOverload(0),
_currentParam(0), _funcName(NULL), _currentParam(0), _funcName(NULL),
_start('('), _stop(')'), _param(','), _terminal(';'), _ignoreCase(true), _additionalWordChar(TEXT("")) _start('('), _stop(')'), _param(','), _terminal(';'), _ignoreCase(true),
_additionalWordChar(TEXT("")), _selfActivated(false)
{}; {};
~FunctionCallTip() {/* cleanup(); */}; ~FunctionCallTip() {/* cleanup(); */};
void setLanguageXML(TiXmlElement * pXmlKeyword); //set calltip keyword node void setLanguageXML(TiXmlElement * pXmlKeyword); //set calltip keyword node
@ -63,6 +64,7 @@ private:
TCHAR _terminal; TCHAR _terminal;
generic_string _additionalWordChar; generic_string _additionalWordChar;
bool _ignoreCase; bool _ignoreCase;
bool _selfActivated;
bool getCursorFunction(); //retrieve data about function at cursor. Returns true if a function was found. Calls loaddata if needed bool getCursorFunction(); //retrieve data about function at cursor. Returns true if a function was found. Calls loaddata if needed
bool loadFunction(); //returns true if the function can be found bool loadFunction(); //returns true if the function can be found