]>
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 //----------------------------------------------------------------------
24 #include "Scintilla.h"
31 #include "ContractionState.h"
33 #include "CellBuffer.h"
36 #include "Indicator.h"
37 #include "LineMarker.h"
39 #include "ViewStyle.h"
40 #include "AutoComplete.h"
43 #include "ScintillaBase.h"
46 #include <wx/dataobj.h>
47 #include <wx/clipbrd.h>
50 //----------------------------------------------------------------------
52 class wxStyledTextCtrl
; // forward
56 //----------------------------------------------------------------------
59 #if wxUSE_DRAG_AND_DROP
60 class wxSTCDropTarget
: public wxTextDropTarget
{
62 void SetScintilla(ScintillaWX
* swx
) {
66 bool OnDropText(wxCoord x
, wxCoord y
, const wxString
& data
);
67 wxDragResult
OnEnter(wxCoord x
, wxCoord y
, wxDragResult def
);
68 wxDragResult
OnDragOver(wxCoord x
, wxCoord y
, wxDragResult def
);
76 //----------------------------------------------------------------------
78 class ScintillaWX
: public ScintillaBase
{
81 ScintillaWX(wxStyledTextCtrl
* win
);
84 // base class virtuals
85 virtual void Initialise();
86 virtual void Finalise();
87 virtual void StartDrag();
88 virtual void SetTicking(bool on
);
89 virtual void SetMouseCapture(bool on
);
90 virtual bool HaveMouseCapture();
91 virtual void ScrollText(int linesToMove
);
92 virtual void SetVerticalScrollPos();
93 virtual void SetHorizontalScrollPos();
94 virtual bool ModifyScrollBars(int nMax
, int nPage
);
97 virtual void CreateCallTipWindow(PRectangle rc
);
98 virtual void AddToPopUp(const char *label
, int cmd
= 0, bool enabled
= true);
99 virtual void ClaimSelection();
101 virtual long DefWndProc(unsigned int iMessage
,
102 unsigned long wParam
,
104 virtual long WndProc(unsigned int iMessage
,
105 unsigned long wParam
,
108 virtual void NotifyChange();
109 virtual void NotifyParent(SCNotification scn
);
113 void DoPaint(wxDC
* dc
, wxRect rect
);
114 void DoHScroll(int type
, int pos
);
115 void DoVScroll(int type
, int pos
);
116 void DoSize(int width
, int height
);
119 void DoSysColourChange();
120 void DoButtonDown(Point pt
, unsigned int curTime
, bool shift
, bool ctrl
, bool alt
);
121 void DoButtonUp(Point pt
, unsigned int curTime
, bool ctrl
);
122 void DoButtonMove(Point pt
);
123 void DoMouseWheel(int rotation
, int delta
, int linesPerAction
, int ctrlDown
);
124 void DoAddChar(char ch
);
125 int DoKeyDown(int key
, bool shift
, bool ctrl
, bool alt
, bool* consumed
);
126 void DoTick() { Tick(); }
128 #if wxUSE_DRAG_AND_DROP
129 bool DoDropText(long x
, long y
, const wxString
& data
);
130 wxDragResult
DoDragEnter(wxCoord x
, wxCoord y
, wxDragResult def
);
131 wxDragResult
DoDragOver(wxCoord x
, wxCoord y
, wxDragResult def
);
135 void DoCommand(int ID
);
136 void DoContextMenu(Point pt
);
143 bool GetHideSelection() { return hideSelection
; }
144 void DoScrollToLine(int line
);
145 void DoScrollToColumn(int column
);
149 wxStyledTextCtrl
* stc
;
151 #if wxUSE_DRAG_AND_DROP
152 wxSTCDropTarget
* dropTarget
;
153 wxDragResult dragResult
;
158 //----------------------------------------------------------------------