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 "#RRGGBB"
56 long red
, green
, blue
;
57 red
= green
= blue
= 0;
58 spec
.Mid(1,2).ToLong(&red
, 16);
59 spec
.Mid(3,2).ToLong(&green
, 16);
60 spec
.Mid(5,2).ToLong(&blue
, 16);
61 return wxColour(red
, green
, blue
);
64 //----------------------------------------------------------------------
66 DEFINE_EVENT_TYPE( wxEVT_STC_CHANGE
)
67 DEFINE_EVENT_TYPE( wxEVT_STC_STYLENEEDED
)
68 DEFINE_EVENT_TYPE( wxEVT_STC_CHARADDED
)
69 DEFINE_EVENT_TYPE( wxEVT_STC_SAVEPOINTREACHED
)
70 DEFINE_EVENT_TYPE( wxEVT_STC_SAVEPOINTLEFT
)
71 DEFINE_EVENT_TYPE( wxEVT_STC_ROMODIFYATTEMPT
)
72 DEFINE_EVENT_TYPE( wxEVT_STC_KEY
)
73 DEFINE_EVENT_TYPE( wxEVT_STC_DOUBLECLICK
)
74 DEFINE_EVENT_TYPE( wxEVT_STC_UPDATEUI
)
75 DEFINE_EVENT_TYPE( wxEVT_STC_MODIFIED
)
76 DEFINE_EVENT_TYPE( wxEVT_STC_MACRORECORD
)
77 DEFINE_EVENT_TYPE( wxEVT_STC_MARGINCLICK
)
78 DEFINE_EVENT_TYPE( wxEVT_STC_NEEDSHOWN
)
79 DEFINE_EVENT_TYPE( wxEVT_STC_PAINTED
)
80 DEFINE_EVENT_TYPE( wxEVT_STC_USERLISTSELECTION
)
81 DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED
)
82 DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART
)
83 DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND
)
84 DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG
)
85 DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER
)
86 DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP
)
87 DEFINE_EVENT_TYPE( wxEVT_STC_ZOOM
)
88 DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_CLICK
)
89 DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_DCLICK
)
90 DEFINE_EVENT_TYPE( wxEVT_STC_CALLTIP_CLICK
)
94 BEGIN_EVENT_TABLE(wxStyledTextCtrl
, wxControl
)
95 EVT_PAINT (wxStyledTextCtrl::OnPaint
)
96 EVT_SCROLLWIN (wxStyledTextCtrl::OnScrollWin
)
97 EVT_SCROLL (wxStyledTextCtrl::OnScroll
)
98 EVT_SIZE (wxStyledTextCtrl::OnSize
)
99 EVT_LEFT_DOWN (wxStyledTextCtrl::OnMouseLeftDown
)
100 // Let Scintilla see the double click as a second click
101 EVT_LEFT_DCLICK (wxStyledTextCtrl::OnMouseLeftDown
)
102 EVT_MOTION (wxStyledTextCtrl::OnMouseMove
)
103 EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp
)
104 #if defined(__WXGTK__) || defined(__WXMAC__)
105 EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp
)
107 EVT_CONTEXT_MENU (wxStyledTextCtrl::OnContextMenu
)
109 EVT_MOUSEWHEEL (wxStyledTextCtrl::OnMouseWheel
)
110 EVT_MIDDLE_UP (wxStyledTextCtrl::OnMouseMiddleUp
)
111 EVT_CHAR (wxStyledTextCtrl::OnChar
)
112 EVT_KEY_DOWN (wxStyledTextCtrl::OnKeyDown
)
113 EVT_KILL_FOCUS (wxStyledTextCtrl::OnLoseFocus
)
114 EVT_SET_FOCUS (wxStyledTextCtrl::OnGainFocus
)
115 EVT_SYS_COLOUR_CHANGED (wxStyledTextCtrl::OnSysColourChanged
)
116 EVT_ERASE_BACKGROUND (wxStyledTextCtrl::OnEraseBackground
)
117 EVT_MENU_RANGE (10, 16, wxStyledTextCtrl::OnMenu
)
118 EVT_LISTBOX_DCLICK (-1, wxStyledTextCtrl::OnListBox
)
122 IMPLEMENT_CLASS(wxStyledTextCtrl
, wxControl
)
123 IMPLEMENT_DYNAMIC_CLASS(wxStyledTextEvent
, wxCommandEvent
)
126 // forces the linking of the lexer modules
127 int Scintilla_LinkLexers();
130 //----------------------------------------------------------------------
131 // Constructor and Destructor
133 wxStyledTextCtrl::wxStyledTextCtrl(wxWindow
*parent
,
138 const wxString
& name
)
141 Create(parent
, id
, pos
, size
, style
, name
);
145 void wxStyledTextCtrl::Create(wxWindow
*parent
,
150 const wxString
& name
)
153 style
|= wxVSCROLL
| wxHSCROLL
;
155 wxControl::Create(parent
, id
, pos
, size
,
156 style
| wxWANTS_CHARS
| wxCLIP_CHILDREN
,
157 wxDefaultValidator
, name
);
160 Scintilla_LinkLexers();
162 m_swx
= new ScintillaWX(this);
164 m_lastKeyDownConsumed
= FALSE
;
168 // Put Scintilla into unicode (UTF-8) mode
169 SetCodePage(wxSTC_CP_UTF8
);
172 SetBestFittingSize(size
);
176 wxStyledTextCtrl::~wxStyledTextCtrl() {
181 //----------------------------------------------------------------------
183 long wxStyledTextCtrl::SendMsg(int msg
, long wp
, long lp
) {
185 return m_swx
->WndProc(msg
, wp
, lp
);
190 //----------------------------------------------------------------------
191 // BEGIN generated section. The following code is automatically generated
192 // by gen_iface.py from the contents of Scintilla.iface. Do not edit
193 // this file. Edit stc.cpp.in or gen_iface.py instead and regenerate.
197 // END of generated section
198 //----------------------------------------------------------------------
201 // Returns the line number of the line with the caret.
202 int wxStyledTextCtrl::GetCurrentLine() {
203 int line
= LineFromPosition(GetCurrentPos());
208 // Extract style settings from a spec-string which is composed of one or
209 // more of the following comma separated elements:
211 // bold turns on bold
212 // italic turns on italics
213 // fore:#RRGGBB sets the foreground colour
214 // back:#RRGGBB sets the background colour
215 // face:[facename] sets the font face name to use
216 // size:[num] sets the font size in points
217 // eol turns on eol filling
218 // underline turns on underlining
220 void wxStyledTextCtrl::StyleSetSpec(int styleNum
, const wxString
& spec
) {
222 wxStringTokenizer
tkz(spec
, wxT(","));
223 while (tkz
.HasMoreTokens()) {
224 wxString token
= tkz
.GetNextToken();
226 wxString option
= token
.BeforeFirst(':');
227 wxString val
= token
.AfterFirst(':');
229 if (option
== wxT("bold"))
230 StyleSetBold(styleNum
, true);
232 else if (option
== wxT("italic"))
233 StyleSetItalic(styleNum
, true);
235 else if (option
== wxT("underline"))
236 StyleSetUnderline(styleNum
, true);
238 else if (option
== wxT("eol"))
239 StyleSetEOLFilled(styleNum
, true);
241 else if (option
== wxT("size")) {
243 if (val
.ToLong(&points
))
244 StyleSetSize(styleNum
, points
);
247 else if (option
== wxT("face"))
248 StyleSetFaceName(styleNum
, val
);
250 else if (option
== wxT("fore"))
251 StyleSetForeground(styleNum
, wxColourFromSpec(val
));
253 else if (option
== wxT("back"))
254 StyleSetBackground(styleNum
, wxColourFromSpec(val
));
259 // Set style size, face, bold, italic, and underline attributes from
260 // a wxFont's attributes.
261 void wxStyledTextCtrl::StyleSetFont(int styleNum
, wxFont
& font
) {
263 // Ensure that the native font is initialized
265 GetTextExtent(wxT("X"), &x
, &y
, NULL
, NULL
, &font
);
267 int size
= font
.GetPointSize();
268 wxString faceName
= font
.GetFaceName();
269 bool bold
= font
.GetWeight() == wxBOLD
;
270 bool italic
= font
.GetStyle() != wxNORMAL
;
271 bool under
= font
.GetUnderlined();
273 // TODO: add encoding/charset mapping
274 StyleSetFontAttr(styleNum
, size
, faceName
, bold
, italic
, under
);
277 // Set all font style attributes at once.
278 void wxStyledTextCtrl::StyleSetFontAttr(int styleNum
, int size
,
279 const wxString
& faceName
,
280 bool bold
, bool italic
,
282 StyleSetSize(styleNum
, size
);
283 StyleSetFaceName(styleNum
, faceName
);
284 StyleSetBold(styleNum
, bold
);
285 StyleSetItalic(styleNum
, italic
);
286 StyleSetUnderline(styleNum
, underline
);
288 // TODO: add encoding/charset mapping
292 // Perform one of the operations defined by the wxSTC_CMD_* constants.
293 void wxStyledTextCtrl::CmdKeyExecute(int cmd
) {
298 // Set the left and right margin in the edit area, measured in pixels.
299 void wxStyledTextCtrl::SetMargins(int left
, int right
) {
301 SetMarginRight(right
);
305 // Retrieve the start and end positions of the current selection.
306 void wxStyledTextCtrl::GetSelection(int* startPos
, int* endPos
) {
307 if (startPos
!= NULL
)
308 *startPos
= SendMsg(SCI_GETSELECTIONSTART
);
310 *endPos
= SendMsg(SCI_GETSELECTIONEND
);
314 // Retrieve the point in the window where a position is displayed.
315 wxPoint
wxStyledTextCtrl::PointFromPosition(int pos
) {
316 int x
= SendMsg(SCI_POINTXFROMPOSITION
, 0, pos
);
317 int y
= SendMsg(SCI_POINTYFROMPOSITION
, 0, pos
);
318 return wxPoint(x
, y
);
321 // Scroll enough to make the given line visible
322 void wxStyledTextCtrl::ScrollToLine(int line
) {
323 m_swx
->DoScrollToLine(line
);
327 // Scroll enough to make the given column visible
328 void wxStyledTextCtrl::ScrollToColumn(int column
) {
329 m_swx
->DoScrollToColumn(column
);
333 bool wxStyledTextCtrl::SaveFile(const wxString
& filename
)
335 wxFile
file(filename
, wxFile::write
);
337 if (!file
.IsOpened())
340 bool success
= file
.Write(GetText(), *wxConvCurrent
);
348 bool wxStyledTextCtrl::LoadFile(const wxString
& filename
)
350 bool success
= false;
351 wxFile
file(filename
, wxFile::read
);
356 off_t len
= file
.Length();
360 wxMemoryBuffer
buffer(len
+1);
361 success
= (file
.Read(buffer
.GetData(), len
) == len
);
363 ((char*)buffer
.GetData())[len
] = 0;
364 contents
= wxString(buffer
, *wxConvCurrent
, len
);
368 success
= (file
.Read(wxStringBuffer(buffer
, len
), len
) == len
);
373 success
= true; // empty file is ok
387 #if wxUSE_DRAG_AND_DROP
388 wxDragResult
wxStyledTextCtrl::DoDragOver(wxCoord x
, wxCoord y
, wxDragResult def
) {
389 return m_swx
->DoDragOver(x
, y
, def
);
393 bool wxStyledTextCtrl::DoDropText(long x
, long y
, const wxString
& data
) {
394 return m_swx
->DoDropText(x
, y
, data
);
399 void wxStyledTextCtrl::SetUseAntiAliasing(bool useAA
) {
400 m_swx
->SetUseAntiAliasing(useAA
);
403 bool wxStyledTextCtrl::GetUseAntiAliasing() {
404 return m_swx
->GetUseAntiAliasing();
407 //----------------------------------------------------------------------
410 void wxStyledTextCtrl::OnPaint(wxPaintEvent
& WXUNUSED(evt
)) {
412 m_swx
->DoPaint(&dc
, GetUpdateRegion().GetBox());
415 void wxStyledTextCtrl::OnScrollWin(wxScrollWinEvent
& evt
) {
416 if (evt
.GetOrientation() == wxHORIZONTAL
)
417 m_swx
->DoHScroll(evt
.GetEventType(), evt
.GetPosition());
419 m_swx
->DoVScroll(evt
.GetEventType(), evt
.GetPosition());
422 void wxStyledTextCtrl::OnScroll(wxScrollEvent
& evt
) {
423 wxScrollBar
* sb
= wxDynamicCast(evt
.GetEventObject(), wxScrollBar
);
425 if (sb
->IsVertical())
426 m_swx
->DoVScroll(evt
.GetEventType(), evt
.GetPosition());
428 m_swx
->DoHScroll(evt
.GetEventType(), evt
.GetPosition());
432 void wxStyledTextCtrl::OnSize(wxSizeEvent
& WXUNUSED(evt
)) {
434 wxSize sz
= GetClientSize();
435 m_swx
->DoSize(sz
.x
, sz
.y
);
439 void wxStyledTextCtrl::OnMouseLeftDown(wxMouseEvent
& evt
) {
441 wxPoint pt
= evt
.GetPosition();
442 m_swx
->DoLeftButtonDown(Point(pt
.x
, pt
.y
), m_stopWatch
.Time(),
443 evt
.ShiftDown(), evt
.ControlDown(), evt
.AltDown());
446 void wxStyledTextCtrl::OnMouseMove(wxMouseEvent
& evt
) {
447 wxPoint pt
= evt
.GetPosition();
448 m_swx
->DoLeftButtonMove(Point(pt
.x
, pt
.y
));
451 void wxStyledTextCtrl::OnMouseLeftUp(wxMouseEvent
& evt
) {
452 wxPoint pt
= evt
.GetPosition();
453 m_swx
->DoLeftButtonUp(Point(pt
.x
, pt
.y
), m_stopWatch
.Time(),
458 void wxStyledTextCtrl::OnMouseRightUp(wxMouseEvent
& evt
) {
459 wxPoint pt
= evt
.GetPosition();
460 m_swx
->DoContextMenu(Point(pt
.x
, pt
.y
));
464 void wxStyledTextCtrl::OnMouseMiddleUp(wxMouseEvent
& evt
) {
465 wxPoint pt
= evt
.GetPosition();
466 m_swx
->DoMiddleButtonUp(Point(pt
.x
, pt
.y
));
469 void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent
& evt
) {
470 wxPoint pt
= evt
.GetPosition();
471 ScreenToClient(&pt
.x
, &pt
.y
);
473 Show context menu at event point if it's within the window,
474 or at caret location if not
476 wxHitTest ht
= this->HitTest(pt
);
477 if (ht
!= wxHT_WINDOW_INSIDE
) {
478 pt
= this->PointFromPosition(this->GetCurrentPos());
480 m_swx
->DoContextMenu(Point(pt
.x
, pt
.y
));
484 void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent
& evt
) {
485 m_swx
->DoMouseWheel(evt
.GetWheelRotation(),
487 evt
.GetLinesPerAction(),
493 void wxStyledTextCtrl::OnChar(wxKeyEvent
& evt
) {
494 // On (some?) non-US keyboards the AltGr key is required to enter some
495 // common characters. It comes to us as both Alt and Ctrl down so we need
496 // to let the char through in that case, otherwise if only ctrl or only
497 // alt let's skip it.
498 bool ctrl
= evt
.ControlDown();
499 bool alt
= evt
.AltDown();
500 bool skip
= ((ctrl
|| alt
) && ! (ctrl
&& alt
));
502 int key
= evt
.GetKeyCode();
504 // printf("OnChar key:%%d consumed:%%d ctrl:%%d alt:%%d skip:%%d\n",
505 // key, m_lastKeyDownConsumed, ctrl, alt, skip);
507 if ( (key
<= WXK_START
|| key
> WXK_COMMAND
) &&
508 !m_lastKeyDownConsumed
&& !skip
) {
509 m_swx
->DoAddChar(key
);
516 void wxStyledTextCtrl::OnKeyDown(wxKeyEvent
& evt
) {
517 int key
= evt
.GetKeyCode();
518 bool shift
= evt
.ShiftDown(),
519 ctrl
= evt
.ControlDown(),
521 meta
= evt
.MetaDown();
523 int processed
= m_swx
->DoKeyDown(key
, shift
, ctrl
, alt
, meta
, &m_lastKeyDownConsumed
);
525 // printf("KeyDn key:%%d shift:%%d ctrl:%%d alt:%%d processed:%%d consumed:%%d\n",
526 // key, shift, ctrl, alt, processed, m_lastKeyDownConsumed);
528 if (!processed
&& !m_lastKeyDownConsumed
)
533 void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent
& evt
) {
534 m_swx
->DoLoseFocus();
539 void wxStyledTextCtrl::OnGainFocus(wxFocusEvent
& evt
) {
540 m_swx
->DoGainFocus();
545 void wxStyledTextCtrl::OnSysColourChanged(wxSysColourChangedEvent
& WXUNUSED(evt
)) {
546 m_swx
->DoSysColourChange();
550 void wxStyledTextCtrl::OnEraseBackground(wxEraseEvent
& WXUNUSED(evt
)) {
551 // do nothing to help avoid flashing
556 void wxStyledTextCtrl::OnMenu(wxCommandEvent
& evt
) {
557 m_swx
->DoCommand(evt
.GetId());
561 void wxStyledTextCtrl::OnListBox(wxCommandEvent
& WXUNUSED(evt
)) {
562 m_swx
->DoOnListBox();
566 void wxStyledTextCtrl::OnIdle(wxIdleEvent
& evt
) {
567 m_swx
->DoOnIdle(evt
);
571 wxSize
wxStyledTextCtrl::DoGetBestSize() const
573 // What would be the best size for a wxSTC?
574 // Just give a reasonable minimum until something else can be figured out.
575 return wxSize(200,100);
579 //----------------------------------------------------------------------
580 // Turn notifications from Scintilla into events
583 void wxStyledTextCtrl::NotifyChange() {
584 wxStyledTextEvent
evt(wxEVT_STC_CHANGE
, GetId());
585 evt
.SetEventObject(this);
586 GetEventHandler()->ProcessEvent(evt
);
590 static void SetEventText(wxStyledTextEvent
& evt
, const char* text
,
594 // The unicode conversion MUST have a null byte to terminate the
595 // string so move it into a buffer first and give it one.
596 wxMemoryBuffer
buf(length
+1);
597 buf
.AppendData((void*)text
, length
);
599 evt
.SetText(stc2wx(buf
));
603 void wxStyledTextCtrl::NotifyParent(SCNotification
* _scn
) {
604 SCNotification
& scn
= *_scn
;
605 wxStyledTextEvent
evt(0, GetId());
607 evt
.SetEventObject(this);
608 evt
.SetPosition(scn
.position
);
610 evt
.SetModifiers(scn
.modifiers
);
612 switch (scn
.nmhdr
.code
) {
613 case SCN_STYLENEEDED
:
614 evt
.SetEventType(wxEVT_STC_STYLENEEDED
);
618 evt
.SetEventType(wxEVT_STC_CHARADDED
);
621 case SCN_SAVEPOINTREACHED
:
622 evt
.SetEventType(wxEVT_STC_SAVEPOINTREACHED
);
625 case SCN_SAVEPOINTLEFT
:
626 evt
.SetEventType(wxEVT_STC_SAVEPOINTLEFT
);
629 case SCN_MODIFYATTEMPTRO
:
630 evt
.SetEventType(wxEVT_STC_ROMODIFYATTEMPT
);
634 evt
.SetEventType(wxEVT_STC_KEY
);
637 case SCN_DOUBLECLICK
:
638 evt
.SetEventType(wxEVT_STC_DOUBLECLICK
);
642 evt
.SetEventType(wxEVT_STC_UPDATEUI
);
646 evt
.SetEventType(wxEVT_STC_MODIFIED
);
647 evt
.SetModificationType(scn
.modificationType
);
648 SetEventText(evt
, scn
.text
, scn
.length
);
649 evt
.SetLength(scn
.length
);
650 evt
.SetLinesAdded(scn
.linesAdded
);
651 evt
.SetLine(scn
.line
);
652 evt
.SetFoldLevelNow(scn
.foldLevelNow
);
653 evt
.SetFoldLevelPrev(scn
.foldLevelPrev
);
656 case SCN_MACRORECORD
:
657 evt
.SetEventType(wxEVT_STC_MACRORECORD
);
658 evt
.SetMessage(scn
.message
);
659 evt
.SetWParam(scn
.wParam
);
660 evt
.SetLParam(scn
.lParam
);
663 case SCN_MARGINCLICK
:
664 evt
.SetEventType(wxEVT_STC_MARGINCLICK
);
665 evt
.SetMargin(scn
.margin
);
669 evt
.SetEventType(wxEVT_STC_NEEDSHOWN
);
670 evt
.SetLength(scn
.length
);
674 evt
.SetEventType(wxEVT_STC_PAINTED
);
677 case SCN_USERLISTSELECTION
:
678 evt
.SetEventType(wxEVT_STC_USERLISTSELECTION
);
679 evt
.SetListType(scn
.listType
);
680 SetEventText(evt
, scn
.text
, strlen(scn
.text
));
684 evt
.SetEventType(wxEVT_STC_URIDROPPED
);
685 SetEventText(evt
, scn
.text
, strlen(scn
.text
));
689 evt
.SetEventType(wxEVT_STC_DWELLSTART
);
695 evt
.SetEventType(wxEVT_STC_DWELLEND
);
701 evt
.SetEventType(wxEVT_STC_ZOOM
);
704 case SCN_HOTSPOTCLICK
:
705 evt
.SetEventType(wxEVT_STC_HOTSPOT_CLICK
);
708 case SCN_HOTSPOTDOUBLECLICK
:
709 evt
.SetEventType(wxEVT_STC_HOTSPOT_DCLICK
);
712 case SCN_CALLTIPCLICK
:
713 evt
.SetEventType(wxEVT_STC_CALLTIP_CLICK
);
720 GetEventHandler()->ProcessEvent(evt
);
724 //----------------------------------------------------------------------
725 //----------------------------------------------------------------------
726 //----------------------------------------------------------------------
728 wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType
, int id
)
729 : wxCommandEvent(commandType
, id
)
734 m_modificationType
= 0;
747 m_dragAllowMove
= FALSE
;
748 #if wxUSE_DRAG_AND_DROP
749 m_dragResult
= wxDragNone
;
753 bool wxStyledTextEvent::GetShift() const { return (m_modifiers
& SCI_SHIFT
) != 0; }
754 bool wxStyledTextEvent::GetControl() const { return (m_modifiers
& SCI_CTRL
) != 0; }
755 bool wxStyledTextEvent::GetAlt() const { return (m_modifiers
& SCI_ALT
) != 0; }
758 wxStyledTextEvent::wxStyledTextEvent(const wxStyledTextEvent
& event
):
759 wxCommandEvent(event
)
761 m_position
= event
.m_position
;
763 m_modifiers
= event
.m_modifiers
;
764 m_modificationType
= event
.m_modificationType
;
765 m_text
= event
.m_text
;
766 m_length
= event
.m_length
;
767 m_linesAdded
= event
.m_linesAdded
;
768 m_line
= event
.m_line
;
769 m_foldLevelNow
= event
.m_foldLevelNow
;
770 m_foldLevelPrev
= event
.m_foldLevelPrev
;
772 m_margin
= event
.m_margin
;
774 m_message
= event
.m_message
;
775 m_wParam
= event
.m_wParam
;
776 m_lParam
= event
.m_lParam
;
778 m_listType
= event
.m_listType
;
782 m_dragText
= event
.m_dragText
;
783 m_dragAllowMove
=event
.m_dragAllowMove
;
784 #if wxUSE_DRAG_AND_DROP
785 m_dragResult
= event
.m_dragResult
;
789 //----------------------------------------------------------------------
790 //----------------------------------------------------------------------