1 ////////////////////////////////////////////////////////////////////////////
3 // Purpose: A wxWidgets implementation of Scintilla. This class is the
4 // one meant to be used directly by wx applications. It does not
5 // derive directly from the Scintilla classes, but instead
6 // delegates most things to the real Scintilla class.
7 // This allows the use of Scintilla without polluting the
8 // namespace with all the classes and identifiers from Scintilla.
12 // Created: 13-Jan-2000
14 // Copyright: (c) 2000 by Total Control Software
15 // Licence: wxWindows license
16 /////////////////////////////////////////////////////////////////////////////
20 #include "wx/stc/stc.h"
21 #include "ScintillaWX.h"
24 #include <wx/tokenzr.h>
25 #include <wx/mstream.h>
30 //----------------------------------------------------------------------
32 const wxChar
* wxSTCNameStr
= wxT("stcwindow");
38 #define MAKELONG(a, b) ((a) | ((b) << 16))
41 static long wxColourAsLong(const wxColour
& co
) {
42 return (((long)co
.Blue() << 16) |
43 ((long)co
.Green() << 8) |
47 static wxColour
wxColourFromLong(long c
) {
49 clr
.Set(c
& 0xff, (c
>> 8) & 0xff, (c
>> 16) & 0xff);
54 static wxColour
wxColourFromSpec(const wxString
& spec
) {
55 // spec should be a colour name or "#RRGGBB"
56 if (spec
.GetChar(0) == wxT('#')) {
58 long red
, green
, blue
;
59 red
= green
= blue
= 0;
60 spec
.Mid(1,2).ToLong(&red
, 16);
61 spec
.Mid(3,2).ToLong(&green
, 16);
62 spec
.Mid(5,2).ToLong(&blue
, 16);
63 return wxColour(red
, green
, blue
);
66 return wxColour(spec
);
69 //----------------------------------------------------------------------
71 DEFINE_EVENT_TYPE( wxEVT_STC_CHANGE
)
72 DEFINE_EVENT_TYPE( wxEVT_STC_STYLENEEDED
)
73 DEFINE_EVENT_TYPE( wxEVT_STC_CHARADDED
)
74 DEFINE_EVENT_TYPE( wxEVT_STC_SAVEPOINTREACHED
)
75 DEFINE_EVENT_TYPE( wxEVT_STC_SAVEPOINTLEFT
)
76 DEFINE_EVENT_TYPE( wxEVT_STC_ROMODIFYATTEMPT
)
77 DEFINE_EVENT_TYPE( wxEVT_STC_KEY
)
78 DEFINE_EVENT_TYPE( wxEVT_STC_DOUBLECLICK
)
79 DEFINE_EVENT_TYPE( wxEVT_STC_UPDATEUI
)
80 DEFINE_EVENT_TYPE( wxEVT_STC_MODIFIED
)
81 DEFINE_EVENT_TYPE( wxEVT_STC_MACRORECORD
)
82 DEFINE_EVENT_TYPE( wxEVT_STC_MARGINCLICK
)
83 DEFINE_EVENT_TYPE( wxEVT_STC_NEEDSHOWN
)
84 DEFINE_EVENT_TYPE( wxEVT_STC_PAINTED
)
85 DEFINE_EVENT_TYPE( wxEVT_STC_USERLISTSELECTION
)
86 DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED
)
87 DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART
)
88 DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND
)
89 DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG
)
90 DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER
)
91 DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP
)
92 DEFINE_EVENT_TYPE( wxEVT_STC_ZOOM
)
93 DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_CLICK
)
94 DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_DCLICK
)
95 DEFINE_EVENT_TYPE( wxEVT_STC_CALLTIP_CLICK
)
99 BEGIN_EVENT_TABLE(wxStyledTextCtrl
, wxControl
)
100 EVT_PAINT (wxStyledTextCtrl::OnPaint
)
101 EVT_SCROLLWIN (wxStyledTextCtrl::OnScrollWin
)
102 EVT_SCROLL (wxStyledTextCtrl::OnScroll
)
103 EVT_SIZE (wxStyledTextCtrl::OnSize
)
104 EVT_LEFT_DOWN (wxStyledTextCtrl::OnMouseLeftDown
)
105 // Let Scintilla see the double click as a second click
106 EVT_LEFT_DCLICK (wxStyledTextCtrl::OnMouseLeftDown
)
107 EVT_MOTION (wxStyledTextCtrl::OnMouseMove
)
108 EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp
)
109 #if defined(__WXGTK__) || defined(__WXMAC__)
110 EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp
)
112 EVT_CONTEXT_MENU (wxStyledTextCtrl::OnContextMenu
)
114 EVT_MOUSEWHEEL (wxStyledTextCtrl::OnMouseWheel
)
115 EVT_MIDDLE_UP (wxStyledTextCtrl::OnMouseMiddleUp
)
116 EVT_CHAR (wxStyledTextCtrl::OnChar
)
117 EVT_KEY_DOWN (wxStyledTextCtrl::OnKeyDown
)
118 EVT_KILL_FOCUS (wxStyledTextCtrl::OnLoseFocus
)
119 EVT_SET_FOCUS (wxStyledTextCtrl::OnGainFocus
)
120 EVT_SYS_COLOUR_CHANGED (wxStyledTextCtrl::OnSysColourChanged
)
121 EVT_ERASE_BACKGROUND (wxStyledTextCtrl::OnEraseBackground
)
122 EVT_MENU_RANGE (10, 16, wxStyledTextCtrl::OnMenu
)
123 EVT_LISTBOX_DCLICK (wxID_ANY
, wxStyledTextCtrl::OnListBox
)
127 IMPLEMENT_CLASS(wxStyledTextCtrl
, wxControl
)
128 IMPLEMENT_DYNAMIC_CLASS(wxStyledTextEvent
, wxCommandEvent
)
131 // forces the linking of the lexer modules
132 int Scintilla_LinkLexers();
135 //----------------------------------------------------------------------
136 // Constructor and Destructor
138 wxStyledTextCtrl::wxStyledTextCtrl(wxWindow
*parent
,
143 const wxString
& name
)
146 Create(parent
, id
, pos
, size
, style
, name
);
150 void wxStyledTextCtrl::Create(wxWindow
*parent
,
155 const wxString
& name
)
158 style
|= wxVSCROLL
| wxHSCROLL
;
160 wxControl::Create(parent
, id
, pos
, size
,
161 style
| wxWANTS_CHARS
| wxCLIP_CHILDREN
,
162 wxDefaultValidator
, name
);
165 Scintilla_LinkLexers();
167 m_swx
= new ScintillaWX(this);
169 m_lastKeyDownConsumed
= false;
173 // Put Scintilla into unicode (UTF-8) mode
174 SetCodePage(wxSTC_CP_UTF8
);
177 SetBestFittingSize(size
);
181 wxStyledTextCtrl::~wxStyledTextCtrl() {
186 //----------------------------------------------------------------------
188 long wxStyledTextCtrl::SendMsg(int msg
, long wp
, long lp
) {
190 return m_swx
->WndProc(msg
, wp
, lp
);
195 //----------------------------------------------------------------------
196 // BEGIN generated section. The following code is automatically generated
197 // by gen_iface.py from the contents of Scintilla.iface. Do not edit
198 // this file. Edit stc.cpp.in or gen_iface.py instead and regenerate.
202 // END of generated section
203 //----------------------------------------------------------------------
206 // Returns the line number of the line with the caret.
207 int wxStyledTextCtrl::GetCurrentLine() {
208 int line
= LineFromPosition(GetCurrentPos());
213 // Extract style settings from a spec-string which is composed of one or
214 // more of the following comma separated elements:
216 // bold turns on bold
217 // italic turns on italics
218 // fore:[name or #RRGGBB] sets the foreground colour
219 // back:[name or #RRGGBB] sets the background colour
220 // face:[facename] sets the font face name to use
221 // size:[num] sets the font size in points
222 // eol turns on eol filling
223 // underline turns on underlining
225 void wxStyledTextCtrl::StyleSetSpec(int styleNum
, const wxString
& spec
) {
227 wxStringTokenizer
tkz(spec
, wxT(","));
228 while (tkz
.HasMoreTokens()) {
229 wxString token
= tkz
.GetNextToken();
231 wxString option
= token
.BeforeFirst(':');
232 wxString val
= token
.AfterFirst(':');
234 if (option
== wxT("bold"))
235 StyleSetBold(styleNum
, true);
237 else if (option
== wxT("italic"))
238 StyleSetItalic(styleNum
, true);
240 else if (option
== wxT("underline"))
241 StyleSetUnderline(styleNum
, true);
243 else if (option
== wxT("eol"))
244 StyleSetEOLFilled(styleNum
, true);
246 else if (option
== wxT("size")) {
248 if (val
.ToLong(&points
))
249 StyleSetSize(styleNum
, points
);
252 else if (option
== wxT("face"))
253 StyleSetFaceName(styleNum
, val
);
255 else if (option
== wxT("fore"))
256 StyleSetForeground(styleNum
, wxColourFromSpec(val
));
258 else if (option
== wxT("back"))
259 StyleSetBackground(styleNum
, wxColourFromSpec(val
));
264 // Set style size, face, bold, italic, and underline attributes from
265 // a wxFont's attributes.
266 void wxStyledTextCtrl::StyleSetFont(int styleNum
, wxFont
& font
) {
268 // Ensure that the native font is initialized
270 GetTextExtent(wxT("X"), &x
, &y
, NULL
, NULL
, &font
);
272 int size
= font
.GetPointSize();
273 wxString faceName
= font
.GetFaceName();
274 bool bold
= font
.GetWeight() == wxBOLD
;
275 bool italic
= font
.GetStyle() != wxNORMAL
;
276 bool under
= font
.GetUnderlined();
278 // TODO: add encoding/charset mapping
279 StyleSetFontAttr(styleNum
, size
, faceName
, bold
, italic
, under
);
282 // Set all font style attributes at once.
283 void wxStyledTextCtrl::StyleSetFontAttr(int styleNum
, int size
,
284 const wxString
& faceName
,
285 bool bold
, bool italic
,
287 StyleSetSize(styleNum
, size
);
288 StyleSetFaceName(styleNum
, faceName
);
289 StyleSetBold(styleNum
, bold
);
290 StyleSetItalic(styleNum
, italic
);
291 StyleSetUnderline(styleNum
, underline
);
293 // TODO: add encoding/charset mapping
297 // Perform one of the operations defined by the wxSTC_CMD_* constants.
298 void wxStyledTextCtrl::CmdKeyExecute(int cmd
) {
303 // Set the left and right margin in the edit area, measured in pixels.
304 void wxStyledTextCtrl::SetMargins(int left
, int right
) {
306 SetMarginRight(right
);
310 // Retrieve the start and end positions of the current selection.
311 void wxStyledTextCtrl::GetSelection(int* startPos
, int* endPos
) {
312 if (startPos
!= NULL
)
313 *startPos
= SendMsg(SCI_GETSELECTIONSTART
);
315 *endPos
= SendMsg(SCI_GETSELECTIONEND
);
319 // Retrieve the point in the window where a position is displayed.
320 wxPoint
wxStyledTextCtrl::PointFromPosition(int pos
) {
321 int x
= SendMsg(SCI_POINTXFROMPOSITION
, 0, pos
);
322 int y
= SendMsg(SCI_POINTYFROMPOSITION
, 0, pos
);
323 return wxPoint(x
, y
);
326 // Scroll enough to make the given line visible
327 void wxStyledTextCtrl::ScrollToLine(int line
) {
328 m_swx
->DoScrollToLine(line
);
332 // Scroll enough to make the given column visible
333 void wxStyledTextCtrl::ScrollToColumn(int column
) {
334 m_swx
->DoScrollToColumn(column
);
338 bool wxStyledTextCtrl::SaveFile(const wxString
& filename
)
340 wxFile
file(filename
, wxFile::write
);
342 if (!file
.IsOpened())
345 bool success
= file
.Write(GetText(), *wxConvCurrent
);
353 bool wxStyledTextCtrl::LoadFile(const wxString
& filename
)
355 bool success
= false;
356 wxFile
file(filename
, wxFile::read
);
361 size_t len
= (size_t)file
.Length();
365 wxMemoryBuffer
buffer(len
+1);
366 success
= (file
.Read(buffer
.GetData(), len
) == len
);
368 ((char*)buffer
.GetData())[len
] = 0;
369 contents
= wxString(buffer
, *wxConvCurrent
, len
);
373 success
= (file
.Read(wxStringBuffer(buffer
, len
), len
) == len
);
378 success
= true; // empty file is ok
392 #if wxUSE_DRAG_AND_DROP
393 wxDragResult
wxStyledTextCtrl::DoDragOver(wxCoord x
, wxCoord y
, wxDragResult def
) {
394 return m_swx
->DoDragOver(x
, y
, def
);
398 bool wxStyledTextCtrl::DoDropText(long x
, long y
, const wxString
& data
) {
399 return m_swx
->DoDropText(x
, y
, data
);
404 void wxStyledTextCtrl::SetUseAntiAliasing(bool useAA
) {
405 m_swx
->SetUseAntiAliasing(useAA
);
408 bool wxStyledTextCtrl::GetUseAntiAliasing() {
409 return m_swx
->GetUseAntiAliasing();
412 //----------------------------------------------------------------------
415 void wxStyledTextCtrl::OnPaint(wxPaintEvent
& WXUNUSED(evt
)) {
417 m_swx
->DoPaint(&dc
, GetUpdateRegion().GetBox());
420 void wxStyledTextCtrl::OnScrollWin(wxScrollWinEvent
& evt
) {
421 if (evt
.GetOrientation() == wxHORIZONTAL
)
422 m_swx
->DoHScroll(evt
.GetEventType(), evt
.GetPosition());
424 m_swx
->DoVScroll(evt
.GetEventType(), evt
.GetPosition());
427 void wxStyledTextCtrl::OnScroll(wxScrollEvent
& evt
) {
428 wxScrollBar
* sb
= wxDynamicCast(evt
.GetEventObject(), wxScrollBar
);
430 if (sb
->IsVertical())
431 m_swx
->DoVScroll(evt
.GetEventType(), evt
.GetPosition());
433 m_swx
->DoHScroll(evt
.GetEventType(), evt
.GetPosition());
437 void wxStyledTextCtrl::OnSize(wxSizeEvent
& WXUNUSED(evt
)) {
439 wxSize sz
= GetClientSize();
440 m_swx
->DoSize(sz
.x
, sz
.y
);
444 void wxStyledTextCtrl::OnMouseLeftDown(wxMouseEvent
& evt
) {
446 wxPoint pt
= evt
.GetPosition();
447 m_swx
->DoLeftButtonDown(Point(pt
.x
, pt
.y
), m_stopWatch
.Time(),
448 evt
.ShiftDown(), evt
.ControlDown(), evt
.AltDown());
451 void wxStyledTextCtrl::OnMouseMove(wxMouseEvent
& evt
) {
452 wxPoint pt
= evt
.GetPosition();
453 m_swx
->DoLeftButtonMove(Point(pt
.x
, pt
.y
));
456 void wxStyledTextCtrl::OnMouseLeftUp(wxMouseEvent
& evt
) {
457 wxPoint pt
= evt
.GetPosition();
458 m_swx
->DoLeftButtonUp(Point(pt
.x
, pt
.y
), m_stopWatch
.Time(),
463 void wxStyledTextCtrl::OnMouseRightUp(wxMouseEvent
& evt
) {
464 wxPoint pt
= evt
.GetPosition();
465 m_swx
->DoContextMenu(Point(pt
.x
, pt
.y
));
469 void wxStyledTextCtrl::OnMouseMiddleUp(wxMouseEvent
& evt
) {
470 wxPoint pt
= evt
.GetPosition();
471 m_swx
->DoMiddleButtonUp(Point(pt
.x
, pt
.y
));
474 void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent
& evt
) {
475 wxPoint pt
= evt
.GetPosition();
476 ScreenToClient(&pt
.x
, &pt
.y
);
478 Show context menu at event point if it's within the window,
479 or at caret location if not
481 wxHitTest ht
= this->HitTest(pt
);
482 if (ht
!= wxHT_WINDOW_INSIDE
) {
483 pt
= this->PointFromPosition(this->GetCurrentPos());
485 m_swx
->DoContextMenu(Point(pt
.x
, pt
.y
));
489 void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent
& evt
) {
490 m_swx
->DoMouseWheel(evt
.GetWheelRotation(),
492 evt
.GetLinesPerAction(),
498 void wxStyledTextCtrl::OnChar(wxKeyEvent
& evt
) {
499 // On (some?) non-US keyboards the AltGr key is required to enter some
500 // common characters. It comes to us as both Alt and Ctrl down so we need
501 // to let the char through in that case, otherwise if only ctrl or only
502 // alt let's skip it.
503 bool ctrl
= evt
.ControlDown();
505 // On the Mac the Alt key is just a modifier key (like Shift) so we need
506 // to allow the char events to be processed when Alt is pressed.
507 // TODO: Should we check MetaDown instead in this case?
510 bool alt
= evt
.AltDown();
512 bool skip
= ((ctrl
|| alt
) && ! (ctrl
&& alt
));
514 int key
= evt
.GetKeyCode();
516 // printf("OnChar key:%%d consumed:%%d ctrl:%%d alt:%%d skip:%%d\n",
517 // key, m_lastKeyDownConsumed, ctrl, alt, skip);
519 if ( (key
<= WXK_START
|| key
> WXK_COMMAND
) &&
520 !m_lastKeyDownConsumed
&& !skip
) {
521 m_swx
->DoAddChar(key
);
528 void wxStyledTextCtrl::OnKeyDown(wxKeyEvent
& evt
) {
529 int key
= evt
.GetKeyCode();
530 bool shift
= evt
.ShiftDown(),
531 ctrl
= evt
.ControlDown(),
533 meta
= evt
.MetaDown();
535 int processed
= m_swx
->DoKeyDown(key
, shift
, ctrl
, alt
, meta
, &m_lastKeyDownConsumed
);
537 // printf("KeyDn key:%%d shift:%%d ctrl:%%d alt:%%d processed:%%d consumed:%%d\n",
538 // key, shift, ctrl, alt, processed, m_lastKeyDownConsumed);
540 if (!processed
&& !m_lastKeyDownConsumed
)
545 void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent
& evt
) {
546 m_swx
->DoLoseFocus();
551 void wxStyledTextCtrl::OnGainFocus(wxFocusEvent
& evt
) {
552 m_swx
->DoGainFocus();
557 void wxStyledTextCtrl::OnSysColourChanged(wxSysColourChangedEvent
& WXUNUSED(evt
)) {
558 m_swx
->DoSysColourChange();
562 void wxStyledTextCtrl::OnEraseBackground(wxEraseEvent
& WXUNUSED(evt
)) {
563 // do nothing to help avoid flashing
568 void wxStyledTextCtrl::OnMenu(wxCommandEvent
& evt
) {
569 m_swx
->DoCommand(evt
.GetId());
573 void wxStyledTextCtrl::OnListBox(wxCommandEvent
& WXUNUSED(evt
)) {
574 m_swx
->DoOnListBox();
578 void wxStyledTextCtrl::OnIdle(wxIdleEvent
& evt
) {
579 m_swx
->DoOnIdle(evt
);
583 wxSize
wxStyledTextCtrl::DoGetBestSize() const
585 // What would be the best size for a wxSTC?
586 // Just give a reasonable minimum until something else can be figured out.
587 return wxSize(200,100);
591 //----------------------------------------------------------------------
592 // Turn notifications from Scintilla into events
595 void wxStyledTextCtrl::NotifyChange() {
596 wxStyledTextEvent
evt(wxEVT_STC_CHANGE
, GetId());
597 evt
.SetEventObject(this);
598 GetEventHandler()->ProcessEvent(evt
);
602 static void SetEventText(wxStyledTextEvent
& evt
, const char* text
,
606 // The unicode conversion MUST have a null byte to terminate the
607 // string so move it into a buffer first and give it one.
608 wxMemoryBuffer
buf(length
+1);
609 buf
.AppendData((void*)text
, length
);
611 evt
.SetText(stc2wx(buf
));
615 void wxStyledTextCtrl::NotifyParent(SCNotification
* _scn
) {
616 SCNotification
& scn
= *_scn
;
617 wxStyledTextEvent
evt(0, GetId());
619 evt
.SetEventObject(this);
620 evt
.SetPosition(scn
.position
);
622 evt
.SetModifiers(scn
.modifiers
);
624 switch (scn
.nmhdr
.code
) {
625 case SCN_STYLENEEDED
:
626 evt
.SetEventType(wxEVT_STC_STYLENEEDED
);
630 evt
.SetEventType(wxEVT_STC_CHARADDED
);
633 case SCN_SAVEPOINTREACHED
:
634 evt
.SetEventType(wxEVT_STC_SAVEPOINTREACHED
);
637 case SCN_SAVEPOINTLEFT
:
638 evt
.SetEventType(wxEVT_STC_SAVEPOINTLEFT
);
641 case SCN_MODIFYATTEMPTRO
:
642 evt
.SetEventType(wxEVT_STC_ROMODIFYATTEMPT
);
646 evt
.SetEventType(wxEVT_STC_KEY
);
649 case SCN_DOUBLECLICK
:
650 evt
.SetEventType(wxEVT_STC_DOUBLECLICK
);
654 evt
.SetEventType(wxEVT_STC_UPDATEUI
);
658 evt
.SetEventType(wxEVT_STC_MODIFIED
);
659 evt
.SetModificationType(scn
.modificationType
);
660 SetEventText(evt
, scn
.text
, scn
.length
);
661 evt
.SetLength(scn
.length
);
662 evt
.SetLinesAdded(scn
.linesAdded
);
663 evt
.SetLine(scn
.line
);
664 evt
.SetFoldLevelNow(scn
.foldLevelNow
);
665 evt
.SetFoldLevelPrev(scn
.foldLevelPrev
);
668 case SCN_MACRORECORD
:
669 evt
.SetEventType(wxEVT_STC_MACRORECORD
);
670 evt
.SetMessage(scn
.message
);
671 evt
.SetWParam(scn
.wParam
);
672 evt
.SetLParam(scn
.lParam
);
675 case SCN_MARGINCLICK
:
676 evt
.SetEventType(wxEVT_STC_MARGINCLICK
);
677 evt
.SetMargin(scn
.margin
);
681 evt
.SetEventType(wxEVT_STC_NEEDSHOWN
);
682 evt
.SetLength(scn
.length
);
686 evt
.SetEventType(wxEVT_STC_PAINTED
);
689 case SCN_USERLISTSELECTION
:
690 evt
.SetEventType(wxEVT_STC_USERLISTSELECTION
);
691 evt
.SetListType(scn
.listType
);
692 SetEventText(evt
, scn
.text
, strlen(scn
.text
));
696 evt
.SetEventType(wxEVT_STC_URIDROPPED
);
697 SetEventText(evt
, scn
.text
, strlen(scn
.text
));
701 evt
.SetEventType(wxEVT_STC_DWELLSTART
);
707 evt
.SetEventType(wxEVT_STC_DWELLEND
);
713 evt
.SetEventType(wxEVT_STC_ZOOM
);
716 case SCN_HOTSPOTCLICK
:
717 evt
.SetEventType(wxEVT_STC_HOTSPOT_CLICK
);
720 case SCN_HOTSPOTDOUBLECLICK
:
721 evt
.SetEventType(wxEVT_STC_HOTSPOT_DCLICK
);
724 case SCN_CALLTIPCLICK
:
725 evt
.SetEventType(wxEVT_STC_CALLTIP_CLICK
);
732 GetEventHandler()->ProcessEvent(evt
);
736 //----------------------------------------------------------------------
737 //----------------------------------------------------------------------
738 //----------------------------------------------------------------------
740 wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType
, int id
)
741 : wxCommandEvent(commandType
, id
)
746 m_modificationType
= 0;
759 m_dragAllowMove
= false;
760 #if wxUSE_DRAG_AND_DROP
761 m_dragResult
= wxDragNone
;
765 bool wxStyledTextEvent::GetShift() const { return (m_modifiers
& SCI_SHIFT
) != 0; }
766 bool wxStyledTextEvent::GetControl() const { return (m_modifiers
& SCI_CTRL
) != 0; }
767 bool wxStyledTextEvent::GetAlt() const { return (m_modifiers
& SCI_ALT
) != 0; }
770 wxStyledTextEvent::wxStyledTextEvent(const wxStyledTextEvent
& event
):
771 wxCommandEvent(event
)
773 m_position
= event
.m_position
;
775 m_modifiers
= event
.m_modifiers
;
776 m_modificationType
= event
.m_modificationType
;
777 m_text
= event
.m_text
;
778 m_length
= event
.m_length
;
779 m_linesAdded
= event
.m_linesAdded
;
780 m_line
= event
.m_line
;
781 m_foldLevelNow
= event
.m_foldLevelNow
;
782 m_foldLevelPrev
= event
.m_foldLevelPrev
;
784 m_margin
= event
.m_margin
;
786 m_message
= event
.m_message
;
787 m_wParam
= event
.m_wParam
;
788 m_lParam
= event
.m_lParam
;
790 m_listType
= event
.m_listType
;
794 m_dragText
= event
.m_dragText
;
795 m_dragAllowMove
=event
.m_dragAllowMove
;
796 #if wxUSE_DRAG_AND_DROP
797 m_dragResult
= event
.m_dragResult
;
801 //----------------------------------------------------------------------
802 //----------------------------------------------------------------------