]>
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"
37 #include "ContractionState.h"
39 #include "CellBuffer.h"
42 #include "Indicator.h"
43 #include "LineMarker.h"
45 #include "ViewStyle.h"
46 #include "AutoComplete.h"
49 #include "ScintillaBase.h"
52 #include <wx/dataobj.h>
53 #include <wx/clipbrd.h>
56 //----------------------------------------------------------------------
58 class wxStyledTextCtrl
; // forward
62 //----------------------------------------------------------------------
65 #if wxUSE_DRAG_AND_DROP
66 class wxSTCDropTarget
: public wxTextDropTarget
{
68 void SetScintilla(ScintillaWX
* swx
) {
72 bool OnDropText(wxCoord x
, wxCoord y
, const wxString
& data
);
73 wxDragResult
OnEnter(wxCoord x
, wxCoord y
, wxDragResult def
);
74 wxDragResult
OnDragOver(wxCoord x
, wxCoord y
, wxDragResult def
);
82 //----------------------------------------------------------------------
84 class ScintillaWX
: public ScintillaBase
{
87 ScintillaWX(wxStyledTextCtrl
* win
);
90 // base class virtuals
91 virtual void Initialise();
92 virtual void Finalise();
93 virtual void StartDrag();
94 virtual void SetTicking(bool on
);
95 virtual void SetMouseCapture(bool on
);
96 virtual bool HaveMouseCapture();
97 virtual void ScrollText(int linesToMove
);
98 virtual void SetVerticalScrollPos();
99 virtual void SetHorizontalScrollPos();
100 virtual bool ModifyScrollBars(int nMax
, int nPage
);
102 virtual void Paste();
103 virtual void CopyToClipboard(const SelectionText
&selectedText
);
105 virtual void CreateCallTipWindow(PRectangle rc
);
106 virtual void AddToPopUp(const char *label
, int cmd
= 0, bool enabled
= true);
107 virtual void ClaimSelection();
109 virtual long DefWndProc(unsigned int iMessage
,
110 unsigned long wParam
,
112 virtual long WndProc(unsigned int iMessage
,
113 unsigned long wParam
,
116 virtual void NotifyChange();
117 virtual void NotifyParent(SCNotification scn
);
121 void DoPaint(wxDC
* dc
, wxRect rect
);
122 void DoHScroll(int type
, int pos
);
123 void DoVScroll(int type
, int pos
);
124 void DoSize(int width
, int height
);
127 void DoSysColourChange();
128 void DoLeftButtonDown(Point pt
, unsigned int curTime
, bool shift
, bool ctrl
, bool alt
);
129 void DoLeftButtonUp(Point pt
, unsigned int curTime
, bool ctrl
);
130 void DoLeftButtonMove(Point pt
);
131 void DoMiddleButtonUp(Point pt
);
132 void DoMouseWheel(int rotation
, int delta
, int linesPerAction
, int ctrlDown
, bool isPageScroll
);
133 void DoAddChar(int key
);
134 int DoKeyDown(int key
, bool shift
, bool ctrl
, bool alt
, bool* consumed
);
135 void DoTick() { Tick(); }
137 #if wxUSE_DRAG_AND_DROP
138 bool DoDropText(long x
, long y
, const wxString
& data
);
139 wxDragResult
DoDragEnter(wxCoord x
, wxCoord y
, wxDragResult def
);
140 wxDragResult
DoDragOver(wxCoord x
, wxCoord y
, wxDragResult def
);
144 void DoCommand(int ID
);
145 void DoContextMenu(Point pt
);
152 bool GetHideSelection() { return hideSelection
; }
153 void DoScrollToLine(int line
);
154 void DoScrollToColumn(int column
);
155 void ClipChildren(wxDC
& dc
, PRectangle rect
);
159 wxStyledTextCtrl
* stc
;
161 #if wxUSE_DRAG_AND_DROP
162 wxSTCDropTarget
* dropTarget
;
163 wxDragResult dragResult
;
168 friend class wxSTCCallTip
;
171 //----------------------------------------------------------------------