]>
Commit | Line | Data |
---|---|---|
9ce192d4 | 1 | // Scintilla source code edit control |
65ec6247 RD |
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> | |
9ce192d4 RD |
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 | ||
65ec6247 RD |
11 | /** |
12 | */ | |
9ce192d4 | 13 | class ScintillaBase : public Editor { |
f6bcfd97 BP |
14 | // Private so ScintillaBase objects can not be copied |
15 | ScintillaBase(const ScintillaBase &) : Editor() {} | |
16 | ScintillaBase &operator=(const ScintillaBase &) { return *this; } | |
65ec6247 | 17 | |
9ce192d4 | 18 | protected: |
65ec6247 | 19 | /** Enumeration of commands and child windows. */ |
9ce192d4 RD |
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 | ||
b8b0e402 | 33 | bool displayPopupMenu; |
9ce192d4 RD |
34 | Menu popup; |
35 | AutoComplete ac; | |
36 | ||
37 | CallTip ct; | |
38 | ||
65ec6247 RD |
39 | int listType; ///< 0 is an autocomplete list |
40 | SString userListSelected; ///< Receives listbox selected string | |
41 | ||
9ce192d4 RD |
42 | #ifdef SCI_LEXER |
43 | int lexLanguage; | |
65ec6247 | 44 | LexerModule *lexCurrent; |
9ce192d4 | 45 | PropSet props; |
b8b0e402 | 46 | enum {numWordLists=6}; |
65ec6247 RD |
47 | WordList *keyWordLists[numWordLists+1]; |
48 | void SetLexer(uptr_t wParam); | |
49 | void SetLexerLanguage(const char *languageName); | |
9ce192d4 RD |
50 | void Colourise(int start, int end); |
51 | #endif | |
52 | ||
53 | ScintillaBase(); | |
54 | virtual ~ScintillaBase(); | |
55 | virtual void Initialise() = 0; | |
56 | virtual void Finalise() = 0; | |
57 | ||
58 | virtual void RefreshColourPalette(Palette &pal, bool want); | |
59 | ||
f6bcfd97 | 60 | virtual void AddCharUTF(char *s, unsigned int len); |
9ce192d4 | 61 | void Command(int cmdId); |
d134f170 RD |
62 | virtual void CancelModes(); |
63 | virtual int KeyCommand(unsigned int iMessage); | |
9ce192d4 RD |
64 | |
65 | void AutoCompleteStart(int lenEntered, const char *list); | |
66 | void AutoCompleteCancel(); | |
67 | void AutoCompleteMove(int delta); | |
68 | void AutoCompleteChanged(char ch=0); | |
d134f170 RD |
69 | void AutoCompleteCompleted(char fillUp='\0'); |
70 | void AutoCompleteMoveToCurrentWord(); | |
9ce192d4 RD |
71 | |
72 | virtual void CreateCallTipWindow(PRectangle rc) = 0; | |
73 | ||
74 | virtual void AddToPopUp(const char *label, int cmd=0, bool enabled=true) = 0; | |
75 | void ContextMenu(Point pt); | |
76 | ||
77 | virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt); | |
78 | ||
f6bcfd97 | 79 | virtual void NotifyStyleToNeeded(int endStyleNeeded); |
9ce192d4 RD |
80 | public: |
81 | // Public so scintilla_send_message can use it | |
65ec6247 | 82 | virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); |
9ce192d4 RD |
83 | }; |
84 | ||
85 | #endif |