aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ScintillaBase.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2000-08-21 12:28:18 +0000
committernyamatongwe <devnull@localhost>2000-08-21 12:28:18 +0000
commit89ef99c7fdf9312d4c2f8b9e822a2060dc344ed7 (patch)
tree5000e0ba3f796393861c9f619bceaa09084be285 /src/ScintillaBase.cxx
parent70df38949292f55cb3eb507c95d904770979ae15 (diff)
downloadscintilla-mirror-89ef99c7fdf9312d4c2f8b9e822a2060dc344ed7.tar.gz
Merging patches from Ferda and Jan.
Autocompletion flags for ignoring case and automatically choosing single items. WM_PAINT handling with passed HDC. Events in Scintilla.iface.
Diffstat (limited to 'src/ScintillaBase.cxx')
-rw-r--r--src/ScintillaBase.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index bf81887f2..70e890e1a 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -171,6 +171,22 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
//Platform::DebugPrintf("AutoComplete %s\n", list);
ct.CallTipCancel();
+ if (ac.chooseSingle) {
+ if (list && !strchr(list, ac.GetSeparator())) {
+ if (ac.ignoreCase) {
+ SetEmptySelection(currentPos - lenEntered);
+ pdoc->DeleteChars(currentPos, lenEntered);
+ SetEmptySelection(currentPos);
+ pdoc->InsertString(currentPos, list);
+ SetEmptySelection(currentPos + strlen(list));
+ } else {
+ SetEmptySelection(currentPos);
+ pdoc->InsertString(currentPos, list + lenEntered);
+ SetEmptySelection(currentPos + strlen(list + lenEntered));
+ }
+ return;
+ }
+ }
ac.Start(wDraw, idAutoComplete, currentPos, lenEntered);
PRectangle rcClient = GetClientRectangle();
@@ -396,6 +412,20 @@ long ScintillaBase::WndProc(unsigned int iMessage, unsigned long wParam, long lP
ac.SetFillUpChars(reinterpret_cast<char *>(lParam));
break;
+ case SCI_AUTOCSETCHOOSESINGLE:
+ ac.chooseSingle = wParam;
+ break;
+
+ case SCI_AUTOCGETCHOOSESINGLE:
+ return ac.chooseSingle;
+
+ case SCI_AUTOCSETIGNORECASE:
+ ac.ignoreCase = wParam;
+ break;
+
+ case SCI_AUTOCGETIGNORECASE:
+ return ac.ignoreCase;
+
case SCI_CALLTIPSHOW: {
AutoCompleteCancel();
if (!ct.wCallTip.Created()) {