///////////////////////////////////////////////////////////////////////////// // Name: stc/stc.h // Purpose: interface of wxStyledTextCtrl // Author: wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /* IMPORTANT: This file is generated by src/stc/gen_iface.py from src/stc/stc.interface.h.in. Do not edit the file in interface/wx/stc or your changes will be lost. */ // STC constants {{{ %(VALUES)s //}}} //The following values are deprecated in the Scintilla library ///@deprecated #define wxSTC_INDIC0_MASK 0x20 ///@deprecated #define wxSTC_INDIC1_MASK 0x40 ///@deprecated #define wxSTC_INDIC2_MASK 0x80 ///@deprecated #define wxSTC_INDICS_MASK 0xE0 // Commands that can be bound to keystrokes {{{ %(CMDS)s //}}} /** @class wxStyledTextCtrl A wxWidgets implementation of the Scintilla source code editing component. As well as features found in standard text editing components, Scintilla includes features especially useful when editing and debugging source code. These include support for syntax styling, error indicators, code completion and call tips. The selection margin can contain markers like those used in debuggers to indicate breakpoints and the current line. Styling choices are more open than with many editors, allowing the use of proportional fonts, bold and italics, multiple foreground and background colours and multiple fonts. wxStyledTextCtrl is a 1 to 1 mapping of "raw" scintilla interface, whose documentation can be found in the Scintilla website (http://www.scintilla.org/). Please see wxStyledTextEvent for the documentation of all event types you can use with wxStyledTextCtrl. @section stc_index Index of the member groups Links for quick access to the various categories of wxStyledTextCtrl functions: - @ref_member_group{ctor, Constructors and related methods} %(TABLE_OF_CONTENTS)s - @ref_member_group{additional_methods, Additional wxStyledTextCtrl methods} - @ref_member_group{raw_variants , Raw variants} - @ref_member_group{text_entry, Text entry methods} - @ref_member_group{text_area, Text area methods} @library{wxstc} @category{stc} @see wxStyledTextEvent */ class wxStyledTextCtrl : public wxControl, public wxTextEntry { public: // Ctor, etc // ---------------------------------------------- ///@member_group_name{ctor, Constructors and related methods} //@{ /** Ctor. */ wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxSTCNameStr); /** Default ctor. */ wxStyledTextCtrl(); /** Destructor. */ ~wxStyledTextCtrl(); /** Create the UI elements for a STC that was created with the default ctor. (For 2-phase create.) */ bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxSTCNameStr); //@} // Scintilla methods (generated by gen_iface.py) // ---------------------------------------------- // **** Generated methods {{{ %(METHOD_IDEFS)s //}}} // Manually declared methods // ---------------------------------------------- /** @member_group_name{additional_methods, Additional wxStyledTextCtrl methods} In addition to the standard Scintilla functions, wxStyledTextCtrl includes the following functions to simplify some tasks. */ //@{ /** Returns the line number of the line with the caret. */ int GetCurrentLine(); /** Extract style settings from a spec-string which is composed of one or more of the following comma separated elements: bold turns on bold italic turns on italics fore:[name or \#RRGGBB] sets the foreground colour back:[name or \#RRGGBB] sets the background colour face:[facename] sets the font face name to use size:[num] sets the font size in points eol turns on eol filling underline turns on underlining */ void StyleSetSpec(int styleNum, const wxString& spec); /** Get the font of a style. */ wxFont StyleGetFont(int style); /** Set style size, face, bold, italic, and underline attributes from a wxFont's attributes. */ void StyleSetFont(int styleNum, wxFont& font); /** Set all font style attributes at once. */ void StyleSetFontAttr(int styleNum, int size, const wxString& faceName, bool bold, bool italic, bool underline, wxFontEncoding encoding=wxFONTENCODING_DEFAULT); /** Set the font encoding to be used by a style. */ void StyleSetFontEncoding(int style, wxFontEncoding encoding); /** Perform one of the operations defined by the wxSTC_CMD_* constants. */ void CmdKeyExecute(int cmd); /** Set the left and right margin in the edit area, measured in pixels. */ void SetMargins(int left, int right); /** Scroll enough to make the given line visible */ void ScrollToLine(int line); /** Scroll enough to make the given column visible */ void ScrollToColumn(int column); /** Scintilla API call. */ wxIntPtr SendMsg(int msg, wxUIntPtr wp=0, wxIntPtr lp=0) const; /** Set the vertical scrollbar to use instead of the one that's built-in. */ void SetVScrollBar(wxScrollBar* bar); /** Set the horizontal scrollbar to use instead of the one that's built-in. */ void SetHScrollBar(wxScrollBar* bar); /** Can be used to prevent the EVT_CHAR handler from adding the char */ bool GetLastKeydownProcessed(); void SetLastKeydownProcessed(bool val); /** Write the contents of the editor to filename */ bool SaveFile(const wxString& filename); /** Load the contents of filename into the editor */ bool LoadFile(const wxString& filename); /** Allow for simulating a DnD DragEnter @since 3.1.0 */ wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult defaultRes); /** Allow for simulating a DnD DragOver */ wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult defaultRes); /** Allow for simulating a DnD DragLeave @since 3.1.0 */ void DoDragLeave(); /** Allow for simulating a DnD DropText */ bool DoDropText(long x, long y, const wxString& data); /** Specify whether anti-aliased fonts should be used. This will have no effect on some platforms, but on some (wxMac for example) can greatly improve performance. */ void SetUseAntiAliasing(bool useAA); /** Returns the current UseAntiAliasing setting. */ bool GetUseAntiAliasing(); /** Clear annotations from the given line. */ void AnnotationClearLine(int line); /** Define a marker with a wxBitmap. */ void MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp); /** Register an image for use in autocompletion lists. */ void RegisterImage(int type, const wxBitmap& bmp); //@} // Raw versions // ---------------------------------------------- /** @member_group_name{raw_variants , Raw variants } These methods allow data to be sent to or received from the control using character buffers instead of using a wxString. */ //@{ /** Add text to the document at current position. */ void AddTextRaw(const char* text, int length=-1); /** Insert string at a position. */ void InsertTextRaw(int pos, const char* text); /** Retrieve the text of the line containing the caret. Returns the index of the caret on the line. */ wxCharBuffer GetCurLineRaw(int* linePos=NULL); /** Retrieve the contents of a line. */ wxCharBuffer GetLineRaw(int line); /** Retrieve the selected text. */ wxCharBuffer GetSelectedTextRaw(); /** Retrieve the target text. @since 3.1.1 */ wxCharBuffer GetTargetTextRaw(); /** Retrieve a range of text. */ wxCharBuffer GetTextRangeRaw(int startPos, int endPos); /** Replace the contents of the document with the argument text. */ void SetTextRaw(const char* text); /** Retrieve all the text in the document. */ wxCharBuffer GetTextRaw(); /** Append a string to the end of the document without changing the selection. */ void AppendTextRaw(const char* text, int length=-1); /** Replace the current selection with text. If there is no current selection, text is inserted at the current caret position. @param text The null terminated string used for the replacement. @since 3.1.3 */ void ReplaceSelectionRaw(const char* text); /** Replace the current target with text. @return The return value is the length of the replacement string. @remarks If length=-1, text must be null terminated. @since 3.1.3 */ int ReplaceTargetRaw(const char* text, int length=-1); /** Replace the current target with text using regular expressions. The replacement string will be formed from text with any occurrences '\1' through '\9' replaced by tagged matches from the most recent regular expression search. In addition, any occurrences of '\0' will be replaced with all the matched text from the most recent search. After replacement, the target range refers to the replacement text. @return The return value is the length of the replacement string. @remarks If length=-1, text must be null terminated. @see SearchInTarget() @since 3.1.3 */ int ReplaceTargetRERaw(const char* text, int length=-1); //@} // wxTextEntryBase pure virtual methods // ---------------------------------------------- ///@member_group_name{text_entry, Text entry methods} //@{ /** Writes the text into the text control at the current insertion position. @param text Text to write to the text control. @remarks Newlines in the text string are the only control characters allowed, and they will cause appropriate line breaks. See operator<<() and AppendText() for more convenient ways of writing to the window. After the write operation, the insertion point will be at the end of the inserted text, so subsequent write operations will be appended. To append text after the user may have interacted with the control, call wxTextCtrl::SetInsertionPointEnd() before writing. */ virtual void WriteText(const wxString& text); /** Removes the text starting at the first given position up to (but not including) the character at the last position. This function puts the current insertion point position at @a to as a side effect. @param from The first position. @param to The last position. */ virtual void Remove(long from, long to); /** Replaces the text starting at the first position up to (but not including) the character at the last position with the given text. This function puts the current insertion point position at @a to as a side effect. @param from The first position. @param to The last position. @param value The value to replace the existing text with. */ virtual void Replace(long from, long to, const wxString& value); /** Sets the insertion point at the given position. @param pos Position to set, in the range from 0 to GetLastPosition() inclusive. */ virtual void SetInsertionPoint(long pos); /** Returns the insertion point, or cursor, position. This is defined as the zero based index of the character position to the right of the insertion point. For example, if the insertion point is at the end of the single-line text control, it is equal to GetLastPosition(). Notice that insertion position is, in general, different from the index of the character the cursor position at in the string returned by GetValue(). While this is always the case for the single line controls, multi-line controls can use two characters @c "\\r\\n" as line separator (this is notably the case under MSW) meaning that indices in the control and its string value are offset by 1 for every line. Hence to correctly get the character at the current cursor position, taking into account that there can be none if the cursor is at the end of the string, you could do the following: @code wxString GetCurrentChar(wxTextCtrl *tc) { long pos = tc->GetInsertionPoint(); if ( pos == tc->GetLastPosition() ) return wxString(); return tc->GetRange(pos, pos + 1); } @endcode */ virtual long GetInsertionPoint() const; /** Returns the zero based index of the last position in the text control, which is equal to the number of characters in the control. */ virtual long GetLastPosition() const; /** Selects the text starting at the first position up to (but not including) the character at the last position. If both parameters are equal to -1 all text in the control is selected. Notice that the insertion point will be moved to @a from by this function. @param from The first position. @param to The last position. @see SelectAll() */ virtual void SetSelection(long from, long to); /** Deselects selected text in the control. @since 2.9.5 */ virtual void SelectNone(); /** Gets the current selection span. If the returned values are equal, there was no selection. Please note that the indices returned may be used with the other wxTextCtrl methods but don't necessarily represent the correct indices into the string returned by GetValue() for multiline controls under Windows (at least,) you should use GetStringSelection() to get the selected text. @param from The returned first position. @param to The returned last position. @beginWxPerlOnly In wxPerl this method takes no parameters and returns a 2-element list (from, to). @endWxPerlOnly */ virtual void GetSelection(long *from, long *to) const; /** Returns @true if the controls contents may be edited by user (note that it always can be changed by the program). In other words, this functions returns @true if the control hasn't been put in read-only mode by a previous call to SetEditable(). */ virtual bool IsEditable() const; /** Makes the text item editable or read-only, overriding the @b wxTE_READONLY flag. @param editable If @true, the control is editable. If @false, the control is read-only. @see IsEditable() */ virtual void SetEditable(bool editable); //@} // wxTextAreaBase pure virtual methods // --------------------------------------------- ///@member_group_name{text_area, Text area methods} //@{ /** Gets the length of the specified line, not including any trailing newline character(s). @param lineNo Line number (starting from zero). @return The length of the line, or -1 if @a lineNo was invalid. */ virtual int GetLineLength(long lineNo) const; /** Returns the contents of a given line in the text control, not including any trailing newline character(s). @param lineNo The line number, starting from zero. @return The contents of the line. */ virtual wxString GetLineText(long lineNo) const; /** Returns the number of lines in the text control buffer. The returned number is the number of logical lines, i.e. just the count of the number of newline characters in the control + 1, for wxGTK and wxOSX/Cocoa ports while it is the number of physical lines, i.e. the count of lines actually shown in the control, in wxMSW. Because of this discrepancy, it is not recommended to use this function. @remarks Note that even empty text controls have one line (where the insertion point is), so GetNumberOfLines() never returns 0. */ virtual int GetNumberOfLines() const; /** Returns @true if the text has been modified by user. Note that calling SetValue() doesn't make the control modified. @see MarkDirty() */ virtual bool IsModified() const; /** Mark text as modified (dirty). @see IsModified() */ virtual void MarkDirty(); /** Resets the internal modified flag as if the current changes had been saved. */ virtual void DiscardEdits(); /** This method is inherited from wxTextAreaBase but is not implemented in wxStyledTextCtrl. */ virtual bool SetStyle(long start, long end, const wxTextAttr& style); /** This method is inherited from wxTextAreaBase but is not implemented in wxStyledTextCtrl. */ virtual bool GetStyle(long position, wxTextAttr& style); /** This method is inherited from wxTextAreaBase but is not implemented in wxStyledTextCtrl. */ virtual bool SetDefaultStyle(const wxTextAttr& style); /** Converts the given zero based column and line number to a position. @param x The column number. @param y The line number. @return The position value, or -1 if x or y was invalid. */ virtual long XYToPosition(long x, long y) const; /** Converts given position to a zero-based column, line number pair. @param pos Position. @param x Receives zero based column number. @param y Receives zero based line number. @return @true on success, @false on failure (most likely due to a too large position parameter). @beginWxPerlOnly In wxPerl this function takes only the @a pos argument and returns a 2-element list (x, y). @endWxPerlOnly @see XYToPosition() */ virtual bool PositionToXY(long pos, long *x, long *y) const; /** Makes the line containing the given position visible. @param pos The position that should be visible. */ virtual void ShowPosition(long pos); /** Finds the position of the character at the specified point. If the return code is not @c wxTE_HT_UNKNOWN the row and column of the character closest to this position are returned, otherwise the output parameters are not modified. Please note that this function is currently only implemented in wxUniv, wxMSW and wxGTK2 ports and always returns @c wxTE_HT_UNKNOWN in the other ports. @beginWxPerlOnly In wxPerl this function takes only the @a pt argument and returns a 3-element list (result, col, row). @endWxPerlOnly @param pt The position of the point to check, in window device coordinates. @param pos Receives the position of the character at the given position. May be @NULL. @see PositionToXY(), XYToPosition() */ virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const; /** Finds the row and column of the character at the specified point. If the return code is not @c wxTE_HT_UNKNOWN the row and column of the character closest to this position are returned, otherwise the output parameters are not modified. Please note that this function is currently only implemented in wxUniv, wxMSW and wxGTK2 ports and always returns @c wxTE_HT_UNKNOWN in the other ports. @beginWxPerlOnly In wxPerl this function takes only the @a pt argument and returns a 3-element list (result, col, row). @endWxPerlOnly @param pt The position of the point to check, in window device coordinates. @param col Receives the column of the character at the given position. May be @NULL. @param row Receives the row of the character at the given position. May be @NULL. @see PositionToXY(), XYToPosition() */ virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, wxTextCoord *col, wxTextCoord *row) const; //@} // VersionInfo // --------------------------------------------- /** Returns the version of the Scintilla library used by this control. */ static wxVersionInfo GetLibraryVersionInfo(); }; //---------------------------------------------------------------------- /** @class wxStyledTextEvent The type of events sent from wxStyledTextCtrl. @beginEventTable{wxStyledTextEvent} @event{EVT_STC_AUTOCOMP_CANCELLED(id, fn)} Process a @c wxEVT_STC_AUTOCOMP_CANCELLED event. @event{EVT_STC_AUTOCOMP_CHAR_DELETED(id, fn)} Process a @c wxEVT_STC_AUTOCOMP_CHAR_DELETED event. @event{EVT_STC_AUTOCOMP_COMPLETED(id, fn)} Process a @c wxEVT_STC_AUTOCOMP_COMPLETED event. @since 3.1.1 @event{EVT_STC_AUTOCOMP_SELECTION(id, fn)} Process a @c wxEVT_STC_AUTOCOMP_SELECTION event. @event{EVT_STC_AUTOCOMP_SELECTION_CHANGE(id, fn)} Process a @c wxEVT_STC_AUTOCOMP_SELECTION_CHANGE event. @since 3.1.3 @event{EVT_STC_CALLTIP_CLICK(id, fn)} Process a @c wxEVT_STC_CALLTIP_CLICK event. @event{EVT_STC_CHANGE(id, fn)} Process a @c wxEVT_STC_CHANGE event. @event{EVT_STC_CHARADDED(id, fn)} Process a @c wxEVT_STC_CHARADDED event. @event{EVT_STC_CLIPBOARD_COPY(id, fn)} Process a @c wxEVT_STC_CLIPBOARD_COPY event. @since 3.1.0 @event{EVT_STC_CLIPBOARD_PASTE(id, fn)} Process a @c wxEVT_STC_CLIPBOARD_PASTE event. @since 3.1.0 @event{EVT_STC_DO_DROP(id, fn)} Process a @c wxEVT_STC_DO_DROP event. @event{EVT_STC_DOUBLECLICK(id, fn)} Process a @c wxEVT_STC_DOUBLECLICK event. @event{EVT_STC_DRAG_OVER(id, fn)} Process a @c wxEVT_STC_DRAG_OVER event. @event{EVT_STC_DWELLEND(id, fn)} Process a @c wxEVT_STC_DWELLEND event. @event{EVT_STC_DWELLSTART(id, fn)} Process a @c wxEVT_STC_DWELLSTART event. @event{EVT_STC_HOTSPOT_CLICK(id, fn)} Process a @c wxEVT_STC_HOTSPOT_CLICK event. @event{EVT_STC_HOTSPOT_DCLICK(id, fn)} Process a @c wxEVT_STC_HOTSPOT_DCLICK event. @event{EVT_STC_HOTSPOT_RELEASE_CLICK(id, fn)} Process a @c wxEVT_STC_HOTSPOT_RELEASE_CLICK event. @event{EVT_STC_INDICATOR_CLICK(id, fn)} Process a @c wxEVT_STC_INDICATOR_CLICK event. @event{EVT_STC_INDICATOR_RELEASE(id, fn)} Process a @c wxEVT_STC_INDICATOR_RELEASE event. @event{EVT_STC_MACRORECORD(id, fn)} Process a @c wxEVT_STC_MACRORECORD event. @event{EVT_STC_MARGIN_RIGHT_CLICK(id, fn)} Process a @c wxEVT_STC_MARGIN_RIGHT_CLICK event. @since 3.1.1 @event{EVT_STC_MARGINCLICK(id, fn)} Process a @c wxEVT_STC_MARGINCLICK event. @event{EVT_STC_MODIFIED(id, fn)} Process a @c wxEVT_STC_MODIFIED event. @event{EVT_STC_NEEDSHOWN(id, fn)} Process a @c wxEVT_STC_NEEDSHOWN event. @event{EVT_STC_PAINTED(id, fn)} Process a @c wxEVT_STC_PAINTED event. @event{EVT_STC_ROMODIFYATTEMPT(id, fn)} Process a @c wxEVT_STC_ROMODIFYATTEMPT event. @event{EVT_STC_SAVEPOINTLEFT(id, fn)} Process a @c wxEVT_STC_SAVEPOINTLEFT event. @event{EVT_STC_SAVEPOINTREACHED(id, fn)} Process a @c wxEVT_STC_SAVEPOINTREACHED event. @event{EVT_STC_START_DRAG(id, fn)} Process a @c wxEVT_STC_START_DRAG event. @event{EVT_STC_STYLENEEDED(id, fn)} Process a @c wxEVT_STC_STYLENEEDED event. @event{EVT_STC_UPDATEUI(id, fn)} Process a @c wxEVT_STC_UPDATEUI event. @event{EVT_STC_USERLISTSELECTION(id, fn)} Process a @c wxEVT_STC_USERLISTSELECTION event. @event{EVT_STC_ZOOM(id, fn)} Process a @c wxEVT_STC_ZOOM event. @endEventTable Most of the Scintilla notifications are mapped to a similarly named wxStyledTextEvent. However a few of the notifications would only offer information available in other wxWidgets event types, and in those cases a corresponding wxStyledTextEvent is not defined. Currently, the @c wxEVT_KEY_DOWN event is used instead of the @c SCN_KEY notification. The regular wxWidgets drag and drop functionality can be used instead of the @c SCN_URIDROPPED notification. The @c wxEVT_SET_FOCUS event is used instead of the @c SCN_FOCUSIN notification. And the @c wxEVT_KILL_FOCUS event is used instead of the @c SCN_FOCUSOUT notification. @section event_types Event Types The following is a brief description of when the control generates these events and a list of which methods provide relevent information. Additional details can be found in the Scintilla documentation (http://www.scintilla.org/ScintillaDoc.html#Notifications). @c wxEVT_STC_AUTOCOMP_CANCELLED - Generated when an autocompletion list has been canceled. - Valid event functions: none. @c wxEVT_STC_AUTOCOMP_CHAR_DELETED - Generated when a character has been deleted from an autocompletion list. - Valid event functions: none. @c wxEVT_STC_AUTOCOMP_COMPLETED - Generated after an autocompletion list has closed and inserted its text into the control. - Valid event functions: @link wxStyledTextEvent::GetKey GetKey@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetString GetString@endlink, @link wxStyledTextEvent::GetListCompletionMethod GetListCompletionMethod@endlink. @c wxEVT_STC_AUTOCOMP_SELECTION - Generated when an entry has been selected in an autocompletion list but before the text has been inserted. - To prevent the insertion, call @link wxStyledTextCtrl::AutoCompCancel wxStyledTextCtrl::AutoCompCancel@endlink in the event handler. - Valid event functions: @link wxStyledTextEvent::GetKey GetKey@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetString GetString@endlink, @link wxStyledTextEvent::GetListCompletionMethod GetListCompletionMethod@endlink. @c wxEVT_STC_AUTOCOMP_SELECTION_CHANGE - Generated when items are highlighted in an autocompletion or user list. - @link wxStyledTextEvent::GetPosition GetPosition@endlink will return the position at which the list is being shown. - For a user list, @link wxStyledTextEvent::GetListType GetListType@endlink will return the list type. The list type is a value input in to the @link wxStyledTextCtrl::UserListShow wxStyledTextCtrl::UserListShow@endlink method when a user list is created. - For an autocompletion list, @link wxStyledTextEvent::GetListType GetListType@endlink will always return zero. - Valid event functions: @link wxStyledTextEvent::GetListType GetListType@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetString GetString@endlink. @c wxEVT_STC_CALLTIP_CLICK - Generated when a calltip has been clicked. - @link wxStyledTextEvent::GetPosition GetPosition@endlink will return 1 if the up arrow has been clicked, 2 if the down arrow has been clicked, and 0 for all other clicks. - Valid event functions: @link wxStyledTextEvent::GetPosition GetPosition@endlink. @c wxEVT_STC_CHANGE - Generated when the text of the document has changed. - This an older style event and should probably not be used in new code. Use @c wxEVT_STC_MODIFIED instead. - Valid event functions: none. @c wxEVT_STC_CHARADDED - Generated when a character has been added to the control. - Valid event functions: @link wxStyledTextEvent::GetKey GetKey@endlink. @c wxEVT_STC_CLIPBOARD_COPY - Generated when text is being cut or copied to the clipboard. - Use wxStyledTextEvent::SetString() to modify the text that will be placed on the clipboard. - Valid event functions: @link wxStyledTextEvent::GetString GetString@endlink, @link wxStyledTextEvent::SetString SetString@endlink. @c wxEVT_STC_CLIPBOARD_PASTE - Generated when text is being pasted from the clipboard. - Use wxStyledTextEvent::SetString() to modify the text that will be inserted into the control. - Valid event functions: @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetString GetString@endlink, @link wxStyledTextEvent::SetString SetString@endlink. @c wxEVT_STC_DO_DROP - Generated when text is being dropped into the control. - Details of the drag may be altered by changing the respective fields of the event. - Valid event functions: @link wxStyledTextEvent::GetDragResult GetDragResult@endlink, @link wxStyledTextEvent::SetDragResult SetDragResult@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::SetPosition SetPosition@endlink, @link wxStyledTextEvent::GetString GetString@endlink, @link wxStyledTextEvent::SetString SetString@endlink, @link wxStyledTextEvent::GetX GetX@endlink, @link wxStyledTextEvent::GetY GetY@endlink. @c wxEVT_STC_DOUBLECLICK - Generated when the control has been double-clicked. - Valid event functions: @link wxStyledTextEvent::GetLine GetLine@endlink, @link wxStyledTextEvent::GetModifiers GetModifiers@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetAlt GetAlt@endlink, @link wxStyledTextEvent::GetControl GetControl@endlink, @link wxStyledTextEvent::GetShift GetShift@endlink. @c wxEVT_STC_DRAG_OVER - Generated repeatedly as text is being dragged inside the control. - Valid event functions: @link wxStyledTextEvent::GetDragResult GetDragResult@endlink, @link wxStyledTextEvent::SetDragResult SetDragResult@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetX GetX@endlink, @link wxStyledTextEvent::GetY GetY@endlink. @c wxEVT_STC_DWELLEND - Generated when the mouse has been moved after a @c wxEVT_STC_DWELLSTART event. - Valid event functions: @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetX GetX@endlink, @link wxStyledTextEvent::GetY GetY@endlink. @c wxEVT_STC_DWELLSTART - Generated when the mouse has remained still for a certain amount of time. - The amount of time can be specified with @link wxStyledTextCtrl::SetMouseDwellTime wxStyledTextCtrl::SetMouseDwellTime@endlink. - Valid event functions: @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetX GetX@endlink, @link wxStyledTextEvent::GetY GetY@endlink. @c wxEVT_STC_HOTSPOT_CLICK - Generated when a hotspot has been clicked. - Valid event functions: @link wxStyledTextEvent::GetModifiers GetModifiers@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetAlt GetAlt@endlink, @link wxStyledTextEvent::GetControl GetControl@endlink, @link wxStyledTextEvent::GetShift GetShift@endlink. @c wxEVT_STC_HOTSPOT_DCLICK - Generated when a hotspot has been double-clicked. - Valid event functions: @link wxStyledTextEvent::GetModifiers GetModifiers@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetAlt GetAlt@endlink, @link wxStyledTextEvent::GetControl GetControl@endlink, @link wxStyledTextEvent::GetShift GetShift@endlink. @c wxEVT_STC_HOTSPOT_RELEASE_CLICK - Generated when a click over a hotspot has been released. - Valid event functions: @link wxStyledTextEvent::GetModifiers GetModifiers@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetAlt GetAlt@endlink, @link wxStyledTextEvent::GetControl GetControl@endlink, @link wxStyledTextEvent::GetShift GetShift@endlink. @c wxEVT_STC_INDICATOR_CLICK - Generated when a indicator has been clicked. - Valid event functions: @link wxStyledTextEvent::GetModifiers GetModifiers@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetAlt GetAlt@endlink, @link wxStyledTextEvent::GetControl GetControl@endlink, @link wxStyledTextEvent::GetShift GetShift@endlink. @c wxEVT_STC_INDICATOR_RELEASE - Generated when a click over a indicator has been released. - Valid event functions: @link wxStyledTextEvent::GetModifiers GetModifiers@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetAlt GetAlt@endlink, @link wxStyledTextEvent::GetControl GetControl@endlink, @link wxStyledTextEvent::GetShift GetShift@endlink. @c wxEVT_STC_MACRORECORD - Generated while macro recording is in progress. - Valid event functions: @link wxStyledTextEvent::GetMessage GetMessage@endlink, @link wxStyledTextEvent::GetLParam GetLParam@endlink, @link wxStyledTextEvent::GetWParam GetWParam@endlink. @c wxEVT_STC_MARGIN_RIGHT_CLICK - Generated when one of the margins is clicked with the right mouse button. - This event is only generated if @link wxStyledTextCtrl::SetMarginSensitive SetMarginSensitive@endlink has been called for one or more of the margins. - Valid event functions: @link wxStyledTextEvent::GetMargin GetMargin@endlink, @link wxStyledTextEvent::GetModifiers GetModifiers@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetAlt GetAlt@endlink, @link wxStyledTextEvent::GetControl GetControl@endlink, @link wxStyledTextEvent::GetShift GetShift@endlink. @c wxEVT_STC_MARGINCLICK - Generated when one of the margins is clicked. - This event is only generated if @link wxStyledTextCtrl::SetMarginSensitive SetMarginSensitive@endlink has been called for one or more of the margins. - Valid event functions: @link wxStyledTextEvent::GetMargin GetMargin@endlink, @link wxStyledTextEvent::GetModifiers GetModifiers@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetAlt GetAlt@endlink, @link wxStyledTextEvent::GetControl GetControl@endlink, @link wxStyledTextEvent::GetShift GetShift@endlink. @c wxEVT_STC_MODIFIED - Generated when the contents of the control have changed or are about to change. - You should not attempt to make any changes to the control inside a handler for this event. - Valid event functions: @link wxStyledTextEvent::GetAnnotationsLinesAdded GetAnnotationsLinesAdded@endlink, @link wxStyledTextEvent::GetFoldLevelNow GetFoldLevelNow@endlink, @link wxStyledTextEvent::GetFoldLevelPrev GetFoldLevelPrev@endlink, @link wxStyledTextEvent::GetLength GetLength@endlink, @link wxStyledTextEvent::GetLine GetLine@endlink, @link wxStyledTextEvent::GetLinesAdded GetLinesAdded@endlink, @link wxStyledTextEvent::GetModificationType GetModificationType@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetString GetString@endlink, @link wxStyledTextEvent::GetToken GetToken@endlink. @c wxEVT_STC_NEEDSHOWN - Generated when certain lines should be made visible by scrolling the text in the control. - Valid event functions: @link wxStyledTextEvent::GetLength GetLength@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink. @c wxEVT_STC_PAINTED - Generated when the control has been refreshed. - Valid event functions: none. @c wxEVT_STC_ROMODIFYATTEMPT - Generated when an attempt has been made to change the control's text after it has been set read-only. - Valid event functions: none. @c wxEVT_STC_SAVEPOINTREACHED - Generated when the undo history has been made empty. - Valid event functions: none. @c wxEVT_STC_SAVEPOINTLEFT - Generated when the undo history is no longer empty. - Valid event functions: none. @c wxEVT_STC_START_DRAG - Generated when text is being dragged from the control. - Details of the drag may be altered by changing the respective fields of the event; in particular, set an empty string to prohibit the drag entirely. - Valid event functions: @link wxStyledTextEvent::GetDragFlags GetDragFlags@endlink, @link wxStyledTextEvent::SetDragFlags SetDragFlags@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetString GetString@endlink, @link wxStyledTextEvent::SetString SetString@endlink. @c wxEVT_STC_STYLENEEDED - Generated when the control has determined that style bytes should be set for a portion of the document. - These events are only sent if the lexer is set to @link wxStyledTextEvent::wxSTC_LEX_CONTAINER wxSTC_LEX_CONTAINER@endlink. - Valid event functions: @link wxStyledTextEvent::GetPosition GetPosition@endlink. @c wxEVT_STC_UPDATEUI - Generated when the text, style, cursor position, selection, or scrolling of the control has changed. - Valid event functions: @link wxStyledTextEvent::GetUpdated GetUpdated@endlink. @c wxEVT_STC_USERLISTSELECTION - Generated when a selection has been made from a user list. - Valid event functions: @link wxStyledTextEvent::GetListType GetListType@endlink, @link wxStyledTextEvent::GetPosition GetPosition@endlink, @link wxStyledTextEvent::GetString GetString@endlink, @link wxStyledTextEvent::GetKey GetKey@endlink, @link wxStyledTextEvent::GetListCompletionMethod GetListCompletionMethod@endlink. @c wxEVT_STC_ZOOM - Generated when the zoom factor of the control has been changed either by the user or a call to @link wxStyledTextCtrl::ZoomIn wxStyledTextCtrl::ZoomIn@endlink/@link wxStyledTextCtrl::ZoomOut ZoomOut@endlink. - Valid event functions: none. @library{wxstc} @category{events,stc} */ class wxStyledTextEvent : public wxCommandEvent { public: /** Constructor */ wxStyledTextEvent(wxEventType commandType=0, int id=0); /** Copy constructor */ wxStyledTextEvent(const wxStyledTextEvent& event); /** Destructor */ ~wxStyledTextEvent(); /** Returns true if the Alt key is pressed. This method is valid for the following event types: - @c wxEVT_STC_DOUBLECLICK - @c wxEVT_STC_MARGINCLICK - @c wxEVT_STC_HOTSPOT_CLICK - @c wxEVT_STC_HOTSPOT_DCLICK - @c wxEVT_STC_HOTSPOT_RELEASE_CLICK - @c wxEVT_STC_INDICATOR_CLICK - @c wxEVT_STC_INDICATOR_RELEASE - @c wxEVT_STC_MARGIN_RIGHT_CLICK */ bool GetAlt() const; /** Returns the number of lines that have been added to or removed from an annotation. This method is valid for @c wxEVT_STC_MODIFIED events when the result of GetModificationType() includes @link wxStyledTextEvent::wxSTC_MOD_CHANGEANNOTATION wxSTC_MOD_CHANGEANNOTATION@endlink. */ int GetAnnotationsLinesAdded() const; /** Returns true if the Control key is pressed. This method is valid for the following event types: - @c wxEVT_STC_DOUBLECLICK - @c wxEVT_STC_MARGINCLICK - @c wxEVT_STC_HOTSPOT_CLICK - @c wxEVT_STC_HOTSPOT_DCLICK - @c wxEVT_STC_HOTSPOT_RELEASE_CLICK - @c wxEVT_STC_INDICATOR_CLICK - @c wxEVT_STC_INDICATOR_RELEASE - @c wxEVT_STC_MARGIN_RIGHT_CLICK */ bool GetControl() const; /** Returns flags for the drag operation associated with this event. This method is valid for @c wxEVT_STC_START_DRAG events. */ int GetDragFlags(); /** Returns drag result for this event. This method is valid for @c wxEVT_STC_DRAG_OVER and @c wxEVT_STC_DO_DROP events. */ wxDragResult GetDragResult(); /** @deprecated Use GetString() instead. */ wxString GetDragText(); /** Returns the current fold level for the line. This method is valid for @c wxEVT_STC_MODIFIED events when the result of GetModificationType() includes @link wxStyledTextEvent::wxSTC_MOD_CHANGEFOLD wxSTC_MOD_CHANGEFOLD@endlink. */ int GetFoldLevelNow() const; /** Returns previous fold level for the line. This method is valid for @c wxEVT_STC_MODIFIED events when the result of GetModificationType() includes @link wxStyledTextEvent::wxSTC_MOD_CHANGEFOLD wxSTC_MOD_CHANGEFOLD@endlink. */ int GetFoldLevelPrev() const; /** Returns the key code of the key that generated this event. This method is valid for the following event types: - @c wxEVT_STC_CHARADDED - @c wxEVT_STC_USERLISTSELECTION - @c wxEVT_STC_AUTOCOMP_SELECTION - @c wxEVT_STC_AUTOCOMP_COMPLETED */ int GetKey() const; /** Returns the length (number of characters) of this event. This method is valid for @c wxEVT_STC_MODIFIED and @c wxEVT_STC_NEEDSHOWN events. */ int GetLength() const; /** Returns zero-based line number for this event. This method is valid for @c wxEVT_STC_DOUBLECLICK and @c wxEVT_STC_MODIFIED events. */ int GetLine() const; /** Returns the number of lines added or deleted with this event. This method is valid for @c wxEVT_STC_MODIFIED events when the result of GetModificationType() includes @link wxStyledTextEvent::wxSTC_MOD_INSERTTEXT wxSTC_MOD_INSERTTEXT @endlink or @link wxStyledTextEvent::wxSTC_MOD_DELETETEXT wxSTC_MOD_DELETETEXT@endlink. */ int GetLinesAdded() const; /** Returns a value describing the action that closed the list. The returned value will be one of the following constants:
@link wxStyledTextEvent::wxSTC_AC_FILLUP wxSTC_AC_FILLUP@endlink | A fillup character caused the completion. |
@link wxStyledTextEvent::wxSTC_AC_DOUBLECLICK wxSTC_AC_DOUBLECLICK@endlink | A double-click caused the completion. |
@link wxStyledTextEvent::wxSTC_AC_TAB wxSTC_AC_TAB@endlink | The tab key caused the completion. |
@link wxStyledTextEvent::wxSTC_AC_NEWLINE wxSTC_AC_NEWLINE@endlink | The enter key caused the completion. |
@link wxStyledTextEvent::wxSTC_AC_COMMAND wxSTC_AC_COMMAND@endlink | The @link wxStyledTextCtrl::AutoCompComplete wxStyledTextCtrl::AutoCompComplete@endlink method was called. |