#include <wx/wx.h>
+#include <wx/dnd.h>
//----------------------------------------------------------------------
// BEGIN generated section. The following code is automatically generated
#define wxSTC_MARK_CIRCLEPLUSCONNECTED 19
#define wxSTC_MARK_CIRCLEMINUS 20
#define wxSTC_MARK_CIRCLEMINUSCONNECTED 21
+#define wxSTC_MARK_CHARACTER 10000
// Markers used for outlining column
#define wxSTC_MARKNUM_FOLDEREND 25
#define wxSTC_MARKNUM_FOLDEROPEN 31
#define wxSTC_MARGIN_SYMBOL 0
#define wxSTC_MARGIN_NUMBER 1
+
+// Styles in range 32..37 are predefined for parts of the UI and are not used as normal styles.
+// Styles 38 and 39 are for future use.
#define wxSTC_STYLE_DEFAULT 32
#define wxSTC_STYLE_LINENUMBER 33
#define wxSTC_STYLE_BRACELIGHT 34
#define wxSTC_STYLE_BRACEBAD 35
#define wxSTC_STYLE_CONTROLCHAR 36
#define wxSTC_STYLE_INDENTGUIDE 37
+#define wxSTC_STYLE_LASTPREDEFINED 39
#define wxSTC_STYLE_MAX 127
// Character set identifiers are used in StyleSetCharacterSet.
#define wxSTC_LEX_EIFFEL 23
#define wxSTC_LEX_EIFFELKW 24
#define wxSTC_LEX_TCL 25
+#define wxSTC_LEX_NNCRONTAB 26
// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
// value assigned in sequence from SCLEX_AUTOMATIC+1.
#define wxSTC_C_REGEX 14
#define wxSTC_C_COMMENTLINEDOC 15
#define wxSTC_C_WORD2 16
+#define wxSTC_C_COMMENTDOCKEYWORD 17
+#define wxSTC_C_COMMENTDOCKEYWORDERROR 18
// Lexical states for SCLEX_HTML, SCLEX_XML
#define wxSTC_H_DEFAULT 0
#define wxSTC_H_XCCOMMENT 20
// SGML
-#define wxSTC_H_SGML 21
+#define wxSTC_H_SGML_DEFAULT 21
+#define wxSTC_H_SGML_COMMAND 22
+#define wxSTC_H_SGML_1ST_PARAM 23
+#define wxSTC_H_SGML_DOUBLESTRING 24
+#define wxSTC_H_SGML_SIMPLESTRING 25
+#define wxSTC_H_SGML_ERROR 26
+#define wxSTC_H_SGML_SPECIAL 27
+#define wxSTC_H_SGML_ENTITY 28
+#define wxSTC_H_SGML_COMMENT 29
+#define wxSTC_H_SGML_1ST_PARAM_COMMENT 30
+#define wxSTC_H_SGML_BLOCK_DEFAULT 31
// Embedded Javascript
#define wxSTC_HJ_START 40
#define wxSTC_EIFFEL_IDENTIFIER 7
#define wxSTC_EIFFEL_STRINGEOL 8
+// Lexical states for the SCLEX_NNCRONTAB (nnCron crontab Lexer)
+#define wxSTC_NNCRONTAB_DEFAULT 0
+#define wxSTC_NNCRONTAB_COMMENT 1
+#define wxSTC_NNCRONTAB_TASK 2
+#define wxSTC_NNCRONTAB_SECTION 3
+#define wxSTC_NNCRONTAB_KEYWORD 4
+#define wxSTC_NNCRONTAB_MODIFIER 5
+#define wxSTC_NNCRONTAB_ASTERISK 6
+#define wxSTC_NNCRONTAB_NUMBER 7
+#define wxSTC_NNCRONTAB_STRING 8
+#define wxSTC_NNCRONTAB_ENVIRONMENT 9
+#define wxSTC_NNCRONTAB_IDENTIFIER 10
+
// END of generated section
//----------------------------------------------------------------------
// Others
-#define wxSTC_MASK_FOLDERS ((1 << wxSTC_MARKNUM_FOLDER) | (1 << wxSTC_MARKNUM_FOLDEROPEN))
+#define wxSTC_MASK_FOLDERS ((1 << wxSTC_MARKNUM_FOLDER) | \
+ (1 << wxSTC_MARKNUM_FOLDEROPEN) | \
+ (1 << wxSTC_MARKNUM_FOLDERSUB) | \
+ (1 << wxSTC_MARKNUM_FOLDERTAIL) | \
+ (1 << wxSTC_MARKNUM_FOLDERMIDTAIL) | \
+ (1 << wxSTC_MARKNUM_FOLDEROPENMID) | \
+ (1 << wxSTC_MARKNUM_FOLDEREND))
+
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const char* name = "styledtext");
+ %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
+
#else
wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
int GetTargetEnd();
// Replace the target text with the argument text.
+ // Text is counted so it can contain nulls.
// Returns the length of the replacement text.
int ReplaceTarget(const wxString& text);
// Replace the target text with the argument text after \d processing.
+ // Text is counted so it can contain nulls.
// Looks for \d where d is between 1 and 9 and replaces these with the strings
// matched in the last search operation which were surrounded by \( and \).
// Returns the length of the replacement text including any change
int ReplaceTargetRE(const wxString& text);
// Search for a counted string in the target and set the target to the found
- // range.
+ // range. Text is counted so it can contain nulls.
// Returns length of range or -1 for failure in which case target is not moved.
int SearchInTarget(const wxString& text);
// Send a message to Scintilla
long SendMsg(int msg, long wp=0, long lp=0);
+
+ // Set the vertical scrollbar to use instead of the ont that's built-in.
+ void SetVScrollBar(wxScrollBar* bar) { m_vScrollBar = bar; }
+
+
+ // Set the horizontal scrollbar to use instead of the ont that's built-in.
+ void SetHScrollBar(wxScrollBar* bar) { m_hScrollBar = bar; }
+
//----------------------------------------------------------------------
// Event handlers
void OnPaint(wxPaintEvent& evt);
void OnScrollWin(wxScrollWinEvent& evt);
+ void OnScroll(wxScrollEvent& evt);
void OnSize(wxSizeEvent& evt);
void OnMouseLeftDown(wxMouseEvent& evt);
void OnMouseMove(wxMouseEvent& evt);
void OnMouseLeftUp(wxMouseEvent& evt);
+ void OnMouseRightUp(wxMouseEvent& evt);
void OnContextMenu(wxContextMenuEvent& evt);
void OnMouseWheel(wxMouseEvent& evt);
void OnChar(wxKeyEvent& evt);
void NotifyChange();
void NotifyParent(SCNotification* scn);
+
private:
DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxStyledTextCtrl)
ScintillaWX* m_swx;
wxStopWatch m_stopWatch;
+ wxScrollBar* m_vScrollBar;
+ wxScrollBar* m_hScrollBar;
+ bool m_lastKeyDownConsumed;
friend class ScintillaWX;
friend class Platform;
class wxStyledTextEvent : public wxCommandEvent {
public:
wxStyledTextEvent(wxEventType commandType=0, int id=0);
+#ifndef SWIG
+ wxStyledTextEvent(const wxStyledTextEvent& event);
+#endif
~wxStyledTextEvent() {}
- void SetPosition(int pos) { m_position = pos; }
- void SetKey(int k) { m_key = k; }
- void SetModifiers(int m) { m_modifiers = m; }
- void SetModificationType(int t) { m_modificationType = t; }
- void SetText(const char* t) { m_text = t; }
- void SetLength(int len) { m_length = len; }
- void SetLinesAdded(int num) { m_linesAdded = num; }
- void SetLine(int val) { m_line = val; }
- void SetFoldLevelNow(int val) { m_foldLevelNow = val; }
- void SetFoldLevelPrev(int val) { m_foldLevelPrev = val; }
- void SetMargin(int val) { m_margin = val; }
- void SetMessage(int val) { m_message = val; }
- void SetWParam(int val) { m_wParam = val; }
- void SetLParam(int val) { m_lParam = val; }
- void SetListType(int val) { m_listType = val; }
- void SetX(int val) { m_x = val; }
- void SetY(int val) { m_y = val; }
+ void SetPosition(int pos) { m_position = pos; }
+ void SetKey(int k) { m_key = k; }
+ void SetModifiers(int m) { m_modifiers = m; }
+ void SetModificationType(int t) { m_modificationType = t; }
+ void SetText(const char* t) { m_text = t; }
+ void SetLength(int len) { m_length = len; }
+ void SetLinesAdded(int num) { m_linesAdded = num; }
+ void SetLine(int val) { m_line = val; }
+ void SetFoldLevelNow(int val) { m_foldLevelNow = val; }
+ void SetFoldLevelPrev(int val) { m_foldLevelPrev = val; }
+ void SetMargin(int val) { m_margin = val; }
+ void SetMessage(int val) { m_message = val; }
+ void SetWParam(int val) { m_wParam = val; }
+ void SetLParam(int val) { m_lParam = val; }
+ void SetListType(int val) { m_listType = val; }
+ void SetX(int val) { m_x = val; }
+ void SetY(int val) { m_y = val; }
+ void SetDragText(const wxString& val) { m_dragText = val; }
+ void SetDragAllowMove(bool val) { m_dragAllowMove = val; }
+ void SetDragResult(wxDragResult val) { m_dragResult = val; }
int GetPosition() const { return m_position; }
int GetKey() const { return m_key; }
int GetListType() const { return m_listType; }
int GetX() const { return m_x; }
int GetY() const { return m_y; }
+ wxString GetDragText() { return m_dragText; }
+ bool GetDragAllowMove() { return m_dragAllowMove; }
+ wxDragResult GetDragResult() { return m_dragResult; }
bool GetShift() const;
bool GetControl() const;
bool GetAlt() const;
- void CopyObject(wxObject& obj) const;
+ virtual wxEvent* Clone() const { return new wxStyledTextEvent(*this); }
#ifndef SWIG
private:
int m_listType;
int m_x;
int m_y;
+
+ wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
+ bool m_dragAllowMove; // wxEVT_STC_START_DRAG
+
+ wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
#endif
};
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED, 1666)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART, 1667)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLEND, 1668)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_START_DRAG, 1669)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
END_DECLARE_EVENT_TYPES()
#else
enum {
wxEVT_STC_URIDROPPED,
wxEVT_STC_DWELLSTART,
wxEVT_STC_DWELLEND,
+ wxEVT_STC_START_DRAG,
+ wxEVT_STC_DRAG_OVER,
+ wxEVT_STC_DO_DROP,
};
#endif
#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
-
-
+#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
#endif
//----------------------------------------------------------------------