Backport AutoCCancelled event implementation from Scintilla CVS.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2662 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2008-06-08 14:38:01 +00:00
parent ca0de44c11
commit b7d6c80c47
3 changed files with 16 additions and 7 deletions

View File

@ -173,7 +173,7 @@ int ScintillaBase::KeyCommand(unsigned int iMessage) {
return 0; return 0;
default: default:
ac.Cancel(); AutoCompleteCancel();
} }
} }
@ -287,6 +287,13 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
} }
void ScintillaBase::AutoCompleteCancel() { void ScintillaBase::AutoCompleteCancel() {
if (ac.Active()) {
SCNotification scn = {0};
scn.nmhdr.code = SCN_AUTOCCANCELLED;
scn.wParam = 0;
scn.listType = 0;
NotifyParent(scn);
}
ac.Cancel(); ac.Cancel();
} }
@ -308,7 +315,7 @@ void ScintillaBase::AutoCompleteCharacterAdded(char ch) {
if (ac.IsFillUpChar(ch)) { if (ac.IsFillUpChar(ch)) {
AutoCompleteCompleted(); AutoCompleteCompleted();
} else if (ac.IsStopChar(ch)) { } else if (ac.IsStopChar(ch)) {
ac.Cancel(); AutoCompleteCancel();
} else { } else {
AutoCompleteMoveToCurrentWord(); AutoCompleteMoveToCurrentWord();
} }
@ -316,9 +323,9 @@ void ScintillaBase::AutoCompleteCharacterAdded(char ch) {
void ScintillaBase::AutoCompleteCharacterDeleted() { void ScintillaBase::AutoCompleteCharacterDeleted() {
if (currentPos < ac.posStart - ac.startLen) { if (currentPos < ac.posStart - ac.startLen) {
ac.Cancel(); AutoCompleteCancel();
} else if (ac.cancelAtStartPos && (currentPos <= ac.posStart)) { } else if (ac.cancelAtStartPos && (currentPos <= ac.posStart)) {
ac.Cancel(); AutoCompleteCancel();
} else { } else {
AutoCompleteMoveToCurrentWord(); AutoCompleteMoveToCurrentWord();
} }
@ -331,7 +338,7 @@ void ScintillaBase::AutoCompleteCompleted() {
if (item != -1) { if (item != -1) {
ac.lb->GetValue(item, selected, sizeof(selected)); ac.lb->GetValue(item, selected, sizeof(selected));
} else { } else {
ac.Cancel(); AutoCompleteCancel();
return; return;
} }
@ -378,7 +385,7 @@ int ScintillaBase::AutoCompleteGetCurrent() {
} }
void ScintillaBase::CallTipShow(Point pt, const char *defn) { void ScintillaBase::CallTipShow(Point pt, const char *defn) {
AutoCompleteCancel(); ac.Cancel();
pt.y += vs.lineHeight; pt.y += vs.lineHeight;
// If container knows about STYLE_CALLTIP then use it in place of the // 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 // STYLE_DEFAULT for the face name, size and character set. Also use it
@ -518,7 +525,7 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
break; break;
case SCI_AUTOCCANCEL: case SCI_AUTOCCANCEL:
AutoCompleteCancel(); ac.Cancel();
break; break;
case SCI_AUTOCACTIVE: case SCI_AUTOCACTIVE:

View File

@ -750,6 +750,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCN_AUTOCSELECTION 2022 #define SCN_AUTOCSELECTION 2022
#define SCN_INDICATORCLICK 2023 #define SCN_INDICATORCLICK 2023
#define SCN_INDICATORRELEASE 2024 #define SCN_INDICATORRELEASE 2024
#define SCN_AUTOCCANCELLED 2025
/*--Autogenerated -- end of section automatically generated from Scintilla.iface */ /*--Autogenerated -- end of section automatically generated from Scintilla.iface */
/* These structures are defined to be exactly the same shape as the Win32 /* These structures are defined to be exactly the same shape as the Win32

View File

@ -3322,6 +3322,7 @@ evt void CallTipClick=2021(int position)
evt void AutoCSelection=2022(string text) evt void AutoCSelection=2022(string text)
evt void IndicatorClick=2023(int modifiers, int position) evt void IndicatorClick=2023(int modifiers, int position)
evt void IndicatorRelease=2024(int modifiers, int position) evt void IndicatorRelease=2024(int modifiers, int position)
evt void AutoCCancelled=2025(void)
cat Deprecated cat Deprecated