From c9869d1a1a442cfd6b06b8ff8dc392e64af666be Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 17 Dec 2000 12:01:49 +0000 Subject: Added Laurent's User List. --- include/Scintilla.h | 19 +++++++++++-------- include/Scintilla.iface | 4 ++++ src/ScintillaBase.cxx | 21 ++++++++++++++++++++- src/ScintillaBase.h | 3 +++ win32/ScintillaWin.cxx | 1 + 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< 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(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(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" -- cgit v1.2.3