1
////////////////////////////////////////////////////////////////////////////
3
// Purpose: A wxWidgets implementation of Scintilla. A class derived
4
// from ScintillaBase that uses the "wx platform" defined in
5
// PlatWX.cpp. This class is one end of a bridge between
6
// the wx world and the Scintilla world. It needs a peer
7
// object of type wxScintilla to function.
11
// Created: 13-Jan-2000
12
// RCS-ID: $Id: ScintillaWX.h 9226 2013-07-24 05:11:21Z mortenmacfly $
13
// Copyright: (c) 2000 by Total Control Software
14
// Licence: wxWindows license
15
/////////////////////////////////////////////////////////////////////////////
17
#ifndef __ScintillaWX_h__
18
#define __ScintillaWX_h__
20
//----------------------------------------------------------------------
29
#include "Scintilla.h"
35
#include "ContractionState.h"
36
#include "CellBuffer.h"
39
#include "Indicator.h"
40
#include "LineMarker.h"
42
#include "ViewStyle.h"
43
#include "AutoComplete.h"
44
#include "CharClassify.h"
48
#include "ScintillaBase.h"
51
#include <wx/dataobj.h>
54
//----------------------------------------------------------------------
56
#ifdef WXMAKINGDLL_SCI
57
#define WXDLLIMPEXP_SCI WXEXPORT
58
#elif defined(WXUSINGDLL)
59
#define WXDLLIMPEXP_SCI WXIMPORT
60
#else // not making nor using DLL
61
#define WXDLLIMPEXP_SCI
66
#ifndef SCI_NAMESPACE_PREFIX
67
#define SCI_NAMESPACE_PREFIX( x ) Scintilla::x
70
#ifndef SCI_NAMESPACE_PREFIX
71
#define SCI_NAMESPACE_PREFIX( x ) x
75
//----------------------------------------------------------------------
78
class wxScintilla; // forward
82
//----------------------------------------------------------------------
85
#if wxUSE_DRAG_AND_DROP
86
class wxSCIDropTarget : public wxTextDropTarget {
88
void SetScintilla(ScintillaWX* swx) {
92
bool OnDropText(wxCoord x, wxCoord y, const wxString& data);
93
wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def);
94
wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
102
//----------------------------------------------------------------------
105
class ScintillaWX : public SCI_NAMESPACE_PREFIX(ScintillaBase) {
109
ScintillaWX(wxScintilla* win);
112
// base class virtuals
113
virtual void Initialise();
114
virtual void Finalise();
115
virtual void StartDrag();
116
virtual bool SetIdle(bool on);
117
virtual void SetTicking(bool on);
118
virtual void SetMouseCapture(bool on);
119
virtual bool HaveMouseCapture();
120
virtual void ScrollText(int linesToMove);
121
virtual void SetVerticalScrollPos();
122
virtual void SetHorizontalScrollPos();
123
virtual bool ModifyScrollBars(int nMax, int nPage);
125
virtual void Paste();
127
virtual void CopyToClipboard(const SCI_NAMESPACE_PREFIX(SelectionText) &selectedText);
129
virtual void CreateCallTipWindow(SCI_NAMESPACE_PREFIX(PRectangle) rc);
131
virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true);
132
virtual void ClaimSelection();
134
virtual sptr_t DefWndProc(unsigned int iMessage,
137
virtual sptr_t WndProc(unsigned int iMessage,
141
static sptr_t DirectFunction(ScintillaWX *wxsci,
142
unsigned int iMessage,
147
virtual void NotifyChange();
148
virtual void NotifyParent(SCI_NAMESPACE_PREFIX(SCNotification) scn);
150
virtual void NotifyFocus(bool focus);
153
virtual void CancelModes();
155
virtual void UpdateSystemCaret();
158
void DoPaint(wxDC* dc, wxRect rect);
159
void DoHScroll(int type, int pos);
160
void DoVScroll(int type, int pos);
161
void DoSize(int width, int height);
164
void DoSysColourChange();
166
void DoLeftButtonDown(SCI_NAMESPACE_PREFIX(Point) pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
167
void DoLeftButtonUp(SCI_NAMESPACE_PREFIX(Point) pt, unsigned int curTime, bool ctrl);
168
void DoLeftButtonMove(SCI_NAMESPACE_PREFIX(Point) pt);
169
void DoMiddleButtonUp(SCI_NAMESPACE_PREFIX(Point) pt);
172
#if !wxCHECK_VERSION(2,9,2)
173
enum wxMouseWheelAxis
175
wxMOUSE_WHEEL_VERTICAL,
176
wxMOUSE_WHEEL_HORIZONTAL
180
void DoMouseWheel(wxMouseWheelAxis axis, int rotation, int delta,
181
int linesPerAction, int columnsPerAction,
182
bool ctrlDown, bool isPageScroll);
183
void DoAddChar(int key);
184
int DoKeyDown(const wxKeyEvent& event, bool* consumed);
185
void DoTick() { Tick(); }
186
void DoOnIdle(wxIdleEvent& evt);
188
#if wxUSE_DRAG_AND_DROP
189
bool DoDropText(long x, long y, const wxString& data);
190
wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def);
191
wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
195
void DoCommand(int ID);
197
void DoContextMenu(SCI_NAMESPACE_PREFIX(Point) pt);
204
void FullPaintDC(wxDC* dc);
206
bool GetHideSelection() { return hideSelection; }
207
void DoScrollToLine(int line);
208
void DoScrollToColumn(int column);
210
void ClipChildren(wxDC& dc, SCI_NAMESPACE_PREFIX(PRectangle) rect);
212
void SetUseAntiAliasing(bool useAA);
213
bool GetUseAntiAliasing();
220
#if wxUSE_DRAG_AND_DROP
221
wxSCIDropTarget* dropTarget;
222
wxDragResult dragResult;
231
// For use in creating a system caret
232
bool HasCaretSizeChanged();
233
bool CreateSystemCaret();
234
bool DestroySystemCaret();
236
HBITMAP sysCaretBitmap;
241
friend class wxSCICallTipContent;
244
//----------------------------------------------------------------------