]>
git.saurik.com Git - wxWidgets.git/blob - contrib/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 class wxSTCDropTarget
: public wxTextDropTarget
{
61 void SetScintilla(ScintillaWX
* swx
) {
65 bool OnDropText(wxCoord x
, wxCoord y
, const wxString
& data
);
66 wxDragResult
OnEnter(wxCoord x
, wxCoord y
, wxDragResult def
);
67 wxDragResult
OnDragOver(wxCoord x
, wxCoord y
, wxDragResult def
);
75 //----------------------------------------------------------------------
77 class ScintillaWX
: public ScintillaBase
{
80 ScintillaWX(wxStyledTextCtrl
* win
);
83 // base class virtuals
84 virtual void Initialise();
85 virtual void Finalise();
86 virtual void StartDrag();
87 virtual void SetTicking(bool on
);
88 virtual void SetMouseCapture(bool on
);
89 virtual bool HaveMouseCapture();
90 virtual void ScrollText(int linesToMove
);
91 virtual void SetVerticalScrollPos();
92 virtual void SetHorizontalScrollPos();
93 virtual bool ModifyScrollBars(int nMax
, int nPage
);
96 virtual void CreateCallTipWindow(PRectangle rc
);
97 virtual void AddToPopUp(const char *label
, int cmd
= 0, bool enabled
= true);
98 virtual void ClaimSelection();
100 virtual long DefWndProc(unsigned int iMessage
,
101 unsigned long wParam
,
103 virtual long WndProc(unsigned int iMessage
,
104 unsigned long wParam
,
107 virtual void NotifyChange();
108 virtual void NotifyParent(SCNotification scn
);
112 void DoPaint(wxDC
* dc
, wxRect rect
);
113 void DoHScroll(int type
, int pos
);
114 void DoVScroll(int type
, int pos
);
115 void DoSize(int width
, int height
);
118 void DoSysColourChange();
119 void DoButtonDown(Point pt
, unsigned int curTime
, bool shift
, bool ctrl
, bool alt
);
120 void DoButtonUp(Point pt
, unsigned int curTime
, bool ctrl
);
121 void DoButtonMove(Point pt
);
122 void DoAddChar(char ch
);
123 int DoKeyDown(int key
, bool shift
, bool ctrl
, bool alt
);
124 void DoTick() { Tick(); }
126 bool DoDropText(long x
, long y
, const wxString
& data
);
127 wxDragResult
DoDragEnter(wxCoord x
, wxCoord y
, wxDragResult def
);
128 wxDragResult
DoDragOver(wxCoord x
, wxCoord y
, wxDragResult def
);
131 void DoCommand(int ID
);
132 void DoContextMenu(Point pt
);
139 bool GetHideSelection() { return hideSelection
; }
140 void DoScrollToLine(int line
);
141 void DoScrollToColumn(int column
);
145 wxStyledTextCtrl
* stc
;
147 wxSTCDropTarget
* dropTarget
;
148 wxDragResult dragResult
;
151 //----------------------------------------------------------------------