#include <wx/wx.h>
+#include <wx/dnd.h>
//----------------------------------------------------------------------
// BEGIN generated section. The following code is automatically generated
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,
// Scroll enough to make the given column visible
void ScrollToColumn(int column);
+
+ // Send a message to Scintilla
+ long SendMsg(int msg, long wp=0, long lp=0);
+
//----------------------------------------------------------------------
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 OnKeyDown(wxKeyEvent& evt);
void OnLoseFocus(wxFocusEvent& evt);
void NotifyChange();
void NotifyParent(SCNotification* scn);
- long SendMsg(int msg, long wp=0, long lp=0);
private:
DECLARE_EVENT_TABLE()
ScintillaWX* m_swx;
wxStopWatch m_stopWatch;
+ bool m_lastKeyDownConsumed;
friend class ScintillaWX;
friend class Platform;
wxStyledTextEvent(wxEventType commandType=0, int id=0);
~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 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; }
+#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
+ void SetDragText(const wxString& val) { m_dragText = val; }
+ void SetDragAllowMove(bool val) { m_dragAllowMove = val; }
+ void SetDragResult(wxDragResult val) { m_dragResult = val; }
+#endif
int GetPosition() const { return m_position; }
int GetKey() const { return m_key; }
int GetMessage() const { return m_message; }
int GetWParam() const { return m_wParam; }
int GetLParam() const { return m_lParam; }
+ int GetListType() const { return m_listType; }
+ int GetX() const { return m_x; }
+ int GetY() const { return m_y; }
+#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
+ wxString GetDragText() { return m_dragText; }
+ bool GetDragAllowMove() { return m_dragAllowMove; }
+ wxDragResult GetDragResult() { return m_dragResult; }
+#endif
bool GetShift() const;
bool GetControl() const;
int m_message; // wxEVT_STC_MACRORECORD
int m_wParam;
int m_lParam;
+
+ int m_listType;
+ int m_x;
+ int m_y;
+
+#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
+ 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
#endif
};
+#ifndef SWIG
+BEGIN_DECLARE_EVENT_TYPES()
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHANGE, 1650)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_STYLENEEDED, 1651)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHARADDED, 1652)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTREACHED, 1653)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTLEFT, 1654)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ROMODIFYATTEMPT, 1655)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_KEY, 1656)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DOUBLECLICK, 1657)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_UPDATEUI, 1658)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MODIFIED, 1659)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MACRORECORD, 1660)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MARGINCLICK, 1661)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_NEEDSHOWN, 1662)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_POSCHANGED, 1663)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_PAINTED, 1664)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_USERLISTSELECTION, 1665)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED, 1666)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART, 1667)
+ DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLEND, 1668)
+#if wxUSE_DRAG_AND_DROP
+ 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)
+#endif
+END_DECLARE_EVENT_TYPES()
+#else
+ enum {
+ wxEVT_STC_CHANGE,
+ wxEVT_STC_STYLENEEDED,
+ wxEVT_STC_CHARADDED,
+ wxEVT_STC_SAVEPOINTREACHED,
+ wxEVT_STC_SAVEPOINTLEFT,
+ wxEVT_STC_ROMODIFYATTEMPT,
+ wxEVT_STC_KEY,
+ wxEVT_STC_DOUBLECLICK,
+ wxEVT_STC_UPDATEUI,
+ wxEVT_STC_MODIFIED,
+ wxEVT_STC_MACRORECORD,
+ wxEVT_STC_MARGINCLICK,
+ wxEVT_STC_NEEDSHOWN,
+ wxEVT_STC_POSCHANGED,
+ wxEVT_STC_PAINTED,
+ wxEVT_STC_USERLISTSELECTION,
+ wxEVT_STC_URIDROPPED,
+ wxEVT_STC_DWELLSTART,
+ wxEVT_STC_DWELLEND,
+#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
+ wxEVT_STC_START_DRAG,
+ wxEVT_STC_DRAG_OVER,
+ wxEVT_STC_DO_DROP,
+#endif
+ };
+#endif
-// Event types
-enum {
- wxEVT_STC_CHANGE = 1650,
- wxEVT_STC_STYLENEEDED,
- wxEVT_STC_CHARADDED,
- wxEVT_STC_UPDATEUI,
- wxEVT_STC_SAVEPOINTREACHED,
- wxEVT_STC_SAVEPOINTLEFT,
- wxEVT_STC_ROMODIFYATTEMPT,
- wxEVT_STC_DOUBLECLICK,
- wxEVT_STC_MODIFIED,
- wxEVT_STC_KEY,
- wxEVT_STC_MACRORECORD,
- wxEVT_STC_MARGINCLICK,
- wxEVT_STC_NEEDSHOWN,
- wxEVT_STC_POSCHANGED
-};
#ifndef SWIG
typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
-#define EVT_STC_CHANGE(id, fn) { wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
-#define EVT_STC_STYLENEEDED(id, fn) { wxEVT_STC_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
-#define EVT_STC_CHARADDED(id, fn) { wxEVT_STC_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
-#define EVT_STC_UPDATEUI(id, fn) { wxEVT_STC_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
-#define EVT_STC_SAVEPOINTREACHED(id, fn) { wxEVT_STC_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
-#define EVT_STC_SAVEPOINTLEFT(id, fn) { wxEVT_STC_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
-#define EVT_STC_ROMODIFYATTEMPT(id, fn) { wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
-#define EVT_STC_DOUBLECLICK(id, fn) { wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
-#define EVT_STC_MODIFIED(id, fn) { wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
-#define EVT_STC_KEY(id, fn) { wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
-#define EVT_STC_MACRORECORD(id, fn) { wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
-#define EVT_STC_MARGINCLICK(id, fn) { wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
-#define EVT_STC_NEEDSHOWN(id, fn) { wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
-#define EVT_STC_POSCHANGED(id, fn) { wxEVT_STC_POSCHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
-
+#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_POSCHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_POSCHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
+#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 ),
+#if wxUSE_DRAG_AND_DROP
+#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
#endif
//----------------------------------------------------------------------