aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2000-12-17 12:01:49 +0000
committernyamatongwe <devnull@localhost>2000-12-17 12:01:49 +0000
commitc9869d1a1a442cfd6b06b8ff8dc392e64af666be (patch)
tree2dd7176c01805d6c4602792085d3536afdf7f618
parent277b10f2d35e82d8599f2faf3b82acc5f5aef7e2 (diff)
downloadscintilla-mirror-c9869d1a1a442cfd6b06b8ff8dc392e64af666be.tar.gz
Added Laurent's User List.
-rw-r--r--include/Scintilla.h19
-rw-r--r--include/Scintilla.iface4
-rw-r--r--src/ScintillaBase.cxx21
-rw-r--r--src/ScintillaBase.h3
-rw-r--r--win32/ScintillaWin.cxx1
5 files changed, 39 insertions, 9 deletions
diff --git a/include/Scintilla.h b/include/Scintilla.h
index 4d5478207..da41bb6bf 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -186,6 +186,7 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara
#define SCI_AUTOCGETCHOOSESINGLE 2114
#define SCI_AUTOCSETIGNORECASE 2115
#define SCI_AUTOCGETIGNORECASE 2116
+#define SCI_USERLISTSHOW 2117
#define SCI_SETINDENT 2122
#define SCI_GETINDENT 2123
#define SCI_SETUSETABS 2124
@@ -439,6 +440,7 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara
#define SCN_NEEDSHOWN 2011
#define SCN_POSCHANGED 2012
#define SCN_PAINTED 2013
+#define SCN_USERLISTSELECTION 2014
//--Autogenerated -- end of section automatically generated from Scintilla.iface
// Optional module for macro recording
@@ -493,22 +495,23 @@ struct NotifyHeader {
struct SCNotification {
struct NotifyHeader nmhdr;
- int position; // SCN_STYLENEEDED, SCN_MODIFIED
- int ch; // SCN_CHARADDED, SCN_KEY
- int modifiers; // SCN_KEY
+ int position; // SCN_STYLENEEDED, SCN_MODIFIED
+ int ch; // SCN_CHARADDED, SCN_KEY
+ int modifiers; // SCN_KEY
int modificationType; // SCN_MODIFIED
- const char *text; // SCN_MODIFIED
- int length; // SCN_MODIFIED
+ const char *text; // SCN_MODIFIED
+ int length; // SCN_MODIFIED
int linesAdded; // SCN_MODIFIED
#ifdef MACRO_SUPPORT
int message; // SCN_MACRORECORD
int wParam; // SCN_MACRORECORD
- int lParam; // SCN_MACRORECORD
+ int lParam; // SCN_MACRORECORD
#endif
- int line; // SCN_MODIFIED
+ int line; // SCN_MODIFIED
int foldLevelNow; // SCN_MODIFIED
int foldLevelPrev; // SCN_MODIFIED
- int margin; // SCN_MARGINCLICK
+ int margin; // SCN_MARGINCLICK
+ int listType; // SCN_USERLISTSELECTION
};
#define SC_MASK_FOLDERS ((1<<SC_MARKNUM_FOLDER) | (1<<SC_MARKNUM_FOLDEROPEN))
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 88fda0a64..f5b2610be 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -464,6 +464,9 @@ set void AutoCSetIgnoreCase=2115(bool ignoreCase,)
# Retrieve state of ignore case flag.
get bool AutoCGetIgnoreCase=2116(,)
+# Retrieve state of ignore case flag.
+fun void UserListShow=2117(int listType, string itemList)
+
# Set the number of spaces used for one level of indentation.
set void SetIndent=2122(int indentSize,)
@@ -1346,6 +1349,7 @@ evt void MarginClick=2010(int modifiers, int position, int margin)
evt void NeedShown=2011(int position, int length)
evt void PosChanged=2012(int position)
evt void Painted=2013(void)
+evt void UserListSelection=2014(int listType, string text)
cat Deprecated
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index b812426c2..703d6e534 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -34,6 +34,7 @@
#include "ScintillaBase.h"
ScintillaBase::ScintillaBase() {
+ listType = 0;
#ifdef SCI_LEXER
lexLanguage = SCLEX_CONTAINER;
for (int wl=0;wl<numWordLists;wl++)
@@ -170,7 +171,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
//Platform::DebugPrintf("AutoComplete %s\n", list);
ct.CallTipCancel();
- if (ac.chooseSingle) {
+ if (ac.chooseSingle && (listType == 0)) {
if (list && !strchr(list, ac.GetSeparator())) {
if (ac.ignoreCase) {
SetEmptySelection(currentPos - lenEntered);
@@ -279,6 +280,18 @@ void ScintillaBase::AutoCompleteCompleted(char fillUp/*='\0'*/) {
}
ac.Cancel();
+ if (listType > 0) {
+ userListSelected = selected;
+ SCNotification scn;
+ scn.nmhdr.code = SCN_USERLISTSELECTION;
+ scn.message = 0;
+ scn.wParam = listType;
+ scn.lParam = 0;
+ scn.text = userListSelected.c_str();
+ NotifyParent(scn);
+ return;
+ }
+
Position firstPos = ac.posStart - ac.startLen;
if (currentPos < firstPos)
return;
@@ -356,6 +369,7 @@ void ScintillaBase::NotifyStyleToNeeded(int endStyleNeeded) {
long ScintillaBase::WndProc(unsigned int iMessage, unsigned long wParam, long lParam) {
switch (iMessage) {
case SCI_AUTOCSHOW:
+ listType = 0;
AutoCompleteStart(wParam, reinterpret_cast<const char *>(lParam));
break;
@@ -413,6 +427,11 @@ long ScintillaBase::WndProc(unsigned int iMessage, unsigned long wParam, long lP
case SCI_AUTOCGETIGNORECASE:
return ac.ignoreCase;
+ case SCI_USERLISTSHOW:
+ listType = wParam;
+ AutoCompleteStart(0, reinterpret_cast<const char *>(lParam));
+ break;
+
case SCI_CALLTIPSHOW: {
AutoCompleteCancel();
if (!ct.wCallTip.Created()) {
diff --git a/src/ScintillaBase.h b/src/ScintillaBase.h
index e630ba1aa..6abed9afe 100644
--- a/src/ScintillaBase.h
+++ b/src/ScintillaBase.h
@@ -30,6 +30,9 @@ protected:
CallTip ct;
+ int listType; // 0 is an autocomplete list
+ SString userListSelected; // Receives listbox selected string
+
#ifdef SCI_LEXER
int lexLanguage;
PropSet props;
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index e86d23e33..5073c9bf0 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -12,6 +12,7 @@
#include "Platform.h"
#include "Scintilla.h"
+#include "SString.h"
#ifdef SCI_LEXER
#include "SciLexer.h"
#include "PropSet.h"