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
);
193 //----------------------------------------------------------------------
195 // Set the vertical scrollbar to use instead of the ont that's built-in.
196 void wxStyledTextCtrl::SetVScrollBar(wxScrollBar
* bar
) {
199 // ensure that the built-in scrollbar is not visible
200 SetScrollbar(wxVERTICAL
, 0, 0, 0);
205 // Set the horizontal scrollbar to use instead of the ont that's built-in.
206 void wxStyledTextCtrl::SetHScrollBar(wxScrollBar
* bar
) {
209 // ensure that the built-in scrollbar is not visible
210 SetScrollbar(wxHORIZONTAL
, 0, 0, 0);
214 //----------------------------------------------------------------------
215 // BEGIN generated section. The following code is automatically generated
216 // by gen_iface.py from the contents of Scintilla.iface. Do not edit
217 // this file. Edit stc.cpp.in or gen_iface.py instead and regenerate.
221 // END of generated section
222 //----------------------------------------------------------------------
225 // Returns the line number of the line with the caret.
226 int wxStyledTextCtrl::GetCurrentLine() {
227 int line
= LineFromPosition(GetCurrentPos());
232 // Extract style settings from a spec-string which is composed of one or
233 // more of the following comma separated elements:
235 // bold turns on bold
236 // italic turns on italics
237 // fore:[name or #RRGGBB] sets the foreground colour
238 // back:[name or #RRGGBB] sets the background colour
239 // face:[facename] sets the font face name to use
240 // size:[num] sets the font size in points
241 // eol turns on eol filling
242 // underline turns on underlining
244 void wxStyledTextCtrl::StyleSetSpec(int styleNum
, const wxString
& spec
) {
246 wxStringTokenizer
tkz(spec
, wxT(","));
247 while (tkz
.HasMoreTokens()) {
248 wxString token
= tkz
.GetNextToken();
250 wxString option
= token
.BeforeFirst(':');
251 wxString val
= token
.AfterFirst(':');
253 if (option
== wxT("bold"))
254 StyleSetBold(styleNum
, true);
256 else if (option
== wxT("italic"))
257 StyleSetItalic(styleNum
, true);
259 else if (option
== wxT("underline"))
260 StyleSetUnderline(styleNum
, true);
262 else if (option
== wxT("eol"))
263 StyleSetEOLFilled(styleNum
, true);
265 else if (option
== wxT("size")) {
267 if (val
.ToLong(&points
))
268 StyleSetSize(styleNum
, points
);
271 else if (option
== wxT("face"))
272 StyleSetFaceName(styleNum
, val
);
274 else if (option
== wxT("fore"))
275 StyleSetForeground(styleNum
, wxColourFromSpec(val
));
277 else if (option
== wxT("back"))
278 StyleSetBackground(styleNum
, wxColourFromSpec(val
));
283 // Set style size, face, bold, italic, and underline attributes from
284 // a wxFont's attributes.
285 void wxStyledTextCtrl::StyleSetFont(int styleNum
, wxFont
& font
) {
287 // Ensure that the native font is initialized
289 GetTextExtent(wxT("X"), &x
, &y
, NULL
, NULL
, &font
);
291 int size
= font
.GetPointSize();
292 wxString faceName
= font
.GetFaceName();
293 bool bold
= font
.GetWeight() == wxBOLD
;
294 bool italic
= font
.GetStyle() != wxNORMAL
;
295 bool under
= font
.GetUnderlined();
297 // TODO: add encoding/charset mapping
298 StyleSetFontAttr(styleNum
, size
, faceName
, bold
, italic
, under
);
301 // Set all font style attributes at once.
302 void wxStyledTextCtrl::StyleSetFontAttr(int styleNum
, int size
,
303 const wxString
& faceName
,
304 bool bold
, bool italic
,
306 StyleSetSize(styleNum
, size
);
307 StyleSetFaceName(styleNum
, faceName
);
308 StyleSetBold(styleNum
, bold
);
309 StyleSetItalic(styleNum
, italic
);
310 StyleSetUnderline(styleNum
, underline
);
312 // TODO: add encoding/charset mapping
316 // Perform one of the operations defined by the wxSTC_CMD_* constants.
317 void wxStyledTextCtrl::CmdKeyExecute(int cmd
) {
322 // Set the left and right margin in the edit area, measured in pixels.
323 void wxStyledTextCtrl::SetMargins(int left
, int right
) {
325 SetMarginRight(right
);
329 // Retrieve the start and end positions of the current selection.
330 void wxStyledTextCtrl::GetSelection(int* startPos
, int* endPos
) {
331 if (startPos
!= NULL
)
332 *startPos
= SendMsg(SCI_GETSELECTIONSTART
);
334 *endPos
= SendMsg(SCI_GETSELECTIONEND
);
338 // Retrieve the point in the window where a position is displayed.
339 wxPoint
wxStyledTextCtrl::PointFromPosition(int pos
) {
340 int x
= SendMsg(SCI_POINTXFROMPOSITION
, 0, pos
);
341 int y
= SendMsg(SCI_POINTYFROMPOSITION
, 0, pos
);
342 return wxPoint(x
, y
);
345 // Scroll enough to make the given line visible
346 void wxStyledTextCtrl::ScrollToLine(int line
) {
347 m_swx
->DoScrollToLine(line
);
351 // Scroll enough to make the given column visible
352 void wxStyledTextCtrl::ScrollToColumn(int column
) {
353 m_swx
->DoScrollToColumn(column
);
357 bool wxStyledTextCtrl::SaveFile(const wxString
& filename
)
359 wxFile
file(filename
, wxFile::write
);
361 if (!file
.IsOpened())
364 bool success
= file
.Write(GetText(), *wxConvCurrent
);
372 bool wxStyledTextCtrl::LoadFile(const wxString
& filename
)
374 bool success
= false;
375 wxFile
file(filename
, wxFile::read
);
380 size_t len
= (size_t)file
.Length();
384 wxMemoryBuffer
buffer(len
+1);
385 success
= (file
.Read(buffer
.GetData(), len
) == len
);
387 ((char*)buffer
.GetData())[len
] = 0;
388 contents
= wxString(buffer
, *wxConvCurrent
, len
);
392 success
= (file
.Read(wxStringBuffer(buffer
, len
), len
) == len
);
397 success
= true; // empty file is ok
411 #if wxUSE_DRAG_AND_DROP
412 wxDragResult
wxStyledTextCtrl::DoDragOver(wxCoord x
, wxCoord y
, wxDragResult def
) {
413 return m_swx
->DoDragOver(x
, y
, def
);
417 bool wxStyledTextCtrl::DoDropText(long x
, long y
, const wxString
& data
) {
418 return m_swx
->DoDropText(x
, y
, data
);
423 void wxStyledTextCtrl::SetUseAntiAliasing(bool useAA
) {
424 m_swx
->SetUseAntiAliasing(useAA
);
427 bool wxStyledTextCtrl::GetUseAntiAliasing() {
428 return m_swx
->GetUseAntiAliasing();
431 //----------------------------------------------------------------------
434 void wxStyledTextCtrl::OnPaint(wxPaintEvent
& WXUNUSED(evt
)) {
436 m_swx
->DoPaint(&dc
, GetUpdateRegion().GetBox());
439 void wxStyledTextCtrl::OnScrollWin(wxScrollWinEvent
& evt
) {
440 if (evt
.GetOrientation() == wxHORIZONTAL
)
441 m_swx
->DoHScroll(evt
.GetEventType(), evt
.GetPosition());
443 m_swx
->DoVScroll(evt
.GetEventType(), evt
.GetPosition());
446 void wxStyledTextCtrl::OnScroll(wxScrollEvent
& evt
) {
447 wxScrollBar
* sb
= wxDynamicCast(evt
.GetEventObject(), wxScrollBar
);
449 if (sb
->IsVertical())
450 m_swx
->DoVScroll(evt
.GetEventType(), evt
.GetPosition());
452 m_swx
->DoHScroll(evt
.GetEventType(), evt
.GetPosition());
456 void wxStyledTextCtrl::OnSize(wxSizeEvent
& WXUNUSED(evt
)) {
458 wxSize sz
= GetClientSize();
459 m_swx
->DoSize(sz
.x
, sz
.y
);
463 void wxStyledTextCtrl::OnMouseLeftDown(wxMouseEvent
& evt
) {
465 wxPoint pt
= evt
.GetPosition();
466 m_swx
->DoLeftButtonDown(Point(pt
.x
, pt
.y
), m_stopWatch
.Time(),
467 evt
.ShiftDown(), evt
.ControlDown(), evt
.AltDown());
470 void wxStyledTextCtrl::OnMouseMove(wxMouseEvent
& evt
) {
471 wxPoint pt
= evt
.GetPosition();
472 m_swx
->DoLeftButtonMove(Point(pt
.x
, pt
.y
));
475 void wxStyledTextCtrl::OnMouseLeftUp(wxMouseEvent
& evt
) {
476 wxPoint pt
= evt
.GetPosition();
477 m_swx
->DoLeftButtonUp(Point(pt
.x
, pt
.y
), m_stopWatch
.Time(),
482 void wxStyledTextCtrl::OnMouseRightUp(wxMouseEvent
& evt
) {
483 wxPoint pt
= evt
.GetPosition();
484 m_swx
->DoContextMenu(Point(pt
.x
, pt
.y
));
488 void wxStyledTextCtrl::OnMouseMiddleUp(wxMouseEvent
& evt
) {
489 wxPoint pt
= evt
.GetPosition();
490 m_swx
->DoMiddleButtonUp(Point(pt
.x
, pt
.y
));
493 void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent
& evt
) {
494 wxPoint pt
= evt
.GetPosition();
495 ScreenToClient(&pt
.x
, &pt
.y
);
497 Show context menu at event point if it's within the window,
498 or at caret location if not
500 wxHitTest ht
= this->HitTest(pt
);
501 if (ht
!= wxHT_WINDOW_INSIDE
) {
502 pt
= this->PointFromPosition(this->GetCurrentPos());
504 m_swx
->DoContextMenu(Point(pt
.x
, pt
.y
));
508 void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent
& evt
) {
509 m_swx
->DoMouseWheel(evt
.GetWheelRotation(),
511 evt
.GetLinesPerAction(),
517 void wxStyledTextCtrl::OnChar(wxKeyEvent
& evt
) {
518 // On (some?) non-US keyboards the AltGr key is required to enter some
519 // common characters. It comes to us as both Alt and Ctrl down so we need
520 // to let the char through in that case, otherwise if only ctrl or only
521 // alt let's skip it.
522 bool ctrl
= evt
.ControlDown();
524 // On the Mac the Alt key is just a modifier key (like Shift) so we need
525 // to allow the char events to be processed when Alt is pressed.
526 // TODO: Should we check MetaDown instead in this case?
529 bool alt
= evt
.AltDown();
531 bool skip
= ((ctrl
|| alt
) && ! (ctrl
&& alt
));
533 int key
= evt
.GetKeyCode();
535 // printf("OnChar key:%%d consumed:%%d ctrl:%%d alt:%%d skip:%%d\n",
536 // key, m_lastKeyDownConsumed, ctrl, alt, skip);
538 if ( (key
<= WXK_START
|| key
> WXK_COMMAND
) &&
539 !m_lastKeyDownConsumed
&& !skip
) {
540 m_swx
->DoAddChar(key
);
547 void wxStyledTextCtrl::OnKeyDown(wxKeyEvent
& evt
) {
548 int key
= evt
.GetKeyCode();
549 bool shift
= evt
.ShiftDown(),
550 ctrl
= evt
.ControlDown(),
552 meta
= evt
.MetaDown();
554 int processed
= m_swx
->DoKeyDown(key
, shift
, ctrl
, alt
, meta
, &m_lastKeyDownConsumed
);
556 // printf("KeyDn key:%%d shift:%%d ctrl:%%d alt:%%d processed:%%d consumed:%%d\n",
557 // key, shift, ctrl, alt, processed, m_lastKeyDownConsumed);
559 if (!processed
&& !m_lastKeyDownConsumed
)
564 void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent
& evt
) {
565 m_swx
->DoLoseFocus();
570 void wxStyledTextCtrl::OnGainFocus(wxFocusEvent
& evt
) {
571 m_swx
->DoGainFocus();
576 void wxStyledTextCtrl::OnSysColourChanged(wxSysColourChangedEvent
& WXUNUSED(evt
)) {
577 m_swx
->DoSysColourChange();
581 void wxStyledTextCtrl::OnEraseBackground(wxEraseEvent
& WXUNUSED(evt
)) {
582 // do nothing to help avoid flashing
587 void wxStyledTextCtrl::OnMenu(wxCommandEvent
& evt
) {
588 m_swx
->DoCommand(evt
.GetId());
592 void wxStyledTextCtrl::OnListBox(wxCommandEvent
& WXUNUSED(evt
)) {
593 m_swx
->DoOnListBox();
597 void wxStyledTextCtrl::OnIdle(wxIdleEvent
& evt
) {
598 m_swx
->DoOnIdle(evt
);
602 wxSize
wxStyledTextCtrl::DoGetBestSize() const
604 // What would be the best size for a wxSTC?
605 // Just give a reasonable minimum until something else can be figured out.
606 return wxSize(200,100);
610 //----------------------------------------------------------------------
611 // Turn notifications from Scintilla into events
614 void wxStyledTextCtrl::NotifyChange() {
615 wxStyledTextEvent
evt(wxEVT_STC_CHANGE
, GetId());
616 evt
.SetEventObject(this);
617 GetEventHandler()->ProcessEvent(evt
);
621 static void SetEventText(wxStyledTextEvent
& evt
, const char* text
,
625 // The unicode conversion MUST have a null byte to terminate the
626 // string so move it into a buffer first and give it one.
627 wxMemoryBuffer
buf(length
+1);
628 buf
.AppendData((void*)text
, length
);
630 evt
.SetText(stc2wx(buf
));
634 void wxStyledTextCtrl::NotifyParent(SCNotification
* _scn
) {
635 SCNotification
& scn
= *_scn
;
636 wxStyledTextEvent
evt(0, GetId());
638 evt
.SetEventObject(this);
639 evt
.SetPosition(scn
.position
);
641 evt
.SetModifiers(scn
.modifiers
);
643 switch (scn
.nmhdr
.code
) {
644 case SCN_STYLENEEDED
:
645 evt
.SetEventType(wxEVT_STC_STYLENEEDED
);
649 evt
.SetEventType(wxEVT_STC_CHARADDED
);
652 case SCN_SAVEPOINTREACHED
:
653 evt
.SetEventType(wxEVT_STC_SAVEPOINTREACHED
);
656 case SCN_SAVEPOINTLEFT
:
657 evt
.SetEventType(wxEVT_STC_SAVEPOINTLEFT
);
660 case SCN_MODIFYATTEMPTRO
:
661 evt
.SetEventType(wxEVT_STC_ROMODIFYATTEMPT
);
665 evt
.SetEventType(wxEVT_STC_KEY
);
668 case SCN_DOUBLECLICK
:
669 evt
.SetEventType(wxEVT_STC_DOUBLECLICK
);
673 evt
.SetEventType(wxEVT_STC_UPDATEUI
);
677 evt
.SetEventType(wxEVT_STC_MODIFIED
);
678 evt
.SetModificationType(scn
.modificationType
);
679 SetEventText(evt
, scn
.text
, scn
.length
);
680 evt
.SetLength(scn
.length
);
681 evt
.SetLinesAdded(scn
.linesAdded
);
682 evt
.SetLine(scn
.line
);
683 evt
.SetFoldLevelNow(scn
.foldLevelNow
);
684 evt
.SetFoldLevelPrev(scn
.foldLevelPrev
);
687 case SCN_MACRORECORD
:
688 evt
.SetEventType(wxEVT_STC_MACRORECORD
);
689 evt
.SetMessage(scn
.message
);
690 evt
.SetWParam(scn
.wParam
);
691 evt
.SetLParam(scn
.lParam
);
694 case SCN_MARGINCLICK
:
695 evt
.SetEventType(wxEVT_STC_MARGINCLICK
);
696 evt
.SetMargin(scn
.margin
);
700 evt
.SetEventType(wxEVT_STC_NEEDSHOWN
);
701 evt
.SetLength(scn
.length
);
705 evt
.SetEventType(wxEVT_STC_PAINTED
);
708 case SCN_USERLISTSELECTION
:
709 evt
.SetEventType(wxEVT_STC_USERLISTSELECTION
);
710 evt
.SetListType(scn
.listType
);
711 SetEventText(evt
, scn
.text
, strlen(scn
.text
));
715 evt
.SetEventType(wxEVT_STC_URIDROPPED
);
716 SetEventText(evt
, scn
.text
, strlen(scn
.text
));
720 evt
.SetEventType(wxEVT_STC_DWELLSTART
);
726 evt
.SetEventType(wxEVT_STC_DWELLEND
);
732 evt
.SetEventType(wxEVT_STC_ZOOM
);
735 case SCN_HOTSPOTCLICK
:
736 evt
.SetEventType(wxEVT_STC_HOTSPOT_CLICK
);
739 case SCN_HOTSPOTDOUBLECLICK
:
740 evt
.SetEventType(wxEVT_STC_HOTSPOT_DCLICK
);
743 case SCN_CALLTIPCLICK
:
744 evt
.SetEventType(wxEVT_STC_CALLTIP_CLICK
);
751 GetEventHandler()->ProcessEvent(evt
);
755 //----------------------------------------------------------------------
756 //----------------------------------------------------------------------
757 //----------------------------------------------------------------------
759 wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType
, int id
)
760 : wxCommandEvent(commandType
, id
)
765 m_modificationType
= 0;
778 m_dragAllowMove
= false;
779 #if wxUSE_DRAG_AND_DROP
780 m_dragResult
= wxDragNone
;
784 bool wxStyledTextEvent::GetShift() const { return (m_modifiers
& SCI_SHIFT
) != 0; }
785 bool wxStyledTextEvent::GetControl() const { return (m_modifiers
& SCI_CTRL
) != 0; }
786 bool wxStyledTextEvent::GetAlt() const { return (m_modifiers
& SCI_ALT
) != 0; }
789 wxStyledTextEvent::wxStyledTextEvent(const wxStyledTextEvent
& event
):
790 wxCommandEvent(event
)
792 m_position
= event
.m_position
;
794 m_modifiers
= event
.m_modifiers
;
795 m_modificationType
= event
.m_modificationType
;
796 m_text
= event
.m_text
;
797 m_length
= event
.m_length
;
798 m_linesAdded
= event
.m_linesAdded
;
799 m_line
= event
.m_line
;
800 m_foldLevelNow
= event
.m_foldLevelNow
;
801 m_foldLevelPrev
= event
.m_foldLevelPrev
;
803 m_margin
= event
.m_margin
;
805 m_message
= event
.m_message
;
806 m_wParam
= event
.m_wParam
;
807 m_lParam
= event
.m_lParam
;
809 m_listType
= event
.m_listType
;
813 m_dragText
= event
.m_dragText
;
814 m_dragAllowMove
=event
.m_dragAllowMove
;
815 #if wxUSE_DRAG_AND_DROP
816 m_dragResult
= event
.m_dragResult
;
820 //----------------------------------------------------------------------
821 //----------------------------------------------------------------------