1 ////////////////////////////////////////////////////////////////////////////
3 // Purpose: A wxWindows 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"
23 #include <wx/tokenzr.h>
26 //----------------------------------------------------------------------
28 const wxChar
* wxSTCNameStr
= "stcwindow";
30 DEFINE_EVENT_TYPE( wxEVT_STC_CHANGE
)
31 DEFINE_EVENT_TYPE( wxEVT_STC_STYLENEEDED
)
32 DEFINE_EVENT_TYPE( wxEVT_STC_CHARADDED
)
33 DEFINE_EVENT_TYPE( wxEVT_STC_SAVEPOINTREACHED
)
34 DEFINE_EVENT_TYPE( wxEVT_STC_SAVEPOINTLEFT
)
35 DEFINE_EVENT_TYPE( wxEVT_STC_ROMODIFYATTEMPT
)
36 DEFINE_EVENT_TYPE( wxEVT_STC_KEY
)
37 DEFINE_EVENT_TYPE( wxEVT_STC_DOUBLECLICK
)
38 DEFINE_EVENT_TYPE( wxEVT_STC_UPDATEUI
)
39 DEFINE_EVENT_TYPE( wxEVT_STC_MODIFIED
)
40 DEFINE_EVENT_TYPE( wxEVT_STC_MACRORECORD
)
41 DEFINE_EVENT_TYPE( wxEVT_STC_MARGINCLICK
)
42 DEFINE_EVENT_TYPE( wxEVT_STC_NEEDSHOWN
)
43 DEFINE_EVENT_TYPE( wxEVT_STC_POSCHANGED
)
44 DEFINE_EVENT_TYPE( wxEVT_STC_PAINTED
)
45 DEFINE_EVENT_TYPE( wxEVT_STC_USERLISTSELECTION
)
46 DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED
)
47 DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART
)
48 DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND
)
49 DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG
)
50 DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER
)
51 DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP
)
54 BEGIN_EVENT_TABLE(wxStyledTextCtrl
, wxControl
)
55 EVT_PAINT (wxStyledTextCtrl::OnPaint
)
56 EVT_SCROLLWIN (wxStyledTextCtrl::OnScrollWin
)
57 EVT_SCROLL (wxStyledTextCtrl::OnScroll
)
58 EVT_SIZE (wxStyledTextCtrl::OnSize
)
59 EVT_LEFT_DOWN (wxStyledTextCtrl::OnMouseLeftDown
)
61 // Let Scintilla see the double click as a second click
62 EVT_LEFT_DCLICK (wxStyledTextCtrl::OnMouseLeftDown
)
64 EVT_MOTION (wxStyledTextCtrl::OnMouseMove
)
65 EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp
)
67 EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp
)
69 EVT_CONTEXT_MENU (wxStyledTextCtrl::OnContextMenu
)
71 EVT_MOUSEWHEEL (wxStyledTextCtrl::OnMouseWheel
)
72 EVT_CHAR (wxStyledTextCtrl::OnChar
)
73 EVT_KEY_DOWN (wxStyledTextCtrl::OnKeyDown
)
74 EVT_KILL_FOCUS (wxStyledTextCtrl::OnLoseFocus
)
75 EVT_SET_FOCUS (wxStyledTextCtrl::OnGainFocus
)
76 EVT_SYS_COLOUR_CHANGED (wxStyledTextCtrl::OnSysColourChanged
)
77 EVT_ERASE_BACKGROUND (wxStyledTextCtrl::OnEraseBackground
)
78 EVT_MENU_RANGE (-1, -1, wxStyledTextCtrl::OnMenu
)
79 EVT_LISTBOX_DCLICK (-1, wxStyledTextCtrl::OnListBox
)
83 IMPLEMENT_CLASS(wxStyledTextCtrl
, wxControl
)
84 IMPLEMENT_DYNAMIC_CLASS(wxStyledTextEvent
, wxCommandEvent
)
86 // forces the linking of the lexer modules
87 int Scintilla_LinkLexers();
89 //----------------------------------------------------------------------
90 // Constructor and Destructor
92 wxStyledTextCtrl::wxStyledTextCtrl(wxWindow
*parent
,
97 const wxString
& name
) :
98 wxControl(parent
, id
, pos
, size
,
99 style
| wxVSCROLL
| wxHSCROLL
| wxWANTS_CHARS
| wxCLIP_CHILDREN
,
100 wxDefaultValidator
, name
)
102 Scintilla_LinkLexers();
103 m_swx
= new ScintillaWX(this);
105 m_lastKeyDownConsumed
= FALSE
;
111 wxStyledTextCtrl::~wxStyledTextCtrl() {
116 //----------------------------------------------------------------------
118 long wxStyledTextCtrl::SendMsg(int msg
, long wp
, long lp
) {
120 return m_swx
->WndProc(msg
, wp
, lp
);
128 #define MAKELONG(a, b) ((a) | ((b) << 16))
131 static long wxColourAsLong(const wxColour
& co
) {
132 return (((long)co
.Blue() << 16) |
133 ((long)co
.Green() << 8) |
137 static wxColour
wxColourFromLong(long c
) {
139 clr
.Set(c
& 0xff, (c
>> 8) & 0xff, (c
>> 16) & 0xff);
144 static wxColour
wxColourFromSpec(const wxString
& spec
) {
145 // spec should be #RRGGBB
147 int red
= strtol(spec
.Mid(1,2), &junk
, 16);
148 int green
= strtol(spec
.Mid(3,2), &junk
, 16);
149 int blue
= strtol(spec
.Mid(5,2), &junk
, 16);
150 return wxColour(red
, green
, blue
);
154 //----------------------------------------------------------------------
155 // BEGIN generated section. The following code is automatically generated
156 // by gen_iface.py from the contents of Scintilla.iface. Do not edit
157 // this file. Edit stc.cpp.in or gen_iface.py instead and regenerate.
160 // Add text to the document
161 void wxStyledTextCtrl::AddText(const wxString
& text
) {
162 SendMsg(2001, text
.Len(), (long)text
.c_str());
165 // Add array of cells to document
166 void wxStyledTextCtrl::AddStyledText(const wxString
& text
) {
167 SendMsg(2002, text
.Len(), (long)text
.c_str());
170 // Insert string at a position
171 void wxStyledTextCtrl::InsertText(int pos
, const wxString
& text
) {
172 SendMsg(2003, pos
, (long)text
.c_str());
175 // Delete all text in the document
176 void wxStyledTextCtrl::ClearAll() {
180 // Set all style bytes to 0, remove all folding information
181 void wxStyledTextCtrl::ClearDocumentStyle() {
185 // The number of characters in the document
186 int wxStyledTextCtrl::GetLength() {
187 return SendMsg(2006, 0, 0);
190 // Returns the character byte at the position
191 int wxStyledTextCtrl::GetCharAt(int pos
) {
192 return SendMsg(2007, pos
, 0);
195 // Returns the position of the caret
196 int wxStyledTextCtrl::GetCurrentPos() {
197 return SendMsg(2008, 0, 0);
200 // Returns the position of the opposite end of the selection to the caret
201 int wxStyledTextCtrl::GetAnchor() {
202 return SendMsg(2009, 0, 0);
205 // Returns the style byte at the position
206 int wxStyledTextCtrl::GetStyleAt(int pos
) {
207 return SendMsg(2010, pos
, 0);
210 // Redoes the next action on the undo history
211 void wxStyledTextCtrl::Redo() {
215 // Choose between collecting actions into the undo
216 // history and discarding them.
217 void wxStyledTextCtrl::SetUndoCollection(bool collectUndo
) {
218 SendMsg(2012, collectUndo
, 0);
221 // Select all the text in the document.
222 void wxStyledTextCtrl::SelectAll() {
226 // Remember the current position in the undo history as the position
227 // at which the document was saved.
228 void wxStyledTextCtrl::SetSavePoint() {
232 // Retrieve a buffer of cells.
233 wxString
wxStyledTextCtrl::GetStyledText(int startPos
, int endPos
) {
235 if (endPos
< startPos
) {
240 int len
= endPos
- startPos
;
243 tr
.lpstrText
= text
.GetWriteBuf(len
*2);
244 tr
.chrg
.cpMin
= startPos
;
245 tr
.chrg
.cpMax
= endPos
;
246 SendMsg(2015, 0, (long)&tr
);
247 text
.UngetWriteBuf(len
*2);
251 // Are there any redoable actions in the undo history.
252 bool wxStyledTextCtrl::CanRedo() {
253 return SendMsg(2016, 0, 0) != 0;
256 // Retrieve the line number at which a particular marker is located
257 int wxStyledTextCtrl::MarkerLineFromHandle(int handle
) {
258 return SendMsg(2017, handle
, 0);
262 void wxStyledTextCtrl::MarkerDeleteHandle(int handle
) {
263 SendMsg(2018, handle
, 0);
266 // Is undo history being collected?
267 bool wxStyledTextCtrl::GetUndoCollection() {
268 return SendMsg(2019, 0, 0) != 0;
271 // Are white space characters currently visible?
272 // Returns one of SCWS_* constants.
273 int wxStyledTextCtrl::GetViewWhiteSpace() {
274 return SendMsg(2020, 0, 0);
277 // Make white space characters invisible, always visible or visible outside indentation.
278 void wxStyledTextCtrl::SetViewWhiteSpace(int viewWS
) {
279 SendMsg(2021, viewWS
, 0);
282 // Find the position from a point within the window.
283 int wxStyledTextCtrl::PositionFromPoint(wxPoint pt
) {
284 return SendMsg(2022, pt
.x
, pt
.y
);
287 // Find the position from a point within the window but return
288 // INVALID_POSITION if not close to text.
289 int wxStyledTextCtrl::PositionFromPointClose(int x
, int y
) {
290 return SendMsg(2023, x
, y
);
293 // Set caret to start of a line and ensure it is visible.
294 void wxStyledTextCtrl::GotoLine(int line
) {
295 SendMsg(2024, line
, 0);
298 // Set caret to a position and ensure it is visible.
299 void wxStyledTextCtrl::GotoPos(int pos
) {
300 SendMsg(2025, pos
, 0);
303 // Set the selection anchor to a position. The anchor is the opposite
304 // end of the selection from the caret.
305 void wxStyledTextCtrl::SetAnchor(int posAnchor
) {
306 SendMsg(2026, posAnchor
, 0);
309 // Retrieve the text of the line containing the caret.
310 // Returns the index of the caret on the line.
311 wxString
wxStyledTextCtrl::GetCurLine(int* linePos
) {
313 int len
= LineLength(GetCurrentLine());
315 if (linePos
) *linePos
= 0;
318 // Need an extra byte because SCI_GETCURLINE writes a null to the string
319 char* buf
= text
.GetWriteBuf(len
+1);
321 int pos
= SendMsg(2027, len
+1, (long)buf
);
322 text
.UngetWriteBuf(len
);
323 if (linePos
) *linePos
= pos
;
328 // Retrieve the position of the last correctly styled character.
329 int wxStyledTextCtrl::GetEndStyled() {
330 return SendMsg(2028, 0, 0);
333 // Convert all line endings in the document to one mode.
334 void wxStyledTextCtrl::ConvertEOLs(int eolMode
) {
335 SendMsg(2029, eolMode
, 0);
338 // Retrieve the current end of line mode - one of CRLF, CR, or LF.
339 int wxStyledTextCtrl::GetEOLMode() {
340 return SendMsg(2030, 0, 0);
343 // Set the current end of line mode.
344 void wxStyledTextCtrl::SetEOLMode(int eolMode
) {
345 SendMsg(2031, eolMode
, 0);
348 // Set the current styling position to pos and the styling mask to mask.
349 // The styling mask can be used to protect some bits in each styling byte from
351 void wxStyledTextCtrl::StartStyling(int pos
, int mask
) {
352 SendMsg(2032, pos
, mask
);
355 // Change style from current styling position for length characters to a style
356 // and move the current styling position to after this newly styled segment.
357 void wxStyledTextCtrl::SetStyling(int length
, int style
) {
358 SendMsg(2033, length
, style
);
361 // Is drawing done first into a buffer or direct to the screen.
362 bool wxStyledTextCtrl::GetBufferedDraw() {
363 return SendMsg(2034, 0, 0) != 0;
366 // If drawing is buffered then each line of text is drawn into a bitmap buffer
367 // before drawing it to the screen to avoid flicker.
368 void wxStyledTextCtrl::SetBufferedDraw(bool buffered
) {
369 SendMsg(2035, buffered
, 0);
372 // Change the visible size of a tab to be a multiple of the width of a space
374 void wxStyledTextCtrl::SetTabWidth(int tabWidth
) {
375 SendMsg(2036, tabWidth
, 0);
378 // Retrieve the visible size of a tab.
379 int wxStyledTextCtrl::GetTabWidth() {
380 return SendMsg(2121, 0, 0);
383 // Set the code page used to interpret the bytes of the document as characters.
384 // The SC_CP_UTF8 value can be used to enter Unicode mode.
385 void wxStyledTextCtrl::SetCodePage(int codePage
) {
386 SendMsg(2037, codePage
, 0);
389 // Set the symbol used for a particular marker number,
390 // and optionally the fore and background colours.
391 void wxStyledTextCtrl::MarkerDefine(int markerNumber
, int markerSymbol
,
392 const wxColour
& foreground
,
393 const wxColour
& background
) {
395 SendMsg(2040, markerNumber
, markerSymbol
);
397 MarkerSetForeground(markerNumber
, foreground
);
399 MarkerSetBackground(markerNumber
, background
);
402 // Set the foreground colour used for a particular marker number.
403 void wxStyledTextCtrl::MarkerSetForeground(int markerNumber
, const wxColour
& fore
) {
404 SendMsg(2041, markerNumber
, wxColourAsLong(fore
));
407 // Set the background colour used for a particular marker number.
408 void wxStyledTextCtrl::MarkerSetBackground(int markerNumber
, const wxColour
& back
) {
409 SendMsg(2042, markerNumber
, wxColourAsLong(back
));
412 // Add a marker to a line, returning an ID which can be used to find or delete the marker.
413 int wxStyledTextCtrl::MarkerAdd(int line
, int markerNumber
) {
414 return SendMsg(2043, line
, markerNumber
);
417 // Delete a marker from a line
418 void wxStyledTextCtrl::MarkerDelete(int line
, int markerNumber
) {
419 SendMsg(2044, line
, markerNumber
);
422 // Delete all markers with a particular number from all lines
423 void wxStyledTextCtrl::MarkerDeleteAll(int markerNumber
) {
424 SendMsg(2045, markerNumber
, 0);
427 // Get a bit mask of all the markers set on a line.
428 int wxStyledTextCtrl::MarkerGet(int line
) {
429 return SendMsg(2046, line
, 0);
432 // Find the next line after lineStart that includes a marker in mask.
433 int wxStyledTextCtrl::MarkerNext(int lineStart
, int markerMask
) {
434 return SendMsg(2047, lineStart
, markerMask
);
437 // Find the previous line before lineStart that includes a marker in mask.
438 int wxStyledTextCtrl::MarkerPrevious(int lineStart
, int markerMask
) {
439 return SendMsg(2048, lineStart
, markerMask
);
442 // Set a margin to be either numeric or symbolic.
443 void wxStyledTextCtrl::SetMarginType(int margin
, int marginType
) {
444 SendMsg(2240, margin
, marginType
);
447 // Retrieve the type of a margin.
448 int wxStyledTextCtrl::GetMarginType(int margin
) {
449 return SendMsg(2241, margin
, 0);
452 // Set the width of a margin to a width expressed in pixels.
453 void wxStyledTextCtrl::SetMarginWidth(int margin
, int pixelWidth
) {
454 SendMsg(2242, margin
, pixelWidth
);
457 // Retrieve the width of a margin in pixels.
458 int wxStyledTextCtrl::GetMarginWidth(int margin
) {
459 return SendMsg(2243, margin
, 0);
462 // Set a mask that determines which markers are displayed in a margin.
463 void wxStyledTextCtrl::SetMarginMask(int margin
, int mask
) {
464 SendMsg(2244, margin
, mask
);
467 // Retrieve the marker mask of a margin.
468 int wxStyledTextCtrl::GetMarginMask(int margin
) {
469 return SendMsg(2245, margin
, 0);
472 // Make a margin sensitive or insensitive to mouse clicks.
473 void wxStyledTextCtrl::SetMarginSensitive(int margin
, bool sensitive
) {
474 SendMsg(2246, margin
, sensitive
);
477 // Retrieve the mouse click sensitivity of a margin.
478 bool wxStyledTextCtrl::GetMarginSensitive(int margin
) {
479 return SendMsg(2247, margin
, 0) != 0;
482 // Clear all the styles and make equivalent to the global default style.
483 void wxStyledTextCtrl::StyleClearAll() {
487 // Set the foreground colour of a style.
488 void wxStyledTextCtrl::StyleSetForeground(int style
, const wxColour
& fore
) {
489 SendMsg(2051, style
, wxColourAsLong(fore
));
492 // Set the background colour of a style.
493 void wxStyledTextCtrl::StyleSetBackground(int style
, const wxColour
& back
) {
494 SendMsg(2052, style
, wxColourAsLong(back
));
497 // Set a style to be bold or not.
498 void wxStyledTextCtrl::StyleSetBold(int style
, bool bold
) {
499 SendMsg(2053, style
, bold
);
502 // Set a style to be italic or not.
503 void wxStyledTextCtrl::StyleSetItalic(int style
, bool italic
) {
504 SendMsg(2054, style
, italic
);
507 // Set the size of characters of a style.
508 void wxStyledTextCtrl::StyleSetSize(int style
, int sizePoints
) {
509 SendMsg(2055, style
, sizePoints
);
512 // Set the font of a style.
513 void wxStyledTextCtrl::StyleSetFaceName(int style
, const wxString
& fontName
) {
514 SendMsg(2056, style
, (long)fontName
.c_str());
517 // Set a style to have its end of line filled or not.
518 void wxStyledTextCtrl::StyleSetEOLFilled(int style
, bool filled
) {
519 SendMsg(2057, style
, filled
);
522 // Reset the default style to its state at startup
523 void wxStyledTextCtrl::StyleResetDefault() {
527 // Set a style to be underlined or not.
528 void wxStyledTextCtrl::StyleSetUnderline(int style
, bool underline
) {
529 SendMsg(2059, style
, underline
);
532 // Set a style to be mixed case, or to force upper or lower case.
533 void wxStyledTextCtrl::StyleSetCase(int style
, int caseForce
) {
534 SendMsg(2060, style
, caseForce
);
537 // Set the foreground colour of the selection and whether to use this setting.
538 void wxStyledTextCtrl::SetSelForeground(bool useSetting
, const wxColour
& fore
) {
539 SendMsg(2067, useSetting
, wxColourAsLong(fore
));
542 // Set the background colour of the selection and whether to use this setting.
543 void wxStyledTextCtrl::SetSelBackground(bool useSetting
, const wxColour
& back
) {
544 SendMsg(2068, useSetting
, wxColourAsLong(back
));
547 // Set the foreground colour of the caret.
548 void wxStyledTextCtrl::SetCaretForeground(const wxColour
& fore
) {
549 SendMsg(2069, wxColourAsLong(fore
), 0);
552 // When key+modifier combination km is pressed perform msg.
553 void wxStyledTextCtrl::CmdKeyAssign(int key
, int modifiers
, int cmd
) {
554 SendMsg(2070, MAKELONG(key
, modifiers
), cmd
);
557 // When key+modifier combination km do nothing.
558 void wxStyledTextCtrl::CmdKeyClear(int key
, int modifiers
) {
559 SendMsg(2071, MAKELONG(key
, modifiers
));
562 // Drop all key mappings.
563 void wxStyledTextCtrl::CmdKeyClearAll() {
567 // Set the styles for a segment of the document.
568 void wxStyledTextCtrl::SetStyleBytes(int length
, char* styleBytes
) {
569 SendMsg(2073, length
, (long)styleBytes
);
572 // Set a style to be visible or not.
573 void wxStyledTextCtrl::StyleSetVisible(int style
, bool visible
) {
574 SendMsg(2074, style
, visible
);
577 // Get the time in milliseconds that the caret is on and off.
578 int wxStyledTextCtrl::GetCaretPeriod() {
579 return SendMsg(2075, 0, 0);
582 // Get the time in milliseconds that the caret is on and off. 0 = steady on.
583 void wxStyledTextCtrl::SetCaretPeriod(int periodMilliseconds
) {
584 SendMsg(2076, periodMilliseconds
, 0);
587 // Set the set of characters making up words for when moving or selecting
589 void wxStyledTextCtrl::SetWordChars(const wxString
& characters
) {
590 SendMsg(2077, 0, (long)characters
.c_str());
593 // Start a sequence of actions that is undone and redone as a unit.
595 void wxStyledTextCtrl::BeginUndoAction() {
599 // End a sequence of actions that is undone and redone as a unit.
600 void wxStyledTextCtrl::EndUndoAction() {
604 // Set an indicator to plain, squiggle or TT.
605 void wxStyledTextCtrl::IndicatorSetStyle(int indic
, int style
) {
606 SendMsg(2080, indic
, style
);
609 // Retrieve the style of an indicator.
610 int wxStyledTextCtrl::IndicatorGetStyle(int indic
) {
611 return SendMsg(2081, indic
, 0);
614 // Set the foreground colour of an indicator.
615 void wxStyledTextCtrl::IndicatorSetForeground(int indic
, const wxColour
& fore
) {
616 SendMsg(2082, indic
, wxColourAsLong(fore
));
619 // Retrieve the foreground colour of an indicator.
620 wxColour
wxStyledTextCtrl::IndicatorGetForeground(int indic
) {
621 long c
= SendMsg(2083, indic
, 0);
622 return wxColourFromLong(c
);
625 // Divide each styling byte into lexical class bits (default:5) and indicator
626 // bits (default:3). If a lexer requires more than 32 lexical states, then this
627 // is used to expand the possible states.
628 void wxStyledTextCtrl::SetStyleBits(int bits
) {
629 SendMsg(2090, bits
, 0);
632 // Retrieve number of bits in style bytes used to hold the lexical state.
633 int wxStyledTextCtrl::GetStyleBits() {
634 return SendMsg(2091, 0, 0);
637 // Used to hold extra styling information for each line.
638 void wxStyledTextCtrl::SetLineState(int line
, int state
) {
639 SendMsg(2092, line
, state
);
642 // Retrieve the extra styling information for a line.
643 int wxStyledTextCtrl::GetLineState(int line
) {
644 return SendMsg(2093, line
, 0);
647 // Retrieve the last line number that has line state.
648 int wxStyledTextCtrl::GetMaxLineState() {
649 return SendMsg(2094, 0, 0);
652 // Is the background of the line containing the caret in a different colour?
653 bool wxStyledTextCtrl::GetCaretLineVisible() {
654 return SendMsg(2095, 0, 0) != 0;
657 // Dsplay the background of the line containing the caret in a different colour.
658 void wxStyledTextCtrl::SetCaretLineVisible(bool show
) {
659 SendMsg(2096, show
, 0);
662 // Get the colour of the background of the line containing the caret.
663 wxColour
wxStyledTextCtrl::GetCaretLineBack() {
664 long c
= SendMsg(2097, 0, 0);
665 return wxColourFromLong(c
);
668 // Set the colour of the background of the line containing the caret.
669 void wxStyledTextCtrl::SetCaretLineBack(const wxColour
& back
) {
670 SendMsg(2098, wxColourAsLong(back
), 0);
673 // Set a style to be changeable or not (read only).
674 // Experimental feature, currently buggy.
675 void wxStyledTextCtrl::StyleSetChangeable(int style
, bool changeable
) {
676 SendMsg(2099, style
, changeable
);
679 // Display a auto-completion list.
680 // The lenEntered parameter indicates how many characters before
681 // the caret should be used to provide context.
682 void wxStyledTextCtrl::AutoCompShow(int lenEntered
, const wxString
& itemList
) {
683 SendMsg(2100, lenEntered
, (long)itemList
.c_str());
686 // Remove the auto-completion list from the screen.
687 void wxStyledTextCtrl::AutoCompCancel() {
691 // Is there an auto-completion list visible?
692 bool wxStyledTextCtrl::AutoCompActive() {
693 return SendMsg(2102, 0, 0) != 0;
696 // Retrieve the position of the caret when the auto-completion list was
698 int wxStyledTextCtrl::AutoCompPosStart() {
699 return SendMsg(2103, 0, 0);
702 // User has selected an item so remove the list and insert the selection.
703 void wxStyledTextCtrl::AutoCompComplete() {
707 // Define a set of character that when typed cancel the auto-completion list.
708 void wxStyledTextCtrl::AutoCompStops(const wxString
& characterSet
) {
709 SendMsg(2105, 0, (long)characterSet
.c_str());
712 // Change the separator character in the string setting up an auto-completion
713 // list. Default is space but can be changed if items contain space.
714 void wxStyledTextCtrl::AutoCompSetSeparator(int separatorCharacter
) {
715 SendMsg(2106, separatorCharacter
, 0);
718 // Retrieve the auto-completion list separator character.
719 int wxStyledTextCtrl::AutoCompGetSeparator() {
720 return SendMsg(2107, 0, 0);
723 // Select the item in the auto-completion list that starts with a string.
724 void wxStyledTextCtrl::AutoCompSelect(const wxString
& text
) {
725 SendMsg(2108, 0, (long)text
.c_str());
728 // Should the auto-completion list be cancelled if the user backspaces to a
729 // position before where the box was created.
730 void wxStyledTextCtrl::AutoCompSetCancelAtStart(bool cancel
) {
731 SendMsg(2110, cancel
, 0);
734 // Retrieve whether auto-completion cancelled by backspacing before start.
735 bool wxStyledTextCtrl::AutoCompGetCancelAtStart() {
736 return SendMsg(2111, 0, 0) != 0;
739 // Define a set of characters that when typed will cause the autocompletion to
740 // choose the selected item.
741 void wxStyledTextCtrl::AutoCompSetFillUps(const wxString
& characterSet
) {
742 SendMsg(2112, 0, (long)characterSet
.c_str());
745 // Should a single item auto-completion list automatically choose the item.
746 void wxStyledTextCtrl::AutoCompSetChooseSingle(bool chooseSingle
) {
747 SendMsg(2113, chooseSingle
, 0);
750 // Retrieve whether a single item auto-completion list automatically choose the item.
751 bool wxStyledTextCtrl::AutoCompGetChooseSingle() {
752 return SendMsg(2114, 0, 0) != 0;
755 // Set whether case is significant when performing auto-completion searches.
756 void wxStyledTextCtrl::AutoCompSetIgnoreCase(bool ignoreCase
) {
757 SendMsg(2115, ignoreCase
, 0);
760 // Retrieve state of ignore case flag.
761 bool wxStyledTextCtrl::AutoCompGetIgnoreCase() {
762 return SendMsg(2116, 0, 0) != 0;
765 // Display a list of strings and send notification when user chooses one.
766 void wxStyledTextCtrl::UserListShow(int listType
, const wxString
& itemList
) {
767 SendMsg(2117, listType
, (long)itemList
.c_str());
770 // Set whether or not autocompletion is hidden automatically when nothing matches
771 void wxStyledTextCtrl::AutoCompSetAutoHide(bool autoHide
) {
772 SendMsg(2118, autoHide
, 0);
775 // Retrieve whether or not autocompletion is hidden automatically when nothing matches
776 bool wxStyledTextCtrl::AutoCompGetAutoHide() {
777 return SendMsg(2119, 0, 0) != 0;
780 // Set whether or not autocompletion deletes any word characters after the inserted text upon completion
781 void wxStyledTextCtrl::AutoCompSetDropRestOfWord(bool dropRestOfWord
) {
782 SendMsg(2270, dropRestOfWord
, 0);
785 // Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion
786 bool wxStyledTextCtrl::AutoCompGetDropRestOfWord() {
787 return SendMsg(2271, 0, 0) != 0;
790 // Set the number of spaces used for one level of indentation.
791 void wxStyledTextCtrl::SetIndent(int indentSize
) {
792 SendMsg(2122, indentSize
, 0);
795 // Retrieve indentation size.
796 int wxStyledTextCtrl::GetIndent() {
797 return SendMsg(2123, 0, 0);
800 // Indentation will only use space characters if useTabs is false, otherwise
801 // it will use a combination of tabs and spaces.
802 void wxStyledTextCtrl::SetUseTabs(bool useTabs
) {
803 SendMsg(2124, useTabs
, 0);
806 // Retrieve whether tabs will be used in indentation.
807 bool wxStyledTextCtrl::GetUseTabs() {
808 return SendMsg(2125, 0, 0) != 0;
811 // Change the indentation of a line to a number of columns.
812 void wxStyledTextCtrl::SetLineIndentation(int line
, int indentSize
) {
813 SendMsg(2126, line
, indentSize
);
816 // Retrieve the number of columns that a line is indented.
817 int wxStyledTextCtrl::GetLineIndentation(int line
) {
818 return SendMsg(2127, line
, 0);
821 // Retrieve the position before the first non indentation character on a line.
822 int wxStyledTextCtrl::GetLineIndentPosition(int line
) {
823 return SendMsg(2128, line
, 0);
826 // Retrieve the column number of a position, taking tab width into account.
827 int wxStyledTextCtrl::GetColumn(int pos
) {
828 return SendMsg(2129, pos
, 0);
831 // Show or hide the horizontal scroll bar.
832 void wxStyledTextCtrl::SetUseHorizontalScrollBar(bool show
) {
833 SendMsg(2130, show
, 0);
836 // Is the horizontal scroll bar visible?
837 bool wxStyledTextCtrl::GetUseHorizontalScrollBar() {
838 return SendMsg(2131, 0, 0) != 0;
841 // Show or hide indentation guides.
842 void wxStyledTextCtrl::SetIndentationGuides(bool show
) {
843 SendMsg(2132, show
, 0);
846 // Are the indentation guides visible?
847 bool wxStyledTextCtrl::GetIndentationGuides() {
848 return SendMsg(2133, 0, 0) != 0;
851 // Set the highlighted indentation guide column.
852 // 0 = no highlighted guide.
853 void wxStyledTextCtrl::SetHighlightGuide(int column
) {
854 SendMsg(2134, column
, 0);
857 // Get the highlighted indentation guide column.
858 int wxStyledTextCtrl::GetHighlightGuide() {
859 return SendMsg(2135, 0, 0);
862 // Get the position after the last visible characters on a line.
863 int wxStyledTextCtrl::GetLineEndPosition(int line
) {
864 return SendMsg(2136, line
, 0);
867 // Get the code page used to interpret the bytes of the document as characters.
868 int wxStyledTextCtrl::GetCodePage() {
869 return SendMsg(2137, 0, 0);
872 // Get the foreground colour of the caret.
873 wxColour
wxStyledTextCtrl::GetCaretForeground() {
874 long c
= SendMsg(2138, 0, 0);
875 return wxColourFromLong(c
);
878 // In read-only mode?
879 bool wxStyledTextCtrl::GetReadOnly() {
880 return SendMsg(2140, 0, 0) != 0;
883 // Sets the position of the caret.
884 void wxStyledTextCtrl::SetCurrentPos(int pos
) {
885 SendMsg(2141, pos
, 0);
888 // Sets the position that starts the selection - this becomes the anchor.
889 void wxStyledTextCtrl::SetSelectionStart(int pos
) {
890 SendMsg(2142, pos
, 0);
893 // Returns the position at the start of the selection.
894 int wxStyledTextCtrl::GetSelectionStart() {
895 return SendMsg(2143, 0, 0);
898 // Sets the position that ends the selection - this becomes the currentPosition.
899 void wxStyledTextCtrl::SetSelectionEnd(int pos
) {
900 SendMsg(2144, pos
, 0);
903 // Returns the position at the end of the selection.
904 int wxStyledTextCtrl::GetSelectionEnd() {
905 return SendMsg(2145, 0, 0);
908 // Sets the print magnification added to the point size of each style for printing.
909 void wxStyledTextCtrl::SetPrintMagnification(int magnification
) {
910 SendMsg(2146, magnification
, 0);
913 // Returns the print magnification.
914 int wxStyledTextCtrl::GetPrintMagnification() {
915 return SendMsg(2147, 0, 0);
918 // Modify colours when printing for clearer printed text.
919 void wxStyledTextCtrl::SetPrintColourMode(int mode
) {
920 SendMsg(2148, mode
, 0);
923 // Returns the print colour mode.
924 int wxStyledTextCtrl::GetPrintColourMode() {
925 return SendMsg(2149, 0, 0);
928 // Find some text in the document.
929 int wxStyledTextCtrl::FindText(int minPos
, int maxPos
,
930 const wxString
& text
,
931 bool caseSensitive
, bool wholeWord
) {
935 flags
|= caseSensitive
? SCFIND_MATCHCASE
: 0;
936 flags
|= wholeWord
? SCFIND_WHOLEWORD
: 0;
937 ft
.chrg
.cpMin
= minPos
;
938 ft
.chrg
.cpMax
= maxPos
;
939 ft
.lpstrText
= (char*)text
.c_str();
941 return SendMsg(2150, flags
, (long)&ft
);
944 // On Windows will draw the document into a display context such as a printer.
945 int wxStyledTextCtrl::FormatRange(bool doDraw
,
949 wxDC
* target
, // Why does it use two? Can they be the same?
954 if (endPos
< startPos
) {
960 fr
.hdcTarget
= target
;
961 fr
.rc
.top
= renderRect
.GetTop();
962 fr
.rc
.left
= renderRect
.GetLeft();
963 fr
.rc
.right
= renderRect
.GetRight();
964 fr
.rc
.bottom
= renderRect
.GetBottom();
965 fr
.rcPage
.top
= pageRect
.GetTop();
966 fr
.rcPage
.left
= pageRect
.GetLeft();
967 fr
.rcPage
.right
= pageRect
.GetRight();
968 fr
.rcPage
.bottom
= pageRect
.GetBottom();
969 fr
.chrg
.cpMin
= startPos
;
970 fr
.chrg
.cpMax
= endPos
;
972 return SendMsg(2151, doDraw
, (long)&fr
);
975 // Retrieve the line at the top of the display.
976 int wxStyledTextCtrl::GetFirstVisibleLine() {
977 return SendMsg(2152, 0, 0);
980 // Retrieve the contents of a line.
981 wxString
wxStyledTextCtrl::GetLine(int line
) {
983 int len
= LineLength(line
);
985 char* buf
= text
.GetWriteBuf(len
);
987 int pos
= SendMsg(2153, line
, (long)buf
);
988 text
.UngetWriteBuf(len
);
993 // Returns the number of lines in the document. There is always at least one.
994 int wxStyledTextCtrl::GetLineCount() {
995 return SendMsg(2154, 0, 0);
998 // Sets the size in pixels of the left margin.
999 void wxStyledTextCtrl::SetMarginLeft(int pixelWidth
) {
1000 SendMsg(2155, 0, pixelWidth
);
1003 // Returns the size in pixels of the left margin.
1004 int wxStyledTextCtrl::GetMarginLeft() {
1005 return SendMsg(2156, 0, 0);
1008 // Sets the size in pixels of the right margin.
1009 void wxStyledTextCtrl::SetMarginRight(int pixelWidth
) {
1010 SendMsg(2157, 0, pixelWidth
);
1013 // Returns the size in pixels of the right margin.
1014 int wxStyledTextCtrl::GetMarginRight() {
1015 return SendMsg(2158, 0, 0);
1018 // Is the document different from when it was last saved?
1019 bool wxStyledTextCtrl::GetModify() {
1020 return SendMsg(2159, 0, 0) != 0;
1023 // Select a range of text.
1024 void wxStyledTextCtrl::SetSelection(int start
, int end
) {
1025 SendMsg(2160, start
, end
);
1028 // Retrieve the selected text.
1029 wxString
wxStyledTextCtrl::GetSelectedText() {
1034 GetSelection(&start
, &end
);
1035 int len
= end
- start
;
1036 if (!len
) return "";
1037 char* buff
= text
.GetWriteBuf(len
);
1039 SendMsg(2161, 0, (long)buff
);
1040 text
.UngetWriteBuf(len
);
1044 // Retrieve a range of text.
1045 wxString
wxStyledTextCtrl::GetTextRange(int startPos
, int endPos
) {
1047 if (endPos
< startPos
) {
1048 int temp
= startPos
;
1052 int len
= endPos
- startPos
;
1053 if (!len
) return "";
1054 char* buff
= text
.GetWriteBuf(len
);
1056 tr
.lpstrText
= buff
;
1057 tr
.chrg
.cpMin
= startPos
;
1058 tr
.chrg
.cpMax
= endPos
;
1060 SendMsg(2162, 0, (long)&tr
);
1061 text
.UngetWriteBuf(len
);
1065 // Draw the selection in normal style or with selection highlighted.
1066 void wxStyledTextCtrl::HideSelection(bool normal
) {
1067 SendMsg(2163, normal
, 0);
1070 // Retrieve the line containing a position.
1071 int wxStyledTextCtrl::LineFromPosition(int pos
) {
1072 return SendMsg(2166, pos
, 0);
1075 // Retrieve the position at the start of a line.
1076 int wxStyledTextCtrl::PositionFromLine(int line
) {
1077 return SendMsg(2167, line
, 0);
1080 // Scroll horizontally and vertically.
1081 void wxStyledTextCtrl::LineScroll(int columns
, int lines
) {
1082 SendMsg(2168, columns
, lines
);
1085 // Ensure the caret is visible.
1086 void wxStyledTextCtrl::EnsureCaretVisible() {
1087 SendMsg(2169, 0, 0);
1090 // Replace the selected text with the argument text.
1091 void wxStyledTextCtrl::ReplaceSelection(const wxString
& text
) {
1092 SendMsg(2170, 0, (long)text
.c_str());
1095 // Set to read only or read write.
1096 void wxStyledTextCtrl::SetReadOnly(bool readOnly
) {
1097 SendMsg(2171, readOnly
, 0);
1100 // Will a paste succeed?
1101 bool wxStyledTextCtrl::CanPaste() {
1102 return SendMsg(2173, 0, 0) != 0;
1105 // Are there any undoable actions in the undo history.
1106 bool wxStyledTextCtrl::CanUndo() {
1107 return SendMsg(2174, 0, 0) != 0;
1110 // Delete the undo history.
1111 void wxStyledTextCtrl::EmptyUndoBuffer() {
1112 SendMsg(2175, 0, 0);
1115 // Undo one action in the undo history.
1116 void wxStyledTextCtrl::Undo() {
1117 SendMsg(2176, 0, 0);
1120 // Cut the selection to the clipboard.
1121 void wxStyledTextCtrl::Cut() {
1122 SendMsg(2177, 0, 0);
1125 // Copy the selection to the clipboard.
1126 void wxStyledTextCtrl::Copy() {
1127 SendMsg(2178, 0, 0);
1130 // Paste the contents of the clipboard into the document replacing the selection.
1131 void wxStyledTextCtrl::Paste() {
1132 SendMsg(2179, 0, 0);
1135 // Clear the selection.
1136 void wxStyledTextCtrl::Clear() {
1137 SendMsg(2180, 0, 0);
1140 // Replace the contents of the document with the argument text.
1141 void wxStyledTextCtrl::SetText(const wxString
& text
) {
1142 SendMsg(2181, 0, (long)text
.c_str());
1145 // Retrieve all the text in the document.
1146 wxString
wxStyledTextCtrl::GetText() {
1148 int len
= GetTextLength();
1149 char* buff
= text
.GetWriteBuf(len
+1); // leave room for the null...
1151 SendMsg(2182, len
+1, (long)buff
);
1152 text
.UngetWriteBuf(len
);
1156 // Retrieve the number of characters in the document.
1157 int wxStyledTextCtrl::GetTextLength() {
1158 return SendMsg(2183, 0, 0);
1161 // Set to overtype (true) or insert mode
1162 void wxStyledTextCtrl::SetOvertype(bool overtype
) {
1163 SendMsg(2186, overtype
, 0);
1166 // Returns true if overtype mode is active otherwise false is returned.
1167 bool wxStyledTextCtrl::GetOvertype() {
1168 return SendMsg(2187, 0, 0) != 0;
1171 // Set the width of the insert mode caret
1172 void wxStyledTextCtrl::SetCaretWidth(int pixelWidth
) {
1173 SendMsg(2188, pixelWidth
, 0);
1176 // Returns the width of the insert mode caret
1177 int wxStyledTextCtrl::GetCaretWidth() {
1178 return SendMsg(2189, 0, 0);
1181 // Sets the position that starts the target which is used for updating the
1182 // document without affecting the scroll position.
1183 void wxStyledTextCtrl::SetTargetStart(int pos
) {
1184 SendMsg(2190, pos
, 0);
1187 // Get the position that starts the target.
1188 int wxStyledTextCtrl::GetTargetStart() {
1189 return SendMsg(2191, 0, 0);
1192 // Sets the position that ends the target which is used for updating the
1193 // document without affecting the scroll position.
1194 void wxStyledTextCtrl::SetTargetEnd(int pos
) {
1195 SendMsg(2192, pos
, 0);
1198 // Get the position that ends the target.
1199 int wxStyledTextCtrl::GetTargetEnd() {
1200 return SendMsg(2193, 0, 0);
1203 // Replace the target text with the argument text.
1204 // Text is counted so it can contain nulls.
1205 // Returns the length of the replacement text.
1207 int wxStyledTextCtrl::ReplaceTarget(const wxString
& text
) {
1208 return SendMsg(2194, text
.Len(), (long)text
.c_str());
1212 // Replace the target text with the argument text after \d processing.
1213 // Text is counted so it can contain nulls.
1214 // Looks for \d where d is between 1 and 9 and replaces these with the strings
1215 // matched in the last search operation which were surrounded by \( and \).
1216 // Returns the length of the replacement text including any change
1217 // caused by processing the \d patterns.
1219 int wxStyledTextCtrl::ReplaceTargetRE(const wxString
& text
) {
1220 return SendMsg(2195, text
.Len(), (long)text
.c_str());
1224 // Search for a counted string in the target and set the target to the found
1225 // range. Text is counted so it can contain nulls.
1226 // Returns length of range or -1 for failure in which case target is not moved.
1228 int wxStyledTextCtrl::SearchInTarget(const wxString
& text
) {
1229 return SendMsg(2197, text
.Len(), (long)text
.c_str());
1233 // Set the search flags used by SearchInTarget
1234 void wxStyledTextCtrl::SetSearchFlags(int flags
) {
1235 SendMsg(2198, flags
, 0);
1238 // Get the search flags used by SearchInTarget
1239 int wxStyledTextCtrl::GetSearchFlags() {
1240 return SendMsg(2199, 0, 0);
1243 // Show a call tip containing a definition near position pos.
1244 void wxStyledTextCtrl::CallTipShow(int pos
, const wxString
& definition
) {
1245 SendMsg(2200, pos
, (long)definition
.c_str());
1248 // Remove the call tip from the screen.
1249 void wxStyledTextCtrl::CallTipCancel() {
1250 SendMsg(2201, 0, 0);
1253 // Is there an active call tip?
1254 bool wxStyledTextCtrl::CallTipActive() {
1255 return SendMsg(2202, 0, 0) != 0;
1258 // Retrieve the position where the caret was before displaying the call tip.
1259 int wxStyledTextCtrl::CallTipPosAtStart() {
1260 return SendMsg(2203, 0, 0);
1263 // Highlight a segment of the definition.
1264 void wxStyledTextCtrl::CallTipSetHighlight(int start
, int end
) {
1265 SendMsg(2204, start
, end
);
1268 // Set the background colour for the call tip.
1269 void wxStyledTextCtrl::CallTipSetBackground(const wxColour
& back
) {
1270 SendMsg(2205, wxColourAsLong(back
), 0);
1273 // Find the display line of a document line taking hidden lines into account.
1274 int wxStyledTextCtrl::VisibleFromDocLine(int line
) {
1275 return SendMsg(2220, line
, 0);
1278 // Find the document line of a display line taking hidden lines into account.
1279 int wxStyledTextCtrl::DocLineFromVisible(int lineDisplay
) {
1280 return SendMsg(2221, lineDisplay
, 0);
1283 // Set the fold level of a line.
1284 // This encodes an integer level along with flags indicating whether the
1285 // line is a header and whether it is effectively white space.
1286 void wxStyledTextCtrl::SetFoldLevel(int line
, int level
) {
1287 SendMsg(2222, line
, level
);
1290 // Retrieve the fold level of a line.
1291 int wxStyledTextCtrl::GetFoldLevel(int line
) {
1292 return SendMsg(2223, line
, 0);
1295 // Find the last child line of a header line.
1296 int wxStyledTextCtrl::GetLastChild(int line
, int level
) {
1297 return SendMsg(2224, line
, level
);
1300 // Find the parent line of a child line.
1301 int wxStyledTextCtrl::GetFoldParent(int line
) {
1302 return SendMsg(2225, line
, 0);
1305 // Make a range of lines visible.
1306 void wxStyledTextCtrl::ShowLines(int lineStart
, int lineEnd
) {
1307 SendMsg(2226, lineStart
, lineEnd
);
1310 // Make a range of lines invisible.
1311 void wxStyledTextCtrl::HideLines(int lineStart
, int lineEnd
) {
1312 SendMsg(2227, lineStart
, lineEnd
);
1315 // Is a line visible?
1316 bool wxStyledTextCtrl::GetLineVisible(int line
) {
1317 return SendMsg(2228, line
, 0) != 0;
1320 // Show the children of a header line.
1321 void wxStyledTextCtrl::SetFoldExpanded(int line
, bool expanded
) {
1322 SendMsg(2229, line
, expanded
);
1325 // Is a header line expanded?
1326 bool wxStyledTextCtrl::GetFoldExpanded(int line
) {
1327 return SendMsg(2230, line
, 0) != 0;
1330 // Switch a header line between expanded and contracted.
1331 void wxStyledTextCtrl::ToggleFold(int line
) {
1332 SendMsg(2231, line
, 0);
1335 // Ensure a particular line is visible by expanding any header line hiding it.
1336 void wxStyledTextCtrl::EnsureVisible(int line
) {
1337 SendMsg(2232, line
, 0);
1340 // Set some debugging options for folding
1341 void wxStyledTextCtrl::SetFoldFlags(int flags
) {
1342 SendMsg(2233, flags
, 0);
1345 // Ensure a particular line is visible by expanding any header line hiding it.
1346 // Use the currently set visibility policy to determine which range to display.
1347 void wxStyledTextCtrl::EnsureVisibleEnforcePolicy(int line
) {
1348 SendMsg(2234, line
, 0);
1351 // Sets whether a tab pressed when caret is within indentation indents
1352 void wxStyledTextCtrl::SetTabIndents(bool tabIndents
) {
1353 SendMsg(2260, tabIndents
, 0);
1356 // Does a tab pressed when caret is within indentation indent?
1357 bool wxStyledTextCtrl::GetTabIndents() {
1358 return SendMsg(2261, 0, 0) != 0;
1361 // Sets whether a backspace pressed when caret is within indentation unindents
1362 void wxStyledTextCtrl::SetBackSpaceUnIndents(bool bsUnIndents
) {
1363 SendMsg(2262, bsUnIndents
, 0);
1366 // Does a backspace pressed when caret is within indentation unindent?
1367 bool wxStyledTextCtrl::GetBackSpaceUnIndents() {
1368 return SendMsg(2263, 0, 0) != 0;
1371 // Sets the time the mouse must sit still to generate a mouse dwell event
1372 void wxStyledTextCtrl::SetMouseDwellTime(int periodMilliseconds
) {
1373 SendMsg(2264, periodMilliseconds
, 0);
1376 // Retrieve the time the mouse must sit still to generate a mouse dwell event
1377 int wxStyledTextCtrl::GetMouseDwellTime() {
1378 return SendMsg(2265, 0, 0);
1381 // Get position of start of word
1382 int wxStyledTextCtrl::WordStartPosition(int pos
, bool onlyWordCharacters
) {
1383 return SendMsg(2266, pos
, onlyWordCharacters
);
1386 // Get position of end of word
1387 int wxStyledTextCtrl::WordEndPosition(int pos
, bool onlyWordCharacters
) {
1388 return SendMsg(2267, pos
, onlyWordCharacters
);
1391 // Sets whether text is word wrapped
1392 void wxStyledTextCtrl::SetWrapMode(int mode
) {
1393 SendMsg(2268, mode
, 0);
1396 // Retrieve whether text is word wrapped
1397 int wxStyledTextCtrl::GetWrapMode() {
1398 return SendMsg(2269, 0, 0);
1401 // Sets the degree of caching of layout information
1402 void wxStyledTextCtrl::SetLayoutCache(int mode
) {
1403 SendMsg(2272, mode
, 0);
1406 // Retrieve the degree of caching of layout information
1407 int wxStyledTextCtrl::GetLayoutCache() {
1408 return SendMsg(2273, 0, 0);
1411 // Delete the selection or if no selection, the character before the caret.
1412 // Will not delete the chraacter before at the start of a line.
1413 void wxStyledTextCtrl::DeleteBackNotLine() {
1414 SendMsg(2344, 0, 0);
1417 // Move the caret inside current view if it's not there already
1418 void wxStyledTextCtrl::MoveCaretInsideView() {
1419 SendMsg(2401, 0, 0);
1422 // How many characters are on a line, not including end of line characters.
1423 int wxStyledTextCtrl::LineLength(int line
) {
1424 return SendMsg(2350, line
, 0);
1427 // Highlight the characters at two positions.
1428 void wxStyledTextCtrl::BraceHighlight(int pos1
, int pos2
) {
1429 SendMsg(2351, pos1
, pos2
);
1432 // Highlight the character at a position indicating there is no matching brace.
1433 void wxStyledTextCtrl::BraceBadLight(int pos
) {
1434 SendMsg(2352, pos
, 0);
1437 // Find the position of a matching brace or INVALID_POSITION if no match.
1438 int wxStyledTextCtrl::BraceMatch(int pos
) {
1439 return SendMsg(2353, pos
, 0);
1442 // Are the end of line characters visible.
1443 bool wxStyledTextCtrl::GetViewEOL() {
1444 return SendMsg(2355, 0, 0) != 0;
1447 // Make the end of line characters visible or invisible
1448 void wxStyledTextCtrl::SetViewEOL(bool visible
) {
1449 SendMsg(2356, visible
, 0);
1452 // Retrieve a pointer to the document object.
1453 void* wxStyledTextCtrl::GetDocPointer() {
1454 return (void*)SendMsg(2357);
1457 // Change the document object used.
1458 void wxStyledTextCtrl::SetDocPointer(void* docPointer
) {
1459 SendMsg(2358, 0, (long)docPointer
);
1462 // Set which document modification events are sent to the container.
1463 void wxStyledTextCtrl::SetModEventMask(int mask
) {
1464 SendMsg(2359, mask
, 0);
1467 // Retrieve the column number which text should be kept within.
1468 int wxStyledTextCtrl::GetEdgeColumn() {
1469 return SendMsg(2360, 0, 0);
1472 // Set the column number of the edge.
1473 // If text goes past the edge then it is highlighted.
1474 void wxStyledTextCtrl::SetEdgeColumn(int column
) {
1475 SendMsg(2361, column
, 0);
1478 // Retrieve the edge highlight mode.
1479 int wxStyledTextCtrl::GetEdgeMode() {
1480 return SendMsg(2362, 0, 0);
1483 // The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
1484 // goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
1485 void wxStyledTextCtrl::SetEdgeMode(int mode
) {
1486 SendMsg(2363, mode
, 0);
1489 // Retrieve the colour used in edge indication.
1490 wxColour
wxStyledTextCtrl::GetEdgeColour() {
1491 long c
= SendMsg(2364, 0, 0);
1492 return wxColourFromLong(c
);
1495 // Change the colour used in edge indication.
1496 void wxStyledTextCtrl::SetEdgeColour(const wxColour
& edgeColour
) {
1497 SendMsg(2365, wxColourAsLong(edgeColour
), 0);
1500 // Sets the current caret position to be the search anchor.
1501 void wxStyledTextCtrl::SearchAnchor() {
1502 SendMsg(2366, 0, 0);
1505 // Find some text starting at the search anchor.
1506 // Does not ensure the selection is visible.
1507 int wxStyledTextCtrl::SearchNext(int flags
, const wxString
& text
) {
1508 return SendMsg(2367, flags
, (long)text
.c_str());
1511 // Find some text starting at the search anchor and moving backwards.
1512 // Does not ensure the selection is visible.
1513 int wxStyledTextCtrl::SearchPrev(int flags
, const wxString
& text
) {
1514 return SendMsg(2368, flags
, (long)text
.c_str());
1517 // Set the way the line the caret is on is kept visible.
1518 void wxStyledTextCtrl::SetCaretPolicy(int caretPolicy
, int caretSlop
) {
1519 SendMsg(2369, caretPolicy
, caretSlop
);
1522 // Retrieves the number of lines completely visible.
1523 int wxStyledTextCtrl::LinesOnScreen() {
1524 return SendMsg(2370, 0, 0);
1527 // Set whether a pop up menu is displayed automatically when the user presses
1528 // the wrong mouse button.
1529 void wxStyledTextCtrl::UsePopUp(bool allowPopUp
) {
1530 SendMsg(2371, allowPopUp
, 0);
1533 // Is the selection a rectangular. The alternative is the more common stream selection.
1534 bool wxStyledTextCtrl::SelectionIsRectangle() {
1535 return SendMsg(2372, 0, 0) != 0;
1538 // Set the zoom level. This number of points is added to the size of all fonts.
1539 // It may be positive to magnify or negative to reduce.
1540 void wxStyledTextCtrl::SetZoom(int zoom
) {
1541 SendMsg(2373, zoom
, 0);
1544 // Retrieve the zoom level.
1545 int wxStyledTextCtrl::GetZoom() {
1546 return SendMsg(2374, 0, 0);
1549 // Create a new document object.
1550 // Starts with reference count of 1 and not selected into editor.
1551 void* wxStyledTextCtrl::CreateDocument() {
1552 return (void*)SendMsg(2375);
1555 // Extend life of document.
1556 void wxStyledTextCtrl::AddRefDocument(void* docPointer
) {
1557 SendMsg(2376, (long)docPointer
);
1560 // Release a reference to the document, deleting document if it fades to black.
1561 void wxStyledTextCtrl::ReleaseDocument(void* docPointer
) {
1562 SendMsg(2377, (long)docPointer
);
1565 // Get which document modification events are sent to the container.
1566 int wxStyledTextCtrl::GetModEventMask() {
1567 return SendMsg(2378, 0, 0);
1570 // Change internal focus flag
1571 void wxStyledTextCtrl::SetSTCFocus(bool focus
) {
1572 SendMsg(2380, focus
, 0);
1575 // Get internal focus flag
1576 bool wxStyledTextCtrl::GetSTCFocus() {
1577 return SendMsg(2381, 0, 0) != 0;
1580 // Change error status - 0 = OK
1581 void wxStyledTextCtrl::SetStatus(int statusCode
) {
1582 SendMsg(2382, statusCode
, 0);
1586 int wxStyledTextCtrl::GetStatus() {
1587 return SendMsg(2383, 0, 0);
1590 // Set whether the mouse is captured when its button is pressed
1591 void wxStyledTextCtrl::SetMouseDownCaptures(bool captures
) {
1592 SendMsg(2384, captures
, 0);
1595 // Get whether mouse gets captured
1596 bool wxStyledTextCtrl::GetMouseDownCaptures() {
1597 return SendMsg(2385, 0, 0) != 0;
1600 // Sets the cursor to one of the SC_CURSOR* values
1601 void wxStyledTextCtrl::SetCursor(int cursorType
) {
1602 SendMsg(2386, cursorType
, 0);
1606 int wxStyledTextCtrl::GetCursor() {
1607 return SendMsg(2387, 0, 0);
1610 // Change the way control characters are displayed:
1611 // If symbol is < 32, keep the drawn way, else, use the given character
1612 void wxStyledTextCtrl::SetControlCharSymbol(int symbol
) {
1613 SendMsg(2388, symbol
, 0);
1616 // Get the way control characters are displayed
1617 int wxStyledTextCtrl::GetControlCharSymbol() {
1618 return SendMsg(2389, 0, 0);
1621 // Move to the previous change in capitalistion
1622 void wxStyledTextCtrl::WordPartLeft() {
1623 SendMsg(2390, 0, 0);
1626 // Move to the previous change in capitalistion extending selection to new caret position.
1627 void wxStyledTextCtrl::WordPartLeftExtend() {
1628 SendMsg(2391, 0, 0);
1631 // Move to the change next in capitalistion
1632 void wxStyledTextCtrl::WordPartRight() {
1633 SendMsg(2392, 0, 0);
1636 // Move to the next change in capitalistion extending selection to new caret position.
1637 void wxStyledTextCtrl::WordPartRightExtend() {
1638 SendMsg(2393, 0, 0);
1641 // Set the way the display area is determined when a particular line is to be moved to.
1642 void wxStyledTextCtrl::SetVisiblePolicy(int visiblePolicy
, int visibleSlop
) {
1643 SendMsg(2394, visiblePolicy
, visibleSlop
);
1646 // Delete back from the current position to the start of the line
1647 void wxStyledTextCtrl::DelLineLeft() {
1648 SendMsg(2395, 0, 0);
1651 // Delete forwards from the current position to the end of the line
1652 void wxStyledTextCtrl::DelLineRight() {
1653 SendMsg(2396, 0, 0);
1656 // Get and Set the xOffset (ie, horizonal scroll position)
1657 void wxStyledTextCtrl::SetXOffset(int newOffset
) {
1658 SendMsg(2397, newOffset
, 0);
1660 int wxStyledTextCtrl::GetXOffset() {
1661 return SendMsg(2398, 0, 0);
1664 // Start notifying the container of all key presses and commands.
1665 void wxStyledTextCtrl::StartRecord() {
1666 SendMsg(3001, 0, 0);
1669 // Stop notifying the container of all key presses and commands.
1670 void wxStyledTextCtrl::StopRecord() {
1671 SendMsg(3002, 0, 0);
1674 // Set the lexing language of the document.
1675 void wxStyledTextCtrl::SetLexer(int lexer
) {
1676 SendMsg(4001, lexer
, 0);
1679 // Retrieve the lexing language of the document.
1680 int wxStyledTextCtrl::GetLexer() {
1681 return SendMsg(4002, 0, 0);
1684 // Colourise a segment of the document using the current lexing language.
1685 void wxStyledTextCtrl::Colourise(int start
, int end
) {
1686 SendMsg(4003, start
, end
);
1689 // Set up a value that may be used by a lexer for some optional feature.
1690 void wxStyledTextCtrl::SetProperty(const wxString
& key
, const wxString
& value
) {
1691 SendMsg(4004, (long)key
.c_str(), (long)value
.c_str());
1694 // Set up the key words used by the lexer.
1695 void wxStyledTextCtrl::SetKeyWords(int keywordSet
, const wxString
& keyWords
) {
1696 SendMsg(4005, keywordSet
, (long)keyWords
.c_str());
1699 // Set the lexing language of the document based on string name.
1700 void wxStyledTextCtrl::SetLexerLanguage(const wxString
& language
) {
1701 SendMsg(4006, 0, (long)language
.c_str());
1704 // END of generated section
1705 //----------------------------------------------------------------------
1708 // Returns the line number of the line with the caret.
1709 int wxStyledTextCtrl::GetCurrentLine() {
1710 int line
= LineFromPosition(GetCurrentPos());
1715 // Extract style settings from a spec-string which is composed of one or
1716 // more of the following comma separated elements:
1718 // bold turns on bold
1719 // italic turns on italics
1720 // fore:#RRGGBB sets the foreground colour
1721 // back:#RRGGBB sets the background colour
1722 // face:[facename] sets the font face name to use
1723 // size:[num] sets the font size in points
1724 // eol turns on eol filling
1725 // underline turns on underlining
1727 void wxStyledTextCtrl::StyleSetSpec(int styleNum
, const wxString
& spec
) {
1729 wxStringTokenizer
tkz(spec
, ",");
1730 while (tkz
.HasMoreTokens()) {
1731 wxString token
= tkz
.GetNextToken();
1733 wxString option
= token
.BeforeFirst(':');
1734 wxString val
= token
.AfterFirst(':');
1736 if (option
== "bold")
1737 StyleSetBold(styleNum
, true);
1739 else if (option
== "italic")
1740 StyleSetItalic(styleNum
, true);
1742 else if (option
== "underline")
1743 StyleSetUnderline(styleNum
, true);
1745 else if (option
== "eol")
1746 StyleSetEOLFilled(styleNum
, true);
1748 else if (option
== "size") {
1750 if (val
.ToLong(&points
))
1751 StyleSetSize(styleNum
, points
);
1754 else if (option
== "face")
1755 StyleSetFaceName(styleNum
, val
);
1757 else if (option
== "fore")
1758 StyleSetForeground(styleNum
, wxColourFromSpec(val
));
1760 else if (option
== "back")
1761 StyleSetBackground(styleNum
, wxColourFromSpec(val
));
1766 // Set style size, face, bold, italic, and underline attributes from
1767 // a wxFont's attributes.
1768 void wxStyledTextCtrl::StyleSetFont(int styleNum
, wxFont
& font
) {
1769 int size
= font
.GetPointSize();
1770 wxString faceName
= font
.GetFaceName();
1771 bool bold
= font
.GetWeight() == wxBOLD
;
1772 bool italic
= font
.GetStyle() != wxNORMAL
;
1773 bool under
= font
.GetUnderlined();
1775 // TODO: add encoding/charset mapping
1776 StyleSetFontAttr(styleNum
, size
, faceName
, bold
, italic
, under
);
1779 // Set all font style attributes at once.
1780 void wxStyledTextCtrl::StyleSetFontAttr(int styleNum
, int size
,
1781 const wxString
& faceName
,
1782 bool bold
, bool italic
,
1784 StyleSetSize(styleNum
, size
);
1785 StyleSetFaceName(styleNum
, faceName
);
1786 StyleSetBold(styleNum
, bold
);
1787 StyleSetItalic(styleNum
, italic
);
1788 StyleSetUnderline(styleNum
, underline
);
1790 // TODO: add encoding/charset mapping
1794 // Perform one of the operations defined by the wxSTC_CMD_* constants.
1795 void wxStyledTextCtrl::CmdKeyExecute(int cmd
) {
1800 // Set the left and right margin in the edit area, measured in pixels.
1801 void wxStyledTextCtrl::SetMargins(int left
, int right
) {
1802 SetMarginLeft(left
);
1803 SetMarginRight(right
);
1807 // Retrieve the start and end positions of the current selection.
1808 void wxStyledTextCtrl::GetSelection(int* startPos
, int* endPos
) {
1809 if (startPos
!= NULL
)
1810 *startPos
= SendMsg(SCI_GETSELECTIONSTART
);
1812 *endPos
= SendMsg(SCI_GETSELECTIONEND
);
1816 // Retrieve the point in the window where a position is displayed.
1817 wxPoint
wxStyledTextCtrl::PointFromPosition(int pos
) {
1818 int x
= SendMsg(SCI_POINTXFROMPOSITION
, 0, pos
);
1819 int y
= SendMsg(SCI_POINTYFROMPOSITION
, 0, pos
);
1820 return wxPoint(x
, y
);
1823 // Scroll enough to make the given line visible
1824 void wxStyledTextCtrl::ScrollToLine(int line
) {
1825 m_swx
->DoScrollToLine(line
);
1829 // Scroll enough to make the given column visible
1830 void wxStyledTextCtrl::ScrollToColumn(int column
) {
1831 m_swx
->DoScrollToColumn(column
);
1836 //----------------------------------------------------------------------
1839 void wxStyledTextCtrl::OnPaint(wxPaintEvent
& evt
) {
1841 wxRegion region
= GetUpdateRegion();
1843 m_swx
->DoPaint(&dc
, region
.GetBox());
1846 void wxStyledTextCtrl::OnScrollWin(wxScrollWinEvent
& evt
) {
1847 if (evt
.GetOrientation() == wxHORIZONTAL
)
1848 m_swx
->DoHScroll(evt
.GetEventType(), evt
.GetPosition());
1850 m_swx
->DoVScroll(evt
.GetEventType(), evt
.GetPosition());
1853 void wxStyledTextCtrl::OnScroll(wxScrollEvent
& evt
) {
1854 wxScrollBar
* sb
= wxDynamicCast(evt
.GetEventObject(), wxScrollBar
);
1856 if (sb
->IsVertical())
1857 m_swx
->DoVScroll(evt
.GetEventType(), evt
.GetPosition());
1859 m_swx
->DoHScroll(evt
.GetEventType(), evt
.GetPosition());
1863 void wxStyledTextCtrl::OnSize(wxSizeEvent
& evt
) {
1864 wxSize sz
= GetClientSize();
1865 m_swx
->DoSize(sz
.x
, sz
.y
);
1868 void wxStyledTextCtrl::OnMouseLeftDown(wxMouseEvent
& evt
) {
1869 wxPoint pt
= evt
.GetPosition();
1870 m_swx
->DoButtonDown(Point(pt
.x
, pt
.y
), m_stopWatch
.Time(),
1871 evt
.ShiftDown(), evt
.ControlDown(), evt
.AltDown());
1874 void wxStyledTextCtrl::OnMouseMove(wxMouseEvent
& evt
) {
1875 wxPoint pt
= evt
.GetPosition();
1876 m_swx
->DoButtonMove(Point(pt
.x
, pt
.y
));
1879 void wxStyledTextCtrl::OnMouseLeftUp(wxMouseEvent
& evt
) {
1880 wxPoint pt
= evt
.GetPosition();
1881 m_swx
->DoButtonUp(Point(pt
.x
, pt
.y
), m_stopWatch
.Time(),
1886 void wxStyledTextCtrl::OnMouseRightUp(wxMouseEvent
& evt
) {
1887 wxPoint pt
= evt
.GetPosition();
1888 m_swx
->DoContextMenu(Point(pt
.x
, pt
.y
));
1892 void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent
& evt
) {
1893 wxPoint pt
= evt
.GetPosition();
1894 ScreenToClient(&pt
.x
, &pt
.y
);
1895 m_swx
->DoContextMenu(Point(pt
.x
, pt
.y
));
1899 void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent
& evt
) {
1900 m_swx
->DoMouseWheel(evt
.GetWheelRotation(),
1901 evt
.GetWheelDelta(),
1902 evt
.GetLinesPerAction(),
1907 void wxStyledTextCtrl::OnChar(wxKeyEvent
& evt
) {
1908 long key
= evt
.KeyCode();
1910 // printf("OnChar key:%d consumed:%d ctrl:%d alt:%d\n",
1911 // key, m_lastKeyDownConsumed, evt.ControlDown(), evt.AltDown());
1914 // \|@#¬[]{}?£$~ ã,õ,Ã,Õ, ñ, Ñ
1916 // On (some?) non-US keyboards the AltGr key is required to enter some
1917 // common characters. It comes to us as both Alt and Ctrl down so we need
1918 // to let the char through in that case, otherwise if only ctrl or only
1919 // alt let's skip it.
1920 bool ctrl
= evt
.ControlDown();
1921 bool alt
= evt
.AltDown();
1922 bool skip
= ((ctrl
|| alt
) && ! (ctrl
&& alt
));
1924 if (key
<= 0xff && key
>= 32 && !m_lastKeyDownConsumed
&& !skip
) {
1925 m_swx
->DoAddChar(key
);
1932 void wxStyledTextCtrl::OnKeyDown(wxKeyEvent
& evt
) {
1933 long key
= evt
.KeyCode();
1934 bool shift
= evt
.ShiftDown(),
1935 ctrl
= evt
.ControlDown(),
1936 alt
= evt
.AltDown();
1938 int processed
= m_swx
->DoKeyDown(key
, shift
, ctrl
, alt
, &m_lastKeyDownConsumed
);
1940 // printf("key: %d shift: %d ctrl: %d alt: %d processed: %d consumed: %d\n",
1941 // key, shift, ctrl, alt, processed, m_lastKeyDownConsumed);
1943 if (!processed
&& !m_lastKeyDownConsumed
)
1948 void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent
& evt
) {
1949 m_swx
->DoLoseFocus();
1953 void wxStyledTextCtrl::OnGainFocus(wxFocusEvent
& evt
) {
1954 m_swx
->DoGainFocus();
1958 void wxStyledTextCtrl::OnSysColourChanged(wxSysColourChangedEvent
& evt
) {
1959 m_swx
->DoSysColourChange();
1963 void wxStyledTextCtrl::OnEraseBackground(wxEraseEvent
& evt
) {
1964 // do nothing to help avoid flashing
1969 void wxStyledTextCtrl::OnMenu(wxCommandEvent
& evt
) {
1970 m_swx
->DoCommand(evt
.GetId());
1974 void wxStyledTextCtrl::OnListBox(wxCommandEvent
& evt
) {
1975 m_swx
->DoOnListBox();
1979 //----------------------------------------------------------------------
1980 // Turn notifications from Scintilla into events
1983 void wxStyledTextCtrl::NotifyChange() {
1984 wxStyledTextEvent
evt(wxEVT_STC_CHANGE
, GetId());
1985 evt
.SetEventObject(this);
1986 GetEventHandler()->ProcessEvent(evt
);
1989 void wxStyledTextCtrl::NotifyParent(SCNotification
* _scn
) {
1990 SCNotification
& scn
= *_scn
;
1991 wxStyledTextEvent
evt(0, GetId());
1993 evt
.SetEventObject(this);
1994 evt
.SetPosition(scn
.position
);
1996 evt
.SetModifiers(scn
.modifiers
);
1998 switch (scn
.nmhdr
.code
) {
1999 case SCN_STYLENEEDED
:
2000 evt
.SetEventType(wxEVT_STC_STYLENEEDED
);
2004 evt
.SetEventType(wxEVT_STC_CHARADDED
);
2007 case SCN_SAVEPOINTREACHED
:
2008 evt
.SetEventType(wxEVT_STC_SAVEPOINTREACHED
);
2011 case SCN_SAVEPOINTLEFT
:
2012 evt
.SetEventType(wxEVT_STC_SAVEPOINTLEFT
);
2015 case SCN_MODIFYATTEMPTRO
:
2016 evt
.SetEventType(wxEVT_STC_ROMODIFYATTEMPT
);
2020 evt
.SetEventType(wxEVT_STC_KEY
);
2023 case SCN_DOUBLECLICK
:
2024 evt
.SetEventType(wxEVT_STC_DOUBLECLICK
);
2028 evt
.SetEventType(wxEVT_STC_UPDATEUI
);
2032 evt
.SetEventType(wxEVT_STC_MODIFIED
);
2033 evt
.SetModificationType(scn
.modificationType
);
2035 evt
.SetText(wxString(scn
.text
, scn
.length
));
2036 evt
.SetLength(scn
.length
);
2037 evt
.SetLinesAdded(scn
.linesAdded
);
2038 evt
.SetLine(scn
.line
);
2039 evt
.SetFoldLevelNow(scn
.foldLevelNow
);
2040 evt
.SetFoldLevelPrev(scn
.foldLevelPrev
);
2043 case SCN_MACRORECORD
:
2044 evt
.SetEventType(wxEVT_STC_MACRORECORD
);
2045 evt
.SetMessage(scn
.message
);
2046 evt
.SetWParam(scn
.wParam
);
2047 evt
.SetLParam(scn
.lParam
);
2050 case SCN_MARGINCLICK
:
2051 evt
.SetEventType(wxEVT_STC_MARGINCLICK
);
2052 evt
.SetMargin(scn
.margin
);
2056 evt
.SetEventType(wxEVT_STC_NEEDSHOWN
);
2057 evt
.SetLength(scn
.length
);
2061 evt
.SetEventType(wxEVT_STC_PAINTED
);
2064 case SCN_USERLISTSELECTION
:
2065 evt
.SetEventType(wxEVT_STC_USERLISTSELECTION
);
2066 evt
.SetListType(scn
.listType
);
2067 evt
.SetText(scn
.text
);
2070 case SCN_URIDROPPED
:
2071 evt
.SetEventType(wxEVT_STC_URIDROPPED
);
2072 evt
.SetText(scn
.text
);
2075 case SCN_DWELLSTART
:
2076 evt
.SetEventType(wxEVT_STC_DWELLSTART
);
2082 evt
.SetEventType(wxEVT_STC_DWELLEND
);
2091 GetEventHandler()->ProcessEvent(evt
);
2095 //----------------------------------------------------------------------
2096 //----------------------------------------------------------------------
2097 //----------------------------------------------------------------------
2099 wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType
, int id
)
2100 : wxCommandEvent(commandType
, id
)
2105 m_modificationType
= 0;
2110 m_foldLevelPrev
= 0;
2118 m_dragAllowMove
= FALSE
;
2119 m_dragResult
= wxDragNone
;
2122 bool wxStyledTextEvent::GetShift() const { return (m_modifiers
& SCI_SHIFT
) != 0; }
2123 bool wxStyledTextEvent::GetControl() const { return (m_modifiers
& SCI_CTRL
) != 0; }
2124 bool wxStyledTextEvent::GetAlt() const { return (m_modifiers
& SCI_ALT
) != 0; }
2127 wxStyledTextEvent::wxStyledTextEvent(const wxStyledTextEvent
& event
):
2128 wxCommandEvent(event
)
2130 m_position
= event
.m_position
;
2131 m_key
= event
.m_key
;
2132 m_modifiers
= event
.m_modifiers
;
2133 m_modificationType
= event
.m_modificationType
;
2134 m_text
= event
.m_text
;
2135 m_length
= event
.m_length
;
2136 m_linesAdded
= event
.m_linesAdded
;
2137 m_line
= event
.m_line
;
2138 m_foldLevelNow
= event
.m_foldLevelNow
;
2139 m_foldLevelPrev
= event
.m_foldLevelPrev
;
2141 m_margin
= event
.m_margin
;
2143 m_message
= event
.m_message
;
2144 m_wParam
= event
.m_wParam
;
2145 m_lParam
= event
.m_lParam
;
2147 m_listType
= event
.m_listType
;
2151 m_dragText
= event
.m_dragText
;
2152 m_dragAllowMove
=event
.m_dragAllowMove
;
2153 m_dragResult
= event
.m_dragResult
;
2156 //----------------------------------------------------------------------
2157 //----------------------------------------------------------------------