2009-04-24 23:35:41 +00:00
|
|
|
// Scintilla source code edit control
|
|
|
|
/** @file ScintillaBase.h
|
|
|
|
** Defines an enhanced subclass of Editor with calltips, autocomplete and context menu.
|
|
|
|
**/
|
|
|
|
// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
|
|
|
|
// The License.txt file describes the conditions under which this software may be distributed.
|
|
|
|
|
|
|
|
#ifndef SCINTILLABASE_H
|
|
|
|
#define SCINTILLABASE_H
|
|
|
|
|
|
|
|
#ifdef SCI_NAMESPACE
|
|
|
|
namespace Scintilla {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
class ScintillaBase : public Editor {
|
|
|
|
// Private so ScintillaBase objects can not be copied
|
2010-07-12 22:19:51 +00:00
|
|
|
ScintillaBase(const ScintillaBase &);
|
|
|
|
ScintillaBase &operator=(const ScintillaBase &);
|
2009-04-24 23:35:41 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
/** Enumeration of commands and child windows. */
|
|
|
|
enum {
|
|
|
|
idCallTip=1,
|
|
|
|
idAutoComplete=2,
|
|
|
|
|
|
|
|
idcmdUndo=10,
|
|
|
|
idcmdRedo=11,
|
|
|
|
idcmdCut=12,
|
|
|
|
idcmdCopy=13,
|
|
|
|
idcmdPaste=14,
|
|
|
|
idcmdDelete=15,
|
|
|
|
idcmdSelectAll=16
|
|
|
|
};
|
|
|
|
|
|
|
|
bool displayPopupMenu;
|
|
|
|
Menu popup;
|
|
|
|
AutoComplete ac;
|
|
|
|
|
|
|
|
CallTip ct;
|
|
|
|
|
|
|
|
int listType; ///< 0 is an autocomplete list
|
|
|
|
int maxListWidth; /// Maximum width of list, in average character widths
|
|
|
|
|
|
|
|
#ifdef SCI_LEXER
|
2010-07-12 22:19:51 +00:00
|
|
|
bool performingStyle; ///< Prevent reentrance
|
2009-04-24 23:35:41 +00:00
|
|
|
int lexLanguage;
|
|
|
|
const LexerModule *lexCurrent;
|
2009-08-23 02:24:48 +00:00
|
|
|
PropSetSimple props;
|
2009-04-24 23:35:41 +00:00
|
|
|
enum {numWordLists=KEYWORDSET_MAX+1};
|
|
|
|
WordList *keyWordLists[numWordLists+1];
|
|
|
|
void SetLexer(uptr_t wParam);
|
|
|
|
void SetLexerLanguage(const char *languageName);
|
|
|
|
void Colourise(int start, int end);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ScintillaBase();
|
|
|
|
virtual ~ScintillaBase();
|
|
|
|
virtual void Initialise() = 0;
|
|
|
|
virtual void Finalise() = 0;
|
|
|
|
|
|
|
|
virtual void RefreshColourPalette(Palette &pal, bool want);
|
|
|
|
|
|
|
|
virtual void AddCharUTF(char *s, unsigned int len, bool treatAsDBCS=false);
|
|
|
|
void Command(int cmdId);
|
|
|
|
virtual void CancelModes();
|
|
|
|
virtual int KeyCommand(unsigned int iMessage);
|
|
|
|
|
|
|
|
void AutoCompleteStart(int lenEntered, const char *list);
|
|
|
|
void AutoCompleteCancel();
|
|
|
|
void AutoCompleteMove(int delta);
|
|
|
|
int AutoCompleteGetCurrent();
|
2010-07-12 22:19:51 +00:00
|
|
|
int AutoCompleteGetCurrentText(char *buffer);
|
2009-04-24 23:35:41 +00:00
|
|
|
void AutoCompleteCharacterAdded(char ch);
|
|
|
|
void AutoCompleteCharacterDeleted();
|
|
|
|
void AutoCompleteCompleted();
|
|
|
|
void AutoCompleteMoveToCurrentWord();
|
2010-07-12 22:19:51 +00:00
|
|
|
static void AutoCompleteDoubleClick(void *p);
|
2009-04-24 23:35:41 +00:00
|
|
|
|
|
|
|
void CallTipClick();
|
|
|
|
void CallTipShow(Point pt, const char *defn);
|
|
|
|
virtual void CreateCallTipWindow(PRectangle rc) = 0;
|
|
|
|
|
|
|
|
virtual void AddToPopUp(const char *label, int cmd=0, bool enabled=true) = 0;
|
|
|
|
void ContextMenu(Point pt);
|
|
|
|
|
|
|
|
virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
|
|
|
|
|
|
|
|
virtual void NotifyStyleToNeeded(int endStyleNeeded);
|
|
|
|
public:
|
|
|
|
// Public so scintilla_send_message can use it
|
|
|
|
virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef SCI_NAMESPACE
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|