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