X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/be698f50301674b969cacecc683ffac5ba6e2e16..e4277538a535d6d6c049f0b0ead9ed2b07cd93f2:/include/wx/stc/stc.h diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 6d17fd87ef..5bf0cc31de 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -21,8 +21,8 @@ #define __stc_h__ -#include -#include +#include "wx/wx.h" +#include "wx/dnd.h" #ifdef WXMAKINGDLL_STC @@ -204,6 +204,12 @@ #define wxSTC_TIME_FOREVER 10000000 #define wxSTC_WRAP_NONE 0 #define wxSTC_WRAP_WORD 1 +#define wxSTC_WRAPVISUALFLAG_NONE 0x0000 +#define wxSTC_WRAPVISUALFLAG_END 0x0001 +#define wxSTC_WRAPVISUALFLAG_START 0x0002 +#define wxSTC_WRAPVISUALFLAGLOC_DEFAULT 0x0000 +#define wxSTC_WRAPVISUALFLAGLOC_END_BY_TEXT 0x0001 +#define wxSTC_WRAPVISUALFLAGLOC_START_BY_TEXT 0x0002 #define wxSTC_CACHE_NONE 0 #define wxSTC_CACHE_CARET 1 #define wxSTC_CACHE_PAGE 2 @@ -349,6 +355,16 @@ #define wxSTC_LEX_FORTH 52 #define wxSTC_LEX_ERLANG 53 #define wxSTC_LEX_OCTAVE 54 +#define wxSTC_LEX_MSSQL 55 +#define wxSTC_LEX_VERILOG 56 +#define wxSTC_LEX_KIX 57 +#define wxSTC_LEX_GUI4CLI 58 +#define wxSTC_LEX_SPECMAN 59 +#define wxSTC_LEX_AU3 60 +#define wxSTC_LEX_APDL 61 +#define wxSTC_LEX_BASH 62 +#define wxSTC_LEX_ASN1 63 +#define wxSTC_LEX_VHDL 64 // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a // value assigned in sequence from SCLEX_AUTOMATIC+1. @@ -499,6 +515,9 @@ #define wxSTC_HP_OPERATOR 101 #define wxSTC_HP_IDENTIFIER 102 +// PHP +#define wxSTC_HPHP_COMPLEX_VARIABLE 104 + // ASP Python #define wxSTC_HPA_START 105 #define wxSTC_HPA_DEFAULT 106 @@ -572,6 +591,8 @@ #define wxSTC_B_KEYWORD2 10 #define wxSTC_B_KEYWORD3 11 #define wxSTC_B_KEYWORD4 12 +#define wxSTC_B_CONSTANT 13 +#define wxSTC_B_ASM 14 // Lexical states for SCLEX_PROPERTIES #define wxSTC_PROPS_DEFAULT 0 @@ -629,6 +650,8 @@ #define wxSTC_ERR_IFC 16 #define wxSTC_ERR_IFORT 17 #define wxSTC_ERR_ABSF 18 +#define wxSTC_ERR_TIDY 19 +#define wxSTC_ERR_JAVA_STACK 20 // Lexical states for SCLEX_BATCH #define wxSTC_BAT_DEFAULT 0 @@ -843,6 +866,7 @@ #define wxSTC_CSS_DIRECTIVE 12 #define wxSTC_CSS_DOUBLESTRING 13 #define wxSTC_CSS_SINGLESTRING 14 +#define wxSTC_CSS_IDENTIFIER2 15 // Lexical states for SCLEX_POV #define wxSTC_POV_DEFAULT 0 @@ -923,6 +947,7 @@ #define wxSTC_NSIS_IFDEFINEDEF 11 #define wxSTC_NSIS_MACRODEF 12 #define wxSTC_NSIS_STRINGVAR 13 +#define wxSTC_NSIS_NUMBER 14 // Lexical states for SCLEX_MMIXAL #define wxSTC_MMIXAL_LEADWS 0 @@ -1013,6 +1038,161 @@ #define wxSTC_ERLANG_NODE_NAME 13 #define wxSTC_ERLANG_UNKNOWN 31 +// Lexical states for SCLEX_OCTAVE are identical to MatLab +// Lexical states for SCLEX_MSSQL +#define wxSTC_MSSQL_DEFAULT 0 +#define wxSTC_MSSQL_COMMENT 1 +#define wxSTC_MSSQL_LINE_COMMENT 2 +#define wxSTC_MSSQL_NUMBER 3 +#define wxSTC_MSSQL_STRING 4 +#define wxSTC_MSSQL_OPERATOR 5 +#define wxSTC_MSSQL_IDENTIFIER 6 +#define wxSTC_MSSQL_VARIABLE 7 +#define wxSTC_MSSQL_COLUMN_NAME 8 +#define wxSTC_MSSQL_STATEMENT 9 +#define wxSTC_MSSQL_DATATYPE 10 +#define wxSTC_MSSQL_SYSTABLE 11 +#define wxSTC_MSSQL_GLOBAL_VARIABLE 12 +#define wxSTC_MSSQL_FUNCTION 13 +#define wxSTC_MSSQL_STORED_PROCEDURE 14 +#define wxSTC_MSSQL_DEFAULT_PREF_DATATYPE 15 +#define wxSTC_MSSQL_COLUMN_NAME_2 16 + +// Lexical states for SCLEX_VERILOG +#define wxSTC_V_DEFAULT 0 +#define wxSTC_V_COMMENT 1 +#define wxSTC_V_COMMENTLINE 2 +#define wxSTC_V_COMMENTLINEBANG 3 +#define wxSTC_V_NUMBER 4 +#define wxSTC_V_WORD 5 +#define wxSTC_V_STRING 6 +#define wxSTC_V_WORD2 7 +#define wxSTC_V_WORD3 8 +#define wxSTC_V_PREPROCESSOR 9 +#define wxSTC_V_OPERATOR 10 +#define wxSTC_V_IDENTIFIER 11 +#define wxSTC_V_STRINGEOL 12 +#define wxSTC_V_USER 19 + +// Lexical states for SCLEX_KIX +#define wxSTC_KIX_DEFAULT 0 +#define wxSTC_KIX_COMMENT 1 +#define wxSTC_KIX_STRING1 2 +#define wxSTC_KIX_STRING2 3 +#define wxSTC_KIX_NUMBER 4 +#define wxSTC_KIX_VAR 5 +#define wxSTC_KIX_MACRO 6 +#define wxSTC_KIX_KEYWORD 7 +#define wxSTC_KIX_FUNCTIONS 8 +#define wxSTC_KIX_OPERATOR 9 +#define wxSTC_KIX_IDENTIFIER 31 + +// Lexical states for SCLEX_GUI4CLI +#define wxSTC_GC_DEFAULT 0 +#define wxSTC_GC_COMMENTLINE 1 +#define wxSTC_GC_COMMENTBLOCK 2 +#define wxSTC_GC_GLOBAL 3 +#define wxSTC_GC_EVENT 4 +#define wxSTC_GC_ATTRIBUTE 5 +#define wxSTC_GC_CONTROL 6 +#define wxSTC_GC_COMMAND 7 +#define wxSTC_GC_STRING 8 +#define wxSTC_GC_OPERATOR 9 + +// Lexical states for SCLEX_SPECMAN +#define wxSTC_SN_DEFAULT 0 +#define wxSTC_SN_CODE 1 +#define wxSTC_SN_COMMENTLINE 2 +#define wxSTC_SN_COMMENTLINEBANG 3 +#define wxSTC_SN_NUMBER 4 +#define wxSTC_SN_WORD 5 +#define wxSTC_SN_STRING 6 +#define wxSTC_SN_WORD2 7 +#define wxSTC_SN_WORD3 8 +#define wxSTC_SN_PREPROCESSOR 9 +#define wxSTC_SN_OPERATOR 10 +#define wxSTC_SN_IDENTIFIER 11 +#define wxSTC_SN_STRINGEOL 12 +#define wxSTC_SN_REGEXTAG 13 +#define wxSTC_SN_SIGNAL 14 +#define wxSTC_SN_USER 19 + +// Lexical states for SCLEX_AU3 +#define wxSTC_AU3_DEFAULT 0 +#define wxSTC_AU3_COMMENT 1 +#define wxSTC_AU3_COMMENTBLOCK 2 +#define wxSTC_AU3_NUMBER 3 +#define wxSTC_AU3_FUNCTION 4 +#define wxSTC_AU3_KEYWORD 5 +#define wxSTC_AU3_MACRO 6 +#define wxSTC_AU3_STRING 7 +#define wxSTC_AU3_OPERATOR 8 +#define wxSTC_AU3_VARIABLE 9 +#define wxSTC_AU3_SENT 10 +#define wxSTC_AU3_PREPROCESSOR 11 +#define wxSTC_AU3_SPECIAL 12 + +// Lexical states for SCLEX_APDL +#define wxSTC_APDL_DEFAULT 0 +#define wxSTC_APDL_COMMENT 1 +#define wxSTC_APDL_COMMENTBLOCK 2 +#define wxSTC_APDL_NUMBER 3 +#define wxSTC_APDL_STRING 4 +#define wxSTC_APDL_OPERATOR 5 +#define wxSTC_APDL_WORD 6 +#define wxSTC_APDL_PROCESSOR 7 +#define wxSTC_APDL_COMMAND 8 +#define wxSTC_APDL_SLASHCOMMAND 9 +#define wxSTC_APDL_STARCOMMAND 10 +#define wxSTC_APDL_ARGUMENT 11 +#define wxSTC_APDL_FUNCTION 12 + +// Lexical states for SCLEX_BASH +#define wxSTC_SH_DEFAULT 0 +#define wxSTC_SH_ERROR 1 +#define wxSTC_SH_COMMENTLINE 2 +#define wxSTC_SH_NUMBER 3 +#define wxSTC_SH_WORD 4 +#define wxSTC_SH_STRING 5 +#define wxSTC_SH_CHARACTER 6 +#define wxSTC_SH_OPERATOR 7 +#define wxSTC_SH_IDENTIFIER 8 +#define wxSTC_SH_SCALAR 9 +#define wxSTC_SH_PARAM 10 +#define wxSTC_SH_BACKTICKS 11 +#define wxSTC_SH_HERE_DELIM 12 +#define wxSTC_SH_HERE_Q 13 + +// Lexical states for SCLEX_ASN1 +#define wxSTC_ASN1_DEFAULT 0 +#define wxSTC_ASN1_COMMENT 1 +#define wxSTC_ASN1_IDENTIFIER 2 +#define wxSTC_ASN1_STRING 3 +#define wxSTC_ASN1_OID 4 +#define wxSTC_ASN1_SCALAR 5 +#define wxSTC_ASN1_KEYWORD 6 +#define wxSTC_ASN1_ATTRIBUTE 7 +#define wxSTC_ASN1_DESCRIPTOR 8 +#define wxSTC_ASN1_TYPE 9 +#define wxSTC_ASN1_OPERATOR 10 + +// Lexical states for SCLEX_VHDL +#define wxSTC_VHDL_DEFAULT 0 +#define wxSTC_VHDL_COMMENT 1 +#define wxSTC_VHDL_COMMENTLINEBANG 2 +#define wxSTC_VHDL_NUMBER 3 +#define wxSTC_VHDL_STRING 4 +#define wxSTC_VHDL_OPERATOR 5 +#define wxSTC_VHDL_IDENTIFIER 6 +#define wxSTC_VHDL_STRINGEOL 7 +#define wxSTC_VHDL_KEYWORD 8 +#define wxSTC_VHDL_STDOPERATOR 9 +#define wxSTC_VHDL_ATTRIBUTE 10 +#define wxSTC_VHDL_STDFUNCTION 11 +#define wxSTC_VHDL_STDPACKAGE 12 +#define wxSTC_VHDL_STDTYPE 13 +#define wxSTC_VHDL_USERWORD 14 + //----------------------------------------- // Commands that can be bound to keystrokes @@ -1311,26 +1491,26 @@ public: %pythonAppend wxStyledTextCtrl "self._setOORInfo(self)" %pythonAppend wxStyledTextCtrl() "" - wxStyledTextCtrl(wxWindow *parent, wxWindowID id, + wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPySTCNameStr); - %name(PreStyledTextCtrl) wxStyledTextCtrl(); - + %RenameCtor(PreStyledTextCtrl, wxStyledTextCtrl()); + #else - wxStyledTextCtrl(wxWindow *parent, wxWindowID id, + wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxSTCNameStr); wxStyledTextCtrl() { m_swx = NULL; } ~wxStyledTextCtrl(); - + #endif - void Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = wxSTCNameStr); + bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, long style = 0, + const wxString& name = wxSTCNameStr); //---------------------------------------------------------------------- @@ -1339,7 +1519,7 @@ public: // and regenerate - // Add text to the document. + // Add text to the document at current position. void AddText(const wxString& text); // Add array of cells to document. @@ -1354,7 +1534,7 @@ public: // Set all style bytes to 0, remove all folding information. void ClearDocumentStyle(); - // The number of characters in the document. + // Returns the number of characters in the document. int GetLength(); // Returns the character byte at the position. @@ -1556,9 +1736,6 @@ public: // Set a style to be mixed case, or to force upper or lower case. void StyleSetCase(int style, int caseForce); - // Set the character set of the font in a style. - void StyleSetCharacterSet(int style, int characterSet); - // Set a style to be a hotspot or not. void StyleSetHotSpot(int style, bool hotspot); @@ -2071,6 +2248,24 @@ public: // Retrieve whether text is word wrapped. int GetWrapMode(); + // Set the display mode of visual flags for wrapped lines. + void SetWrapVisualFlags(int wrapVisualFlags); + + // Retrive the display mode of visual flags for wrapped lines. + int GetWrapVisualFlags(); + + // Set the location of visual flags for wrapped lines. + void SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation); + + // Retrive the location of visual flags for wrapped lines. + int GetWrapVisualFlagsLocation(); + + // Set the start indent for wrapped lines. + void SetWrapStartIndent(int indent); + + // Retrive the start indent for wrapped lines. + int GetWrapStartIndent(); + // Sets the degree of caching of layout information. void SetLayoutCache(int mode); @@ -2107,7 +2302,7 @@ public: bool GetUseVerticalScrollBar(); // Append a string to the end of the document without changing the selection. - void AppendText(int length, const wxString& text); + void AppendText(const wxString& text); // Is drawing done in two phases with backgrounds drawn before foregrounds? bool GetTwoPhaseDraw(); @@ -2575,6 +2770,13 @@ public: // Get currently selected item position in the auto-completion list int AutoCompGetCurrent(); + // Enlarge the document to a particular size of text bytes. + void Allocate(int bytes); + + // Find the position of a column on a line taking into account tabs and + // multi-byte characters. If beyond end of line, return line end position. + int FindColumn(int line, int column); + // Start notifying the container of all key presses and commands. void StartRecord(); @@ -2612,8 +2814,8 @@ public: // // bold turns on bold // italic turns on italics - // fore:#RRGGBB sets the foreground colour - // back:#RRGGBB sets the background colour + // 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 @@ -2633,15 +2835,22 @@ public: void StyleSetFontAttr(int styleNum, int size, const wxString& faceName, bool bold, bool italic, - bool underline); + bool underline, + wxFontEncoding encoding=wxFONTENCODING_DEFAULT); + // Set the character set of the font in a style. Converts the Scintilla + // character set values to a wxFontEncoding. + void StyleSetCharacterSet(int style, int characterSet); + + // 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); @@ -2670,11 +2879,11 @@ public: // Set the vertical scrollbar to use instead of the ont that's built-in. - void SetVScrollBar(wxScrollBar* bar) { m_vScrollBar = bar; } + void SetVScrollBar(wxScrollBar* bar); // Set the horizontal scrollbar to use instead of the ont that's built-in. - void SetHScrollBar(wxScrollBar* bar) { m_hScrollBar = bar; } + void SetHScrollBar(wxScrollBar* bar); // Can be used to prevent the EVT_CHAR handler from adding the char bool GetLastKeydownProcessed() { return m_lastKeyDownConsumed; } @@ -2688,7 +2897,7 @@ public: #ifdef STC_USE_DND // Allow for simulating a DnD DragOver - wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def); + wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def); // Allow for simulating a DnD DropText bool DoDropText(long x, long y, const wxString& data); @@ -2701,13 +2910,55 @@ public: // Returns the current UseAntiAliasing setting. bool GetUseAntiAliasing(); + + + // The following methods are nearly equivallent to their similarly named + // cousins above. The difference is that these methods bypass wxString + // and always use a char* even if used in a unicode build of wxWidgets. + // In that case the character data will be utf-8 encoded since that is + // what is used internally by Scintilla in unicode builds. + + // Add text to the document at current position. + void AddTextRaw(const char* text); + + // 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. +#ifdef SWIG + wxCharBuffer GetCurLineRaw(int* OUTPUT); +#else + wxCharBuffer GetCurLineRaw(int* linePos=NULL); +#endif + + // Retrieve the contents of a line. + wxCharBuffer GetLineRaw(int line); + // Retrieve the selected text. + wxCharBuffer GetSelectedTextRaw(); + + // 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); + +#ifdef SWIG + %pythoncode "_stc_utf8_methods.py" +#endif //---------------------------------------------------------------------- #ifndef SWIG -private: +protected: // Event handlers void OnPaint(wxPaintEvent& evt); void OnScrollWin(wxScrollWinEvent& evt); @@ -2729,12 +2980,14 @@ private: void OnMenu(wxCommandEvent& evt); void OnListBox(wxCommandEvent& evt); void OnIdle(wxIdleEvent& evt); - + + virtual wxSize DoGetBestSize() const; // Turn notifications from Scintilla into events void NotifyChange(); void NotifyParent(SCNotification* scn); +private: DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxStyledTextCtrl) @@ -2914,31 +3167,31 @@ END_DECLARE_EVENT_TYPES() #ifndef SWIG typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&); -#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_STC_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), #endif @@ -2946,36 +3199,26 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&); // Utility functions used within wxSTC #ifndef SWIG +#if wxUSE_UNICODE + +WXDLLIMPEXP_STC wxString stc2wx(const char* str); +WXDLLIMPEXP_STC wxString stc2wx(const char* str, size_t len); +WXDLLIMPEXP_STC const wxWX2MBbuf wx2stc(const wxString& str); + +#else // not UNICODE inline wxString stc2wx(const char* str) { -#if wxUSE_UNICODE - return wxString(str, wxConvUTF8); -#else return wxString(str); -#endif } - -#if wxUSE_UNICODE -wxString stc2wx(const char* str, size_t len); -#else inline wxString stc2wx(const char* str, size_t len) { return wxString(str, len); } -#endif - - -#if wxUSE_UNICODE -inline const wxWX2MBbuf wx2stc(const wxString& str) { - return str.mb_str(wxConvUTF8); -} -#else inline const wxWX2MBbuf wx2stc(const wxString& str) { return str.mbc_str(); } -#endif - -#endif +#endif // UNICODE +#endif // SWIG //---------------------------------------------------------------------- #endif