]> git.saurik.com Git - wxWidgets.git/blob - src/stc/scintilla/src/ScintillaBase.h
fix harmless warnings about uninitialized (not really) variables in MSVC release...
[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-2002 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 #ifdef SCI_NAMESPACE
12 namespace Scintilla {
13 #endif
14
15 /**
16 */
17 class ScintillaBase : public Editor {
18 // Private so ScintillaBase objects can not be copied
19 ScintillaBase(const ScintillaBase &) : Editor() {}
20 ScintillaBase &operator=(const ScintillaBase &) { return *this; }
21
22 protected:
23 /** Enumeration of commands and child windows. */
24 enum {
25 idCallTip=1,
26 idAutoComplete=2,
27
28 idcmdUndo=10,
29 idcmdRedo=11,
30 idcmdCut=12,
31 idcmdCopy=13,
32 idcmdPaste=14,
33 idcmdDelete=15,
34 idcmdSelectAll=16
35 };
36
37 bool displayPopupMenu;
38 Menu popup;
39 AutoComplete ac;
40
41 CallTip ct;
42
43 int listType; ///< 0 is an autocomplete list
44 SString listSelected; ///< Receives listbox selected string
45 int maxListWidth; /// Maximum width of list, in average character widths
46
47 bool performingStyle; ///< Prevent reentrance
48
49 #ifdef SCI_LEXER
50 int lexLanguage;
51 const LexerModule *lexCurrent;
52 PropSet props;
53 enum {numWordLists=KEYWORDSET_MAX+1};
54 WordList *keyWordLists[numWordLists+1];
55 void SetLexer(uptr_t wParam);
56 void SetLexerLanguage(const char *languageName);
57 void Colourise(int start, int end);
58 #endif
59
60 ScintillaBase();
61 virtual ~ScintillaBase();
62 virtual void Initialise() = 0;
63 virtual void Finalise() = 0;
64
65 virtual void RefreshColourPalette(Palette &pal, bool want);
66
67 virtual void AddCharUTF(char *s, unsigned int len, bool treatAsDBCS=false);
68 void Command(int cmdId);
69 virtual void CancelModes();
70 virtual int KeyCommand(unsigned int iMessage);
71
72 void AutoCompleteStart(int lenEntered, const char *list);
73 void AutoCompleteCancel();
74 void AutoCompleteMove(int delta);
75 int AutoCompleteGetCurrent();
76 void AutoCompleteCharacterAdded(char ch);
77 void AutoCompleteCharacterDeleted();
78 void AutoCompleteCompleted();
79 void AutoCompleteMoveToCurrentWord();
80 static void AutoCompleteDoubleClick(void* p);
81
82 void CallTipClick();
83 void CallTipShow(Point pt, const char *defn);
84 virtual void CreateCallTipWindow(PRectangle rc) = 0;
85
86 virtual void AddToPopUp(const char *label, int cmd=0, bool enabled=true) = 0;
87 void ContextMenu(Point pt);
88
89 virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
90
91 virtual void NotifyStyleToNeeded(int endStyleNeeded);
92 public:
93 // Public so scintilla_send_message can use it
94 virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
95 };
96
97 #ifdef SCI_NAMESPACE
98 }
99 #endif
100
101 #endif