diff options
author | nyamatongwe <unknown> | 2000-04-10 13:52:17 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2000-04-10 13:52:17 +0000 |
commit | b8d276f517d68af5d173597c37fb9111c985de80 (patch) | |
tree | b8af678dd9e189e517668330c92aeab3ff5f0115 /src | |
parent | ff3e9e7e239217ae5247b1519090a5137e056f80 (diff) | |
download | scintilla-mirror-b8d276f517d68af5d173597c37fb9111c985de80.tar.gz |
Added get/set of separator character used when setting auto-completion list.
Message for selecting an element of the autocompletion list.
Diffstat (limited to 'src')
-rw-r--r-- | src/AutoComplete.cxx | 11 | ||||
-rw-r--r-- | src/AutoComplete.h | 7 | ||||
-rw-r--r-- | src/ScintillaBase.cxx | 11 |
3 files changed, 27 insertions, 2 deletions
diff --git a/src/AutoComplete.cxx b/src/AutoComplete.cxx index c3ec29c3c..75e26fe28 100644 --- a/src/AutoComplete.cxx +++ b/src/AutoComplete.cxx @@ -15,6 +15,7 @@ AutoComplete::AutoComplete() { active = false; posStart = 0; strcpy(stopChars, ""); + separator = ' '; } AutoComplete::~AutoComplete() { @@ -44,6 +45,14 @@ bool AutoComplete::IsStopChar(char ch) { return ch && strchr(stopChars, ch); } +void AutoComplete::SetSeparator(char separator_) { + separator = separator_; +} + +char AutoComplete::GetSeparator() { + return separator; +} + int AutoComplete::SetList(const char *list) { int maxStrLen = 12; lb.Clear(); @@ -53,7 +62,7 @@ int AutoComplete::SetList(const char *list) { char *startword = words; int i = 0; for (; words && words[i]; i++) { - if (words[i] == ' ') { + if (words[i] == separator) { words[i] = '\0'; lb.Append(startword); maxStrLen = Platform::Maximum(maxStrLen, strlen(startword)); diff --git a/src/AutoComplete.h b/src/AutoComplete.h index 10216027b..e4f8ade0d 100644 --- a/src/AutoComplete.h +++ b/src/AutoComplete.h @@ -9,6 +9,7 @@ class AutoComplete { bool active; char stopChars[256]; + char separator; public: ListBox lb; int posStart; @@ -27,7 +28,11 @@ public: void SetStopChars(const char *stopChars_); bool IsStopChar(char ch); - // The list string contains a sequence of words separated by spaces + // The separator character is used when interpreting the list in SetList + void SetSeparator(char separator_); + char GetSeparator(); + + // The list string contains a sequence of words separated by the separator character int SetList(const char *list); void Show(); diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 80ef3097b..972e4fbff 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -324,9 +324,20 @@ LRESULT ScintillaBase::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam) { AutoCompleteCompleted(); break; + case SCI_AUTOCSETSEPARATOR: + ac.SetSeparator(wParam); + break; + + case SCI_AUTOCGETSEPARATOR: + return ac.GetSeparator(); + case SCI_AUTOCSTOPS: ac.SetStopChars(reinterpret_cast<char *>(lParam)); break; + + case SCI_AUTOCSELECT: + ac.Select(reinterpret_cast<char *>(lParam)); + break; case SCI_CALLTIPSHOW: { AutoCompleteCancel(); |