]> git.saurik.com Git - wxWidgets.git/blob - src/stc/scintilla/src/ScintillaBase.h
d5b1e8ba0ccae8b98666326d2711112cef0917d5
[wxWidgets.git] / src / stc / scintilla / src / ScintillaBase.h
1 // Scintilla source code edit control
2 /** @file ScintillaBase.h
3 ** Defines an enhanced subclass of Editor with calltips, autocomplete and context menu.
4 **/
5 // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
7
8 #ifndef SCINTILLABASE_H
9 #define SCINTILLABASE_H
10
11 /**
12 */
13 class ScintillaBase : public Editor {
14 // Private so ScintillaBase objects can not be copied
15 ScintillaBase(const ScintillaBase &) : Editor() {}
16 ScintillaBase &operator=(const ScintillaBase &) { return *this; }
17
18 protected:
19 /** Enumeration of commands and child windows. */
20 enum {
21 idCallTip=1,
22 idAutoComplete=2,
23
24 idcmdUndo=10,
25 idcmdRedo=11,
26 idcmdCut=12,
27 idcmdCopy=13,
28 idcmdPaste=14,
29 idcmdDelete=15,
30 idcmdSelectAll=16
31 };
32
33 Menu popup;
34 AutoComplete ac;
35
36 CallTip ct;
37
38 int listType; ///< 0 is an autocomplete list
39 SString userListSelected; ///< Receives listbox selected string
40
41 #ifdef SCI_LEXER
42 int lexLanguage;
43 LexerModule *lexCurrent;
44 PropSet props;
45 enum {numWordLists=5};
46 WordList *keyWordLists[numWordLists+1];
47 void SetLexer(uptr_t wParam);
48 void SetLexerLanguage(const char *languageName);
49 void Colourise(int start, int end);
50 #endif
51
52 ScintillaBase();
53 virtual ~ScintillaBase();
54 virtual void Initialise() = 0;
55 virtual void Finalise() = 0;
56
57 virtual void RefreshColourPalette(Palette &pal, bool want);
58
59 virtual void AddCharUTF(char *s, unsigned int len);
60 void Command(int cmdId);
61 virtual void CancelModes();
62 virtual int KeyCommand(unsigned int iMessage);
63
64 void AutoCompleteStart(int lenEntered, const char *list);
65 void AutoCompleteCancel();
66 void AutoCompleteMove(int delta);
67 void AutoCompleteChanged(char ch=0);
68 void AutoCompleteCompleted(char fillUp='\0');
69 void AutoCompleteMoveToCurrentWord();
70
71 virtual void CreateCallTipWindow(PRectangle rc) = 0;
72
73 virtual void AddToPopUp(const char *label, int cmd=0, bool enabled=true) = 0;
74 void ContextMenu(Point pt);
75
76 virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
77
78 virtual void NotifyStyleToNeeded(int endStyleNeeded);
79 public:
80 // Public so scintilla_send_message can use it
81 virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
82 };
83
84 #endif