]>
git.saurik.com Git - wxWidgets.git/blob - src/stc/ScintillaWX.h
1 ////////////////////////////////////////////////////////////////////////////
3 // Purpose: A wxWindows 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 wxStyledTextCtrl to function.
11 // Created: 13-Jan-2000
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"
36 #include "ContractionState.h"
38 #include "CellBuffer.h"
41 #include "Indicator.h"
42 #include "LineMarker.h"
44 #include "ViewStyle.h"
45 #include "AutoComplete.h"
48 #include "ScintillaBase.h"
51 #include <wx/dataobj.h>
52 #include <wx/clipbrd.h>
55 //----------------------------------------------------------------------
57 class wxStyledTextCtrl
; // forward
61 //----------------------------------------------------------------------
64 #if wxUSE_DRAG_AND_DROP
65 class wxSTCDropTarget
: public wxTextDropTarget
{
67 void SetScintilla(ScintillaWX
* swx
) {
71 bool OnDropText(wxCoord x
, wxCoord y
, const wxString
& data
);
72 wxDragResult
OnEnter(wxCoord x
, wxCoord y
, wxDragResult def
);
73 wxDragResult
OnDragOver(wxCoord x
, wxCoord y
, wxDragResult def
);
81 //----------------------------------------------------------------------
83 class ScintillaWX
: public ScintillaBase
{
86 ScintillaWX(wxStyledTextCtrl
* win
);
89 // base class virtuals
90 virtual void Initialise();
91 virtual void Finalise();
92 virtual void StartDrag();
93 virtual void SetTicking(bool on
);
94 virtual void SetMouseCapture(bool on
);
95 virtual bool HaveMouseCapture();
96 virtual void ScrollText(int linesToMove
);
97 virtual void SetVerticalScrollPos();
98 virtual void SetHorizontalScrollPos();
99 virtual bool ModifyScrollBars(int nMax
, int nPage
);
101 virtual void Paste();
102 virtual void CreateCallTipWindow(PRectangle rc
);
103 virtual void AddToPopUp(const char *label
, int cmd
= 0, bool enabled
= true);
104 virtual void ClaimSelection();
106 virtual long DefWndProc(unsigned int iMessage
,
107 unsigned long wParam
,
109 virtual long WndProc(unsigned int iMessage
,
110 unsigned long wParam
,
113 virtual void NotifyChange();
114 virtual void NotifyParent(SCNotification scn
);
118 void DoPaint(wxDC
* dc
, wxRect rect
);
119 void DoHScroll(int type
, int pos
);
120 void DoVScroll(int type
, int pos
);
121 void DoSize(int width
, int height
);
124 void DoSysColourChange();
125 void DoLeftButtonDown(Point pt
, unsigned int curTime
, bool shift
, bool ctrl
, bool alt
);
126 void DoLeftButtonUp(Point pt
, unsigned int curTime
, bool ctrl
);
127 void DoLeftButtonMove(Point pt
);
128 void DoMiddleButtonUp(Point pt
);
129 void DoMouseWheel(int rotation
, int delta
, int linesPerAction
, int ctrlDown
, bool isPageScroll
);
130 void DoAddChar(int key
);
131 int DoKeyDown(int key
, bool shift
, bool ctrl
, bool alt
, bool* consumed
);
132 void DoTick() { Tick(); }
134 #if wxUSE_DRAG_AND_DROP
135 bool DoDropText(long x
, long y
, const wxString
& data
);
136 wxDragResult
DoDragEnter(wxCoord x
, wxCoord y
, wxDragResult def
);
137 wxDragResult
DoDragOver(wxCoord x
, wxCoord y
, wxDragResult def
);
141 void DoCommand(int ID
);
142 void DoContextMenu(Point pt
);
149 bool GetHideSelection() { return hideSelection
; }
150 void DoScrollToLine(int line
);
151 void DoScrollToColumn(int column
);
154 wxStyledTextCtrl
* stc
;
156 #if wxUSE_DRAG_AND_DROP
157 wxSTCDropTarget
* dropTarget
;
158 wxDragResult dragResult
;
163 //----------------------------------------------------------------------