Added DnD related events to wxSTC
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12156 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/dnd.h>
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// BEGIN generated section. The following code is automatically generated
|
||||
@@ -1621,6 +1622,7 @@ private:
|
||||
void NotifyChange();
|
||||
void NotifyParent(SCNotification* scn);
|
||||
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_CLASS(wxStyledTextCtrl)
|
||||
@@ -1659,6 +1661,9 @@ public:
|
||||
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; }
|
||||
@@ -1677,6 +1682,9 @@ public:
|
||||
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;
|
||||
@@ -1709,6 +1717,11 @@ 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
|
||||
};
|
||||
|
||||
@@ -1733,6 +1746,9 @@ BEGIN_DECLARE_EVENT_TYPES()
|
||||
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 {
|
||||
@@ -1755,6 +1771,9 @@ END_DECLARE_EVENT_TYPES()
|
||||
wxEVT_STC_URIDROPPED,
|
||||
wxEVT_STC_DWELLSTART,
|
||||
wxEVT_STC_DWELLEND,
|
||||
wxEVT_STC_START_DRAG,
|
||||
wxEVT_STC_DRAG_OVER,
|
||||
wxEVT_STC_DO_DROP,
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1782,7 +1801,9 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
|
||||
#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
|
||||
|
||||
|
@@ -121,18 +121,32 @@ void ScintillaWX::Finalise() {
|
||||
|
||||
|
||||
void ScintillaWX::StartDrag() {
|
||||
wxString dragText(drag.s, drag.len);
|
||||
|
||||
// Send an event to allow the drag text to be changed
|
||||
wxStyledTextEvent evt(wxEVT_STC_START_DRAG, stc->GetId());
|
||||
evt.SetEventObject(stc);
|
||||
evt.SetDragText(dragText);
|
||||
evt.SetDragAllowMove(TRUE);
|
||||
evt.SetPosition(wxMin(stc->GetSelectionStart(),
|
||||
stc->GetSelectionEnd()));
|
||||
stc->GetEventHandler()->ProcessEvent(evt);
|
||||
dragText = evt.GetDragText();
|
||||
|
||||
if (dragText.Length()) {
|
||||
wxDropSource source(wMain.GetID());
|
||||
wxTextDataObject data(wxString(drag.s, drag.len));
|
||||
wxTextDataObject data(dragText);
|
||||
wxDragResult result;
|
||||
|
||||
dropWentOutside = true;
|
||||
source.SetData(data);
|
||||
result = source.DoDragDrop(TRUE);
|
||||
dropWentOutside = TRUE;
|
||||
result = source.DoDragDrop(evt.GetDragAllowMove());
|
||||
if (result == wxDragMove && dropWentOutside)
|
||||
ClearSelection();
|
||||
inDragDrop = FALSE;
|
||||
SetDragPosition(invalidPosition);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ScintillaWX::SetTicking(bool on) {
|
||||
@@ -489,10 +503,27 @@ void ScintillaWX::DoOnListBox() {
|
||||
|
||||
bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
|
||||
SetDragPosition(invalidPosition);
|
||||
int movePos = PositionFromLocation(Point(x,y));
|
||||
DropAt(movePos, data, dragResult == wxDragMove, FALSE); // TODO: rectangular?
|
||||
|
||||
// Send an event to allow the drag details to be changed
|
||||
wxStyledTextEvent evt(wxEVT_STC_DO_DROP, stc->GetId());
|
||||
evt.SetEventObject(stc);
|
||||
evt.SetDragResult(dragResult);
|
||||
evt.SetX(x);
|
||||
evt.SetY(y);
|
||||
evt.SetPosition(PositionFromLocation(Point(x,y)));
|
||||
evt.SetDragText(data);
|
||||
stc->GetEventHandler()->ProcessEvent(evt);
|
||||
|
||||
dragResult = evt.GetDragResult();
|
||||
if (dragResult == wxDragMove || dragResult == wxDragCopy) {
|
||||
DropAt(evt.GetPosition(),
|
||||
evt.GetDragText(),
|
||||
dragResult == wxDragMove,
|
||||
FALSE); // TODO: rectangular?
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
wxDragResult ScintillaWX::DoDragEnter(wxCoord x, wxCoord y, wxDragResult def) {
|
||||
@@ -503,7 +534,17 @@ wxDragResult ScintillaWX::DoDragEnter(wxCoord x, wxCoord y, wxDragResult def) {
|
||||
|
||||
wxDragResult ScintillaWX::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) {
|
||||
SetDragPosition(PositionFromLocation(Point(x, y)));
|
||||
dragResult = def;
|
||||
|
||||
// Send an event to allow the drag result to be changed
|
||||
wxStyledTextEvent evt(wxEVT_STC_DRAG_OVER, stc->GetId());
|
||||
evt.SetEventObject(stc);
|
||||
evt.SetDragResult(def);
|
||||
evt.SetX(x);
|
||||
evt.SetY(y);
|
||||
evt.SetPosition(PositionFromLocation(Point(x,y)));
|
||||
stc->GetEventHandler()->ProcessEvent(evt);
|
||||
|
||||
dragResult = evt.GetDragResult();
|
||||
return dragResult;
|
||||
}
|
||||
|
||||
|
@@ -93,8 +93,9 @@ DEFINE_EVENT_TYPE( wxEVT_STC_USERLISTSELECTION )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
|
||||
|
||||
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
||||
@@ -1914,6 +1915,7 @@ void wxStyledTextCtrl::OnListBox(wxCommandEvent& evt) {
|
||||
|
||||
void wxStyledTextCtrl::NotifyChange() {
|
||||
wxStyledTextEvent evt(wxEVT_STC_CHANGE, GetId());
|
||||
evt.SetEventObject(this);
|
||||
GetEventHandler()->ProcessEvent(evt);
|
||||
}
|
||||
|
||||
@@ -1921,6 +1923,7 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
|
||||
SCNotification& scn = *_scn;
|
||||
wxStyledTextEvent evt(0, GetId());
|
||||
|
||||
evt.SetEventObject(this);
|
||||
evt.SetPosition(scn.position);
|
||||
evt.SetKey(scn.ch);
|
||||
evt.SetModifiers(scn.modifiers);
|
||||
@@ -2026,7 +2029,6 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
@@ -2050,6 +2052,8 @@ wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType, int id)
|
||||
m_listType = 0;
|
||||
m_x = 0;
|
||||
m_y = 0;
|
||||
m_dragAllowMove = FALSE;
|
||||
m_dragResult = wxDragNone;
|
||||
}
|
||||
|
||||
bool wxStyledTextEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; }
|
||||
@@ -2081,8 +2085,14 @@ void wxStyledTextEvent::CopyObject(wxObject& obj) const {
|
||||
o->m_x = m_x;
|
||||
o->m_y = m_y;
|
||||
|
||||
o->m_dragText = m_dragText;
|
||||
o->m_dragAllowMove =m_dragAllowMove;
|
||||
o->m_dragResult = m_dragResult;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -93,8 +93,9 @@ DEFINE_EVENT_TYPE( wxEVT_STC_USERLISTSELECTION )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
|
||||
|
||||
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
||||
@@ -458,6 +459,7 @@ void wxStyledTextCtrl::OnListBox(wxCommandEvent& evt) {
|
||||
|
||||
void wxStyledTextCtrl::NotifyChange() {
|
||||
wxStyledTextEvent evt(wxEVT_STC_CHANGE, GetId());
|
||||
evt.SetEventObject(this);
|
||||
GetEventHandler()->ProcessEvent(evt);
|
||||
}
|
||||
|
||||
@@ -465,6 +467,7 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
|
||||
SCNotification& scn = *_scn;
|
||||
wxStyledTextEvent evt(0, GetId());
|
||||
|
||||
evt.SetEventObject(this);
|
||||
evt.SetPosition(scn.position);
|
||||
evt.SetKey(scn.ch);
|
||||
evt.SetModifiers(scn.modifiers);
|
||||
@@ -570,7 +573,6 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
@@ -594,6 +596,8 @@ wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType, int id)
|
||||
m_listType = 0;
|
||||
m_x = 0;
|
||||
m_y = 0;
|
||||
m_dragAllowMove = FALSE;
|
||||
m_dragResult = wxDragNone;
|
||||
}
|
||||
|
||||
bool wxStyledTextEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; }
|
||||
@@ -625,8 +629,14 @@ void wxStyledTextEvent::CopyObject(wxObject& obj) const {
|
||||
o->m_x = m_x;
|
||||
o->m_y = m_y;
|
||||
|
||||
o->m_dragText = m_dragText;
|
||||
o->m_dragAllowMove =m_dragAllowMove;
|
||||
o->m_dragResult = m_dragResult;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -22,6 +22,7 @@
|
||||
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/dnd.h>
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// BEGIN generated section. The following code is automatically generated
|
||||
@@ -175,6 +176,7 @@ private:
|
||||
void NotifyChange();
|
||||
void NotifyParent(SCNotification* scn);
|
||||
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_CLASS(wxStyledTextCtrl)
|
||||
@@ -213,6 +215,9 @@ public:
|
||||
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; }
|
||||
@@ -231,6 +236,9 @@ public:
|
||||
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;
|
||||
@@ -263,6 +271,11 @@ 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
|
||||
};
|
||||
|
||||
@@ -287,6 +300,9 @@ BEGIN_DECLARE_EVENT_TYPES()
|
||||
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 {
|
||||
@@ -309,6 +325,9 @@ END_DECLARE_EVENT_TYPES()
|
||||
wxEVT_STC_URIDROPPED,
|
||||
wxEVT_STC_DWELLSTART,
|
||||
wxEVT_STC_DWELLEND,
|
||||
wxEVT_STC_START_DRAG,
|
||||
wxEVT_STC_DRAG_OVER,
|
||||
wxEVT_STC_DO_DROP,
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -336,7 +355,9 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
|
||||
#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
|
||||
|
||||
|
@@ -22,6 +22,7 @@
|
||||
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/dnd.h>
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// BEGIN generated section. The following code is automatically generated
|
||||
@@ -1621,6 +1622,7 @@ private:
|
||||
void NotifyChange();
|
||||
void NotifyParent(SCNotification* scn);
|
||||
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_CLASS(wxStyledTextCtrl)
|
||||
@@ -1659,6 +1661,9 @@ public:
|
||||
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; }
|
||||
@@ -1677,6 +1682,9 @@ public:
|
||||
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;
|
||||
@@ -1709,6 +1717,11 @@ 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
|
||||
};
|
||||
|
||||
@@ -1733,6 +1746,9 @@ BEGIN_DECLARE_EVENT_TYPES()
|
||||
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 {
|
||||
@@ -1755,6 +1771,9 @@ END_DECLARE_EVENT_TYPES()
|
||||
wxEVT_STC_URIDROPPED,
|
||||
wxEVT_STC_DWELLSTART,
|
||||
wxEVT_STC_DWELLEND,
|
||||
wxEVT_STC_START_DRAG,
|
||||
wxEVT_STC_DRAG_OVER,
|
||||
wxEVT_STC_DO_DROP,
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1782,7 +1801,9 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
|
||||
#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
|
||||
|
||||
|
@@ -121,18 +121,32 @@ void ScintillaWX::Finalise() {
|
||||
|
||||
|
||||
void ScintillaWX::StartDrag() {
|
||||
wxString dragText(drag.s, drag.len);
|
||||
|
||||
// Send an event to allow the drag text to be changed
|
||||
wxStyledTextEvent evt(wxEVT_STC_START_DRAG, stc->GetId());
|
||||
evt.SetEventObject(stc);
|
||||
evt.SetDragText(dragText);
|
||||
evt.SetDragAllowMove(TRUE);
|
||||
evt.SetPosition(wxMin(stc->GetSelectionStart(),
|
||||
stc->GetSelectionEnd()));
|
||||
stc->GetEventHandler()->ProcessEvent(evt);
|
||||
dragText = evt.GetDragText();
|
||||
|
||||
if (dragText.Length()) {
|
||||
wxDropSource source(wMain.GetID());
|
||||
wxTextDataObject data(wxString(drag.s, drag.len));
|
||||
wxTextDataObject data(dragText);
|
||||
wxDragResult result;
|
||||
|
||||
dropWentOutside = true;
|
||||
source.SetData(data);
|
||||
result = source.DoDragDrop(TRUE);
|
||||
dropWentOutside = TRUE;
|
||||
result = source.DoDragDrop(evt.GetDragAllowMove());
|
||||
if (result == wxDragMove && dropWentOutside)
|
||||
ClearSelection();
|
||||
inDragDrop = FALSE;
|
||||
SetDragPosition(invalidPosition);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ScintillaWX::SetTicking(bool on) {
|
||||
@@ -489,10 +503,27 @@ void ScintillaWX::DoOnListBox() {
|
||||
|
||||
bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
|
||||
SetDragPosition(invalidPosition);
|
||||
int movePos = PositionFromLocation(Point(x,y));
|
||||
DropAt(movePos, data, dragResult == wxDragMove, FALSE); // TODO: rectangular?
|
||||
|
||||
// Send an event to allow the drag details to be changed
|
||||
wxStyledTextEvent evt(wxEVT_STC_DO_DROP, stc->GetId());
|
||||
evt.SetEventObject(stc);
|
||||
evt.SetDragResult(dragResult);
|
||||
evt.SetX(x);
|
||||
evt.SetY(y);
|
||||
evt.SetPosition(PositionFromLocation(Point(x,y)));
|
||||
evt.SetDragText(data);
|
||||
stc->GetEventHandler()->ProcessEvent(evt);
|
||||
|
||||
dragResult = evt.GetDragResult();
|
||||
if (dragResult == wxDragMove || dragResult == wxDragCopy) {
|
||||
DropAt(evt.GetPosition(),
|
||||
evt.GetDragText(),
|
||||
dragResult == wxDragMove,
|
||||
FALSE); // TODO: rectangular?
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
wxDragResult ScintillaWX::DoDragEnter(wxCoord x, wxCoord y, wxDragResult def) {
|
||||
@@ -503,7 +534,17 @@ wxDragResult ScintillaWX::DoDragEnter(wxCoord x, wxCoord y, wxDragResult def) {
|
||||
|
||||
wxDragResult ScintillaWX::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) {
|
||||
SetDragPosition(PositionFromLocation(Point(x, y)));
|
||||
dragResult = def;
|
||||
|
||||
// Send an event to allow the drag result to be changed
|
||||
wxStyledTextEvent evt(wxEVT_STC_DRAG_OVER, stc->GetId());
|
||||
evt.SetEventObject(stc);
|
||||
evt.SetDragResult(def);
|
||||
evt.SetX(x);
|
||||
evt.SetY(y);
|
||||
evt.SetPosition(PositionFromLocation(Point(x,y)));
|
||||
stc->GetEventHandler()->ProcessEvent(evt);
|
||||
|
||||
dragResult = evt.GetDragResult();
|
||||
return dragResult;
|
||||
}
|
||||
|
||||
|
@@ -93,8 +93,9 @@ DEFINE_EVENT_TYPE( wxEVT_STC_USERLISTSELECTION )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
|
||||
|
||||
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
||||
@@ -1914,6 +1915,7 @@ void wxStyledTextCtrl::OnListBox(wxCommandEvent& evt) {
|
||||
|
||||
void wxStyledTextCtrl::NotifyChange() {
|
||||
wxStyledTextEvent evt(wxEVT_STC_CHANGE, GetId());
|
||||
evt.SetEventObject(this);
|
||||
GetEventHandler()->ProcessEvent(evt);
|
||||
}
|
||||
|
||||
@@ -1921,6 +1923,7 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
|
||||
SCNotification& scn = *_scn;
|
||||
wxStyledTextEvent evt(0, GetId());
|
||||
|
||||
evt.SetEventObject(this);
|
||||
evt.SetPosition(scn.position);
|
||||
evt.SetKey(scn.ch);
|
||||
evt.SetModifiers(scn.modifiers);
|
||||
@@ -2026,7 +2029,6 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
@@ -2050,6 +2052,8 @@ wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType, int id)
|
||||
m_listType = 0;
|
||||
m_x = 0;
|
||||
m_y = 0;
|
||||
m_dragAllowMove = FALSE;
|
||||
m_dragResult = wxDragNone;
|
||||
}
|
||||
|
||||
bool wxStyledTextEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; }
|
||||
@@ -2081,8 +2085,14 @@ void wxStyledTextEvent::CopyObject(wxObject& obj) const {
|
||||
o->m_x = m_x;
|
||||
o->m_y = m_y;
|
||||
|
||||
o->m_dragText = m_dragText;
|
||||
o->m_dragAllowMove =m_dragAllowMove;
|
||||
o->m_dragResult = m_dragResult;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -93,8 +93,9 @@ DEFINE_EVENT_TYPE( wxEVT_STC_USERLISTSELECTION )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
|
||||
|
||||
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
||||
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
||||
@@ -458,6 +459,7 @@ void wxStyledTextCtrl::OnListBox(wxCommandEvent& evt) {
|
||||
|
||||
void wxStyledTextCtrl::NotifyChange() {
|
||||
wxStyledTextEvent evt(wxEVT_STC_CHANGE, GetId());
|
||||
evt.SetEventObject(this);
|
||||
GetEventHandler()->ProcessEvent(evt);
|
||||
}
|
||||
|
||||
@@ -465,6 +467,7 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
|
||||
SCNotification& scn = *_scn;
|
||||
wxStyledTextEvent evt(0, GetId());
|
||||
|
||||
evt.SetEventObject(this);
|
||||
evt.SetPosition(scn.position);
|
||||
evt.SetKey(scn.ch);
|
||||
evt.SetModifiers(scn.modifiers);
|
||||
@@ -570,7 +573,6 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
@@ -594,6 +596,8 @@ wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType, int id)
|
||||
m_listType = 0;
|
||||
m_x = 0;
|
||||
m_y = 0;
|
||||
m_dragAllowMove = FALSE;
|
||||
m_dragResult = wxDragNone;
|
||||
}
|
||||
|
||||
bool wxStyledTextEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; }
|
||||
@@ -625,8 +629,14 @@ void wxStyledTextEvent::CopyObject(wxObject& obj) const {
|
||||
o->m_x = m_x;
|
||||
o->m_y = m_y;
|
||||
|
||||
o->m_dragText = m_dragText;
|
||||
o->m_dragAllowMove =m_dragAllowMove;
|
||||
o->m_dragResult = m_dragResult;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -22,6 +22,7 @@
|
||||
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/dnd.h>
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// BEGIN generated section. The following code is automatically generated
|
||||
@@ -175,6 +176,7 @@ private:
|
||||
void NotifyChange();
|
||||
void NotifyParent(SCNotification* scn);
|
||||
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_CLASS(wxStyledTextCtrl)
|
||||
@@ -213,6 +215,9 @@ public:
|
||||
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; }
|
||||
@@ -231,6 +236,9 @@ public:
|
||||
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;
|
||||
@@ -263,6 +271,11 @@ 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
|
||||
};
|
||||
|
||||
@@ -287,6 +300,9 @@ BEGIN_DECLARE_EVENT_TYPES()
|
||||
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 {
|
||||
@@ -309,6 +325,9 @@ END_DECLARE_EVENT_TYPES()
|
||||
wxEVT_STC_URIDROPPED,
|
||||
wxEVT_STC_DWELLSTART,
|
||||
wxEVT_STC_DWELLEND,
|
||||
wxEVT_STC_START_DRAG,
|
||||
wxEVT_STC_DRAG_OVER,
|
||||
wxEVT_STC_DO_DROP,
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -336,7 +355,9 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
|
||||
#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
|
||||
|
||||
|
@@ -9215,6 +9215,115 @@ static PyObject *_wrap_wxStyledTextEvent_SetY(PyObject *self, PyObject *args, Py
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxStyledTextEvent_SetDragText(_swigobj,_swigarg0) (_swigobj->SetDragText(_swigarg0))
|
||||
static PyObject *_wrap_wxStyledTextEvent_SetDragText(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxStyledTextEvent * _arg0;
|
||||
wxString * _arg1;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _obj1 = 0;
|
||||
char *_kwnames[] = { "self","val", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxStyledTextEvent_SetDragText",_kwnames,&_argo0,&_obj1))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextEvent_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextEvent_SetDragText. Expected _wxStyledTextEvent_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
#if PYTHON_API_VERSION >= 1009
|
||||
char* tmpPtr; int tmpSize;
|
||||
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
|
||||
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
|
||||
return NULL;
|
||||
}
|
||||
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
|
||||
return NULL;
|
||||
_arg1 = new wxString(tmpPtr, tmpSize);
|
||||
#else
|
||||
if (!PyString_Check(_obj1)) {
|
||||
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
|
||||
return NULL;
|
||||
}
|
||||
_arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1));
|
||||
#endif
|
||||
}
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
wxStyledTextEvent_SetDragText(_arg0,*_arg1);
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
{
|
||||
if (_obj1)
|
||||
delete _arg1;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxStyledTextEvent_SetDragAllowMove(_swigobj,_swigarg0) (_swigobj->SetDragAllowMove(_swigarg0))
|
||||
static PyObject *_wrap_wxStyledTextEvent_SetDragAllowMove(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxStyledTextEvent * _arg0;
|
||||
bool _arg1;
|
||||
PyObject * _argo0 = 0;
|
||||
int tempbool1;
|
||||
char *_kwnames[] = { "self","val", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxStyledTextEvent_SetDragAllowMove",_kwnames,&_argo0,&tempbool1))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextEvent_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextEvent_SetDragAllowMove. Expected _wxStyledTextEvent_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
_arg1 = (bool ) tempbool1;
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
wxStyledTextEvent_SetDragAllowMove(_arg0,_arg1);
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxStyledTextEvent_SetDragResult(_swigobj,_swigarg0) (_swigobj->SetDragResult(_swigarg0))
|
||||
static PyObject *_wrap_wxStyledTextEvent_SetDragResult(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxStyledTextEvent * _arg0;
|
||||
wxDragResult _arg1;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self","val", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxStyledTextEvent_SetDragResult",_kwnames,&_argo0,&_arg1))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextEvent_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextEvent_SetDragResult. Expected _wxStyledTextEvent_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
wxStyledTextEvent_SetDragResult(_arg0,_arg1);
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxStyledTextEvent_GetPosition(_swigobj) (_swigobj->GetPosition())
|
||||
static PyObject *_wrap_wxStyledTextEvent_GetPosition(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
@@ -9679,6 +9788,92 @@ static PyObject *_wrap_wxStyledTextEvent_GetY(PyObject *self, PyObject *args, Py
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxStyledTextEvent_GetDragText(_swigobj) (_swigobj->GetDragText())
|
||||
static PyObject *_wrap_wxStyledTextEvent_GetDragText(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxString * _result;
|
||||
wxStyledTextEvent * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxStyledTextEvent_GetDragText",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextEvent_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextEvent_GetDragText. Expected _wxStyledTextEvent_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
_result = new wxString (wxStyledTextEvent_GetDragText(_arg0));
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
}{
|
||||
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
|
||||
}
|
||||
{
|
||||
delete _result;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxStyledTextEvent_GetDragAllowMove(_swigobj) (_swigobj->GetDragAllowMove())
|
||||
static PyObject *_wrap_wxStyledTextEvent_GetDragAllowMove(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
bool _result;
|
||||
wxStyledTextEvent * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxStyledTextEvent_GetDragAllowMove",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextEvent_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextEvent_GetDragAllowMove. Expected _wxStyledTextEvent_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
_result = (bool )wxStyledTextEvent_GetDragAllowMove(_arg0);
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
} _resultobj = Py_BuildValue("i",_result);
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxStyledTextEvent_GetDragResult(_swigobj) (_swigobj->GetDragResult())
|
||||
static PyObject *_wrap_wxStyledTextEvent_GetDragResult(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxDragResult _result;
|
||||
wxStyledTextEvent * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxStyledTextEvent_GetDragResult",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextEvent_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextEvent_GetDragResult. Expected _wxStyledTextEvent_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
_result = (wxDragResult )wxStyledTextEvent_GetDragResult(_arg0);
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
} _resultobj = Py_BuildValue("i",_result);
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxStyledTextEvent_GetShift(_swigobj) (_swigobj->GetShift())
|
||||
static PyObject *_wrap_wxStyledTextEvent_GetShift(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
@@ -9801,6 +9996,9 @@ static PyMethodDef stc_cMethods[] = {
|
||||
{ "wxStyledTextEvent_GetAlt", (PyCFunction) _wrap_wxStyledTextEvent_GetAlt, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_GetControl", (PyCFunction) _wrap_wxStyledTextEvent_GetControl, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_GetShift", (PyCFunction) _wrap_wxStyledTextEvent_GetShift, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_GetDragResult", (PyCFunction) _wrap_wxStyledTextEvent_GetDragResult, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_GetDragAllowMove", (PyCFunction) _wrap_wxStyledTextEvent_GetDragAllowMove, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_GetDragText", (PyCFunction) _wrap_wxStyledTextEvent_GetDragText, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_GetY", (PyCFunction) _wrap_wxStyledTextEvent_GetY, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_GetX", (PyCFunction) _wrap_wxStyledTextEvent_GetX, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_GetListType", (PyCFunction) _wrap_wxStyledTextEvent_GetListType, METH_VARARGS | METH_KEYWORDS },
|
||||
@@ -9818,6 +10016,9 @@ static PyMethodDef stc_cMethods[] = {
|
||||
{ "wxStyledTextEvent_GetModifiers", (PyCFunction) _wrap_wxStyledTextEvent_GetModifiers, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_GetKey", (PyCFunction) _wrap_wxStyledTextEvent_GetKey, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_GetPosition", (PyCFunction) _wrap_wxStyledTextEvent_GetPosition, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_SetDragResult", (PyCFunction) _wrap_wxStyledTextEvent_SetDragResult, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_SetDragAllowMove", (PyCFunction) _wrap_wxStyledTextEvent_SetDragAllowMove, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_SetDragText", (PyCFunction) _wrap_wxStyledTextEvent_SetDragText, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_SetY", (PyCFunction) _wrap_wxStyledTextEvent_SetY, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_SetX", (PyCFunction) _wrap_wxStyledTextEvent_SetX, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStyledTextEvent_SetListType", (PyCFunction) _wrap_wxStyledTextEvent_SetListType, METH_VARARGS | METH_KEYWORDS },
|
||||
@@ -10755,6 +10956,9 @@ SWIGEXPORT(void) initstc_c() {
|
||||
PyDict_SetItemString(d,"wxEVT_STC_URIDROPPED", PyInt_FromLong((long) wxEVT_STC_URIDROPPED));
|
||||
PyDict_SetItemString(d,"wxEVT_STC_DWELLSTART", PyInt_FromLong((long) wxEVT_STC_DWELLSTART));
|
||||
PyDict_SetItemString(d,"wxEVT_STC_DWELLEND", PyInt_FromLong((long) wxEVT_STC_DWELLEND));
|
||||
PyDict_SetItemString(d,"wxEVT_STC_START_DRAG", PyInt_FromLong((long) wxEVT_STC_START_DRAG));
|
||||
PyDict_SetItemString(d,"wxEVT_STC_DRAG_OVER", PyInt_FromLong((long) wxEVT_STC_DRAG_OVER));
|
||||
PyDict_SetItemString(d,"wxEVT_STC_DO_DROP", PyInt_FromLong((long) wxEVT_STC_DO_DROP));
|
||||
|
||||
|
||||
wxClassInfo::CleanUpClasses();
|
||||
|
@@ -96,6 +96,14 @@ def EVT_STC_DWELLSTART(win, id, func):
|
||||
def EVT_STC_DWELLEND(win, id, func):
|
||||
win.Connect(id, -1, wxEVT_STC_DWELLEND, func)
|
||||
|
||||
def EVT_STC_START_DRAG(win, id, func):
|
||||
win.Connect(id, -1, wxEVT_STC_START_DRAG, func)
|
||||
|
||||
def EVT_STC_DRAG_OVER(win, id, func):
|
||||
win.Connect(id, -1, wxEVT_STC_DRAG_OVER, func)
|
||||
|
||||
def EVT_STC_DO_DROP(win, id, func):
|
||||
win.Connect(id, -1, wxEVT_STC_DO_DROP, func)
|
||||
|
||||
"
|
||||
|
||||
|
@@ -98,6 +98,14 @@ def EVT_STC_DWELLSTART(win, id, func):
|
||||
def EVT_STC_DWELLEND(win, id, func):
|
||||
win.Connect(id, -1, wxEVT_STC_DWELLEND, func)
|
||||
|
||||
def EVT_STC_START_DRAG(win, id, func):
|
||||
win.Connect(id, -1, wxEVT_STC_START_DRAG, func)
|
||||
|
||||
def EVT_STC_DRAG_OVER(win, id, func):
|
||||
win.Connect(id, -1, wxEVT_STC_DRAG_OVER, func)
|
||||
|
||||
def EVT_STC_DO_DROP(win, id, func):
|
||||
win.Connect(id, -1, wxEVT_STC_DO_DROP, func)
|
||||
|
||||
|
||||
class wxStyledTextCtrlPtr(wxControlPtr):
|
||||
@@ -994,6 +1002,15 @@ class wxStyledTextEventPtr(wxCommandEventPtr):
|
||||
def SetY(self, *_args, **_kwargs):
|
||||
val = apply(stc_c.wxStyledTextEvent_SetY,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetDragText(self, *_args, **_kwargs):
|
||||
val = apply(stc_c.wxStyledTextEvent_SetDragText,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetDragAllowMove(self, *_args, **_kwargs):
|
||||
val = apply(stc_c.wxStyledTextEvent_SetDragAllowMove,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetDragResult(self, *_args, **_kwargs):
|
||||
val = apply(stc_c.wxStyledTextEvent_SetDragResult,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetPosition(self, *_args, **_kwargs):
|
||||
val = apply(stc_c.wxStyledTextEvent_GetPosition,(self,) + _args, _kwargs)
|
||||
return val
|
||||
@@ -1045,6 +1062,15 @@ class wxStyledTextEventPtr(wxCommandEventPtr):
|
||||
def GetY(self, *_args, **_kwargs):
|
||||
val = apply(stc_c.wxStyledTextEvent_GetY,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetDragText(self, *_args, **_kwargs):
|
||||
val = apply(stc_c.wxStyledTextEvent_GetDragText,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetDragAllowMove(self, *_args, **_kwargs):
|
||||
val = apply(stc_c.wxStyledTextEvent_GetDragAllowMove,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetDragResult(self, *_args, **_kwargs):
|
||||
val = apply(stc_c.wxStyledTextEvent_GetDragResult,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetShift(self, *_args, **_kwargs):
|
||||
val = apply(stc_c.wxStyledTextEvent_GetShift,(self,) + _args, _kwargs)
|
||||
return val
|
||||
@@ -1593,6 +1619,9 @@ wxEVT_STC_USERLISTSELECTION = stc_c.wxEVT_STC_USERLISTSELECTION
|
||||
wxEVT_STC_URIDROPPED = stc_c.wxEVT_STC_URIDROPPED
|
||||
wxEVT_STC_DWELLSTART = stc_c.wxEVT_STC_DWELLSTART
|
||||
wxEVT_STC_DWELLEND = stc_c.wxEVT_STC_DWELLEND
|
||||
wxEVT_STC_START_DRAG = stc_c.wxEVT_STC_START_DRAG
|
||||
wxEVT_STC_DRAG_OVER = stc_c.wxEVT_STC_DRAG_OVER
|
||||
wxEVT_STC_DO_DROP = stc_c.wxEVT_STC_DO_DROP
|
||||
|
||||
|
||||
#-------------- USER INCLUDE -----------------------
|
||||
|
@@ -28,6 +28,7 @@
|
||||
|
||||
|
||||
<FONT color=#a020f0>#include </FONT><FONT color=#ff00ff><wx/wx.h></FONT>
|
||||
<FONT color=#a020f0>#include </FONT><FONT color=#ff00ff><wx/dnd.h></FONT>
|
||||
|
||||
<FONT color=#0000ff>//----------------------------------------------------------------------</FONT>
|
||||
<FONT color=#0000ff>// BEGIN generated section. The following code is automatically generated</FONT>
|
||||
@@ -78,6 +79,7 @@
|
||||
<FONT color=#a020f0>#define wxSTC_MARK_CIRCLEPLUSCONNECTED </FONT><FONT color=#ff00ff>19</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_MARK_CIRCLEMINUS </FONT><FONT color=#ff00ff>20</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_MARK_CIRCLEMINUSCONNECTED </FONT><FONT color=#ff00ff>21</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_MARK_CHARACTER </FONT><FONT color=#ff00ff>10000</FONT>
|
||||
|
||||
<FONT color=#0000ff>// Markers used for outlining column</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_MARKNUM_FOLDEREND </FONT><FONT color=#ff00ff>25</FONT>
|
||||
@@ -89,12 +91,16 @@
|
||||
<FONT color=#a020f0>#define wxSTC_MARKNUM_FOLDEROPEN </FONT><FONT color=#ff00ff>31</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_MARGIN_SYMBOL </FONT><FONT color=#ff00ff>0</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_MARGIN_NUMBER </FONT><FONT color=#ff00ff>1</FONT>
|
||||
|
||||
<FONT color=#0000ff>// Styles in range 32..37 are predefined for parts of the UI and are not used as normal styles.</FONT>
|
||||
<FONT color=#0000ff>// Styles 38 and 39 are for future use.</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_STYLE_DEFAULT </FONT><FONT color=#ff00ff>32</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_STYLE_LINENUMBER </FONT><FONT color=#ff00ff>33</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_STYLE_BRACELIGHT </FONT><FONT color=#ff00ff>34</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_STYLE_BRACEBAD </FONT><FONT color=#ff00ff>35</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_STYLE_CONTROLCHAR </FONT><FONT color=#ff00ff>36</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_STYLE_INDENTGUIDE </FONT><FONT color=#ff00ff>37</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_STYLE_LASTPREDEFINED </FONT><FONT color=#ff00ff>39</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_STYLE_MAX </FONT><FONT color=#ff00ff>127</FONT>
|
||||
|
||||
<FONT color=#0000ff>// Character set identifiers are used in StyleSetCharacterSet.</FONT>
|
||||
@@ -301,6 +307,7 @@
|
||||
<FONT color=#a020f0>#define wxSTC_LEX_EIFFEL </FONT><FONT color=#ff00ff>23</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_LEX_EIFFELKW </FONT><FONT color=#ff00ff>24</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_LEX_TCL </FONT><FONT color=#ff00ff>25</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_LEX_NNCRONTAB </FONT><FONT color=#ff00ff>26</FONT>
|
||||
|
||||
<FONT color=#0000ff>// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a</FONT>
|
||||
<FONT color=#0000ff>// value assigned in sequence from SCLEX_AUTOMATIC+1.</FONT>
|
||||
@@ -340,6 +347,8 @@
|
||||
<FONT color=#a020f0>#define wxSTC_C_REGEX </FONT><FONT color=#ff00ff>14</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_C_COMMENTLINEDOC </FONT><FONT color=#ff00ff>15</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_C_WORD2 </FONT><FONT color=#ff00ff>16</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_C_COMMENTDOCKEYWORD </FONT><FONT color=#ff00ff>17</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_C_COMMENTDOCKEYWORDERROR </FONT><FONT color=#ff00ff>18</FONT>
|
||||
|
||||
<FONT color=#0000ff>// Lexical states for SCLEX_HTML, SCLEX_XML</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_H_DEFAULT </FONT><FONT color=#ff00ff>0</FONT>
|
||||
@@ -371,7 +380,17 @@
|
||||
<FONT color=#a020f0>#define wxSTC_H_XCCOMMENT </FONT><FONT color=#ff00ff>20</FONT>
|
||||
|
||||
<FONT color=#0000ff>// SGML</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_H_SGML </FONT><FONT color=#ff00ff>21</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_H_SGML_DEFAULT </FONT><FONT color=#ff00ff>21</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_H_SGML_COMMAND </FONT><FONT color=#ff00ff>22</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_H_SGML_1ST_PARAM </FONT><FONT color=#ff00ff>23</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_H_SGML_DOUBLESTRING </FONT><FONT color=#ff00ff>24</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_H_SGML_SIMPLESTRING </FONT><FONT color=#ff00ff>25</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_H_SGML_ERROR </FONT><FONT color=#ff00ff>26</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_H_SGML_SPECIAL </FONT><FONT color=#ff00ff>27</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_H_SGML_ENTITY </FONT><FONT color=#ff00ff>28</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_H_SGML_COMMENT </FONT><FONT color=#ff00ff>29</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_H_SGML_1ST_PARAM_COMMENT </FONT><FONT color=#ff00ff>30</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_H_SGML_BLOCK_DEFAULT </FONT><FONT color=#ff00ff>31</FONT>
|
||||
|
||||
<FONT color=#0000ff>// Embedded Javascript</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_HJ_START </FONT><FONT color=#ff00ff>40</FONT>
|
||||
@@ -610,6 +629,19 @@
|
||||
<FONT color=#a020f0>#define wxSTC_EIFFEL_IDENTIFIER </FONT><FONT color=#ff00ff>7</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_EIFFEL_STRINGEOL </FONT><FONT color=#ff00ff>8</FONT>
|
||||
|
||||
<FONT color=#0000ff>// Lexical states for the SCLEX_NNCRONTAB (nnCron crontab Lexer)</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_NNCRONTAB_DEFAULT </FONT><FONT color=#ff00ff>0</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_NNCRONTAB_COMMENT </FONT><FONT color=#ff00ff>1</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_NNCRONTAB_TASK </FONT><FONT color=#ff00ff>2</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_NNCRONTAB_SECTION </FONT><FONT color=#ff00ff>3</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_NNCRONTAB_KEYWORD </FONT><FONT color=#ff00ff>4</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_NNCRONTAB_MODIFIER </FONT><FONT color=#ff00ff>5</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_NNCRONTAB_ASTERISK </FONT><FONT color=#ff00ff>6</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_NNCRONTAB_NUMBER </FONT><FONT color=#ff00ff>7</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_NNCRONTAB_STRING </FONT><FONT color=#ff00ff>8</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_NNCRONTAB_ENVIRONMENT </FONT><FONT color=#ff00ff>9</FONT>
|
||||
<FONT color=#a020f0>#define wxSTC_NNCRONTAB_IDENTIFIER </FONT><FONT color=#ff00ff>10</FONT>
|
||||
|
||||
<FONT color=#0000ff>// END of generated section</FONT>
|
||||
<FONT color=#0000ff>//----------------------------------------------------------------------</FONT>
|
||||
<FONT color=#0000ff>// Others</FONT>
|
||||
@@ -637,6 +669,8 @@
|
||||
<B><FONT color=#2e8b57>const</FONT></B> wxPoint& pos = wxDefaultPosition,
|
||||
<B><FONT color=#2e8b57>const</FONT></B> wxSize& size = wxDefaultSize, <B><FONT color=#2e8b57>long</FONT></B> style = <FONT color=#ff00ff>0</FONT>,
|
||||
<B><FONT color=#2e8b57>const</FONT></B> <B><FONT color=#2e8b57>char</FONT></B>* name = <FONT color=#ff00ff>"styledtext"</FONT>);
|
||||
%pragma(python) addtomethod = <FONT color=#ff00ff>"__init__:self._setOORInfo(self)"</FONT>
|
||||
|
||||
<FONT color=#a020f0>#else</FONT>
|
||||
wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
|
||||
<B><FONT color=#2e8b57>const</FONT></B> wxPoint& pos = wxDefaultPosition,
|
||||
@@ -740,7 +774,11 @@
|
||||
|
||||
<FONT color=#0000ff>// Retrieve the text of the line containing the caret.</FONT>
|
||||
<FONT color=#0000ff>// Returns the index of the caret on the line.</FONT>
|
||||
wxString GetCurLine(<B><FONT color=#2e8b57>int</FONT></B>* OUTPUT=<FONT color=#ff00ff>NULL</FONT>);
|
||||
<FONT color=#a020f0> #ifdef SWIG</FONT>
|
||||
wxString GetCurLine(<B><FONT color=#2e8b57>int</FONT></B>* OUTPUT);
|
||||
<FONT color=#a020f0>#else</FONT>
|
||||
wxString GetCurLine(<B><FONT color=#2e8b57>int</FONT></B>* linePos=<FONT color=#ff00ff>NULL</FONT>);
|
||||
<FONT color=#a020f0>#endif</FONT>
|
||||
|
||||
<FONT color=#0000ff>// Retrieve the position of the last correctly styled character.</FONT>
|
||||
<B><FONT color=#2e8b57>int</FONT></B> GetEndStyled();
|
||||
@@ -1223,10 +1261,12 @@
|
||||
<B><FONT color=#2e8b57>int</FONT></B> GetTargetEnd();
|
||||
|
||||
<FONT color=#0000ff>// Replace the target text with the argument text.</FONT>
|
||||
<FONT color=#0000ff>// Text is counted so it can contain nulls.</FONT>
|
||||
<FONT color=#0000ff>// Returns the length of the replacement text.</FONT>
|
||||
<B><FONT color=#2e8b57>int</FONT></B> ReplaceTarget(<B><FONT color=#2e8b57>const</FONT></B> wxString& text);
|
||||
|
||||
<FONT color=#0000ff>// Replace the target text with the argument text after \d processing.</FONT>
|
||||
<FONT color=#0000ff>// Text is counted so it can contain nulls.</FONT>
|
||||
<FONT color=#0000ff>// Looks for \d where d is between 1 and 9 and replaces these with the strings</FONT>
|
||||
<FONT color=#0000ff>// matched in the last search operation which were surrounded by \( and \).</FONT>
|
||||
<FONT color=#0000ff>// Returns the length of the replacement text including any change</FONT>
|
||||
@@ -1234,7 +1274,7 @@
|
||||
<B><FONT color=#2e8b57>int</FONT></B> ReplaceTargetRE(<B><FONT color=#2e8b57>const</FONT></B> wxString& text);
|
||||
|
||||
<FONT color=#0000ff>// Search for a counted string in the target and set the target to the found</FONT>
|
||||
<FONT color=#0000ff>// range.</FONT>
|
||||
<FONT color=#0000ff>// range. Text is counted so it can contain nulls.</FONT>
|
||||
<FONT color=#0000ff>// Returns length of range or -1 for failure in which case target is not moved.</FONT>
|
||||
<B><FONT color=#2e8b57>int</FONT></B> SearchInTarget(<B><FONT color=#2e8b57>const</FONT></B> wxString& text);
|
||||
|
||||
@@ -1423,10 +1463,10 @@
|
||||
<B><FONT color=#2e8b57>int</FONT></B> GetModEventMask();
|
||||
|
||||
<FONT color=#0000ff>// Change internal focus flag</FONT>
|
||||
<B><FONT color=#2e8b57>void</FONT></B> SetFocus(<B><FONT color=#2e8b57>bool</FONT></B> focus);
|
||||
<B><FONT color=#2e8b57>void</FONT></B> SetSTCFocus(<B><FONT color=#2e8b57>bool</FONT></B> focus);
|
||||
|
||||
<FONT color=#0000ff>// Get internal focus flag</FONT>
|
||||
<B><FONT color=#2e8b57>bool</FONT></B> GetFocus();
|
||||
<B><FONT color=#2e8b57>bool</FONT></B> GetSTCFocus();
|
||||
|
||||
<FONT color=#0000ff>// Change error status - 0 = OK</FONT>
|
||||
<B><FONT color=#2e8b57>void</FONT></B> SetStatus(<B><FONT color=#2e8b57>int</FONT></B> statusCode);
|
||||
@@ -1588,6 +1628,7 @@
|
||||
<B><FONT color=#2e8b57>void</FONT></B> NotifyChange();
|
||||
<B><FONT color=#2e8b57>void</FONT></B> NotifyParent(SCNotification* scn);
|
||||
|
||||
|
||||
<B><FONT color=#804040>private</FONT></B>:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_CLASS(wxStyledTextCtrl)
|
||||
@@ -1595,6 +1636,7 @@
|
||||
ScintillaWX* m_swx;
|
||||
wxStopWatch m_stopWatch;
|
||||
|
||||
<B><FONT color=#2e8b57>bool</FONT></B> m_lastKeyDownConsumed;
|
||||
|
||||
<B><FONT color=#804040>friend</FONT></B> <B><FONT color=#2e8b57>class</FONT></B> ScintillaWX;
|
||||
<B><FONT color=#804040>friend</FONT></B> <B><FONT color=#2e8b57>class</FONT></B> Platform;
|
||||
@@ -1625,6 +1667,9 @@
|
||||
<B><FONT color=#2e8b57>void</FONT></B> SetListType(<B><FONT color=#2e8b57>int</FONT></B> val) { m_listType = val; }
|
||||
<B><FONT color=#2e8b57>void</FONT></B> SetX(<B><FONT color=#2e8b57>int</FONT></B> val) { m_x = val; }
|
||||
<B><FONT color=#2e8b57>void</FONT></B> SetY(<B><FONT color=#2e8b57>int</FONT></B> val) { m_y = val; }
|
||||
<B><FONT color=#2e8b57>void</FONT></B> SetDragText(<B><FONT color=#2e8b57>const</FONT></B> wxString& val) { m_dragText = val; }
|
||||
<B><FONT color=#2e8b57>void</FONT></B> SetDragAllowMove(<B><FONT color=#2e8b57>bool</FONT></B> val) { m_dragAllowMove = val; }
|
||||
<B><FONT color=#2e8b57>void</FONT></B> SetDragResult(wxDragResult val) { m_dragResult = val; }
|
||||
|
||||
<B><FONT color=#2e8b57>int</FONT></B> GetPosition() <B><FONT color=#2e8b57>const</FONT></B> { <B><FONT color=#804040>return</FONT></B> m_position; }
|
||||
<B><FONT color=#2e8b57>int</FONT></B> GetKey() <B><FONT color=#2e8b57>const</FONT></B> { <B><FONT color=#804040>return</FONT></B> m_key; }
|
||||
@@ -1643,6 +1688,9 @@
|
||||
<B><FONT color=#2e8b57>int</FONT></B> GetListType() <B><FONT color=#2e8b57>const</FONT></B> { <B><FONT color=#804040>return</FONT></B> m_listType; }
|
||||
<B><FONT color=#2e8b57>int</FONT></B> GetX() <B><FONT color=#2e8b57>const</FONT></B> { <B><FONT color=#804040>return</FONT></B> m_x; }
|
||||
<B><FONT color=#2e8b57>int</FONT></B> GetY() <B><FONT color=#2e8b57>const</FONT></B> { <B><FONT color=#804040>return</FONT></B> m_y; }
|
||||
wxString GetDragText() { <B><FONT color=#804040>return</FONT></B> m_dragText; }
|
||||
<B><FONT color=#2e8b57>bool</FONT></B> GetDragAllowMove() { <B><FONT color=#804040>return</FONT></B> m_dragAllowMove; }
|
||||
wxDragResult GetDragResult() { <B><FONT color=#804040>return</FONT></B> m_dragResult; }
|
||||
|
||||
<B><FONT color=#2e8b57>bool</FONT></B> GetShift() <B><FONT color=#2e8b57>const</FONT></B>;
|
||||
<B><FONT color=#2e8b57>bool</FONT></B> GetControl() <B><FONT color=#2e8b57>const</FONT></B>;
|
||||
@@ -1675,6 +1723,11 @@
|
||||
<B><FONT color=#2e8b57>int</FONT></B> m_listType;
|
||||
<B><FONT color=#2e8b57>int</FONT></B> m_x;
|
||||
<B><FONT color=#2e8b57>int</FONT></B> m_y;
|
||||
|
||||
wxString m_dragText; <FONT color=#0000ff>// wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP</FONT>
|
||||
<B><FONT color=#2e8b57>bool</FONT></B> m_dragAllowMove; <FONT color=#0000ff>// wxEVT_STC_START_DRAG</FONT>
|
||||
|
||||
wxDragResult m_dragResult; <FONT color=#0000ff>// wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP</FONT>
|
||||
<FONT color=#a020f0>#endif</FONT>
|
||||
};
|
||||
|
||||
@@ -1699,6 +1752,9 @@ BEGIN_DECLARE_EVENT_TYPES()
|
||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED, <FONT color=#ff00ff>1666</FONT>)
|
||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART, <FONT color=#ff00ff>1667</FONT>)
|
||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLEND, <FONT color=#ff00ff>1668</FONT>)
|
||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_START_DRAG, <FONT color=#ff00ff>1669</FONT>)
|
||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, <FONT color=#ff00ff>1670</FONT>)
|
||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, <FONT color=#ff00ff>1671</FONT>)
|
||||
END_DECLARE_EVENT_TYPES()
|
||||
<FONT color=#a020f0>#else</FONT>
|
||||
<B><FONT color=#2e8b57>enum</FONT></B> {
|
||||
@@ -1721,6 +1777,9 @@ END_DECLARE_EVENT_TYPES()
|
||||
wxEVT_STC_URIDROPPED,
|
||||
wxEVT_STC_DWELLSTART,
|
||||
wxEVT_STC_DWELLEND,
|
||||
wxEVT_STC_START_DRAG,
|
||||
wxEVT_STC_DRAG_OVER,
|
||||
wxEVT_STC_DO_DROP,
|
||||
};
|
||||
<FONT color=#a020f0>#endif</FONT>
|
||||
|
||||
@@ -1748,7 +1807,9 @@ END_DECLARE_EVENT_TYPES()
|
||||
<FONT color=#a020f0>#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, -</FONT><FONT color=#ff00ff>1</FONT><FONT color=#a020f0>, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) </FONT><FONT color=#ff00ff>NULL</FONT><FONT color=#a020f0> ),</FONT>
|
||||
<FONT color=#a020f0>#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, -</FONT><FONT color=#ff00ff>1</FONT><FONT color=#a020f0>, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) </FONT><FONT color=#ff00ff>NULL</FONT><FONT color=#a020f0> ),</FONT>
|
||||
<FONT color=#a020f0>#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, -</FONT><FONT color=#ff00ff>1</FONT><FONT color=#a020f0>, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) </FONT><FONT color=#ff00ff>NULL</FONT><FONT color=#a020f0> ),</FONT>
|
||||
|
||||
<FONT color=#a020f0>#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, -</FONT><FONT color=#ff00ff>1</FONT><FONT color=#a020f0>, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) </FONT><FONT color=#ff00ff>NULL</FONT><FONT color=#a020f0> ),</FONT>
|
||||
<FONT color=#a020f0>#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -</FONT><FONT color=#ff00ff>1</FONT><FONT color=#a020f0>, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) </FONT><FONT color=#ff00ff>NULL</FONT><FONT color=#a020f0> ),</FONT>
|
||||
<FONT color=#a020f0>#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -</FONT><FONT color=#ff00ff>1</FONT><FONT color=#a020f0>, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) </FONT><FONT color=#ff00ff>NULL</FONT><FONT color=#a020f0> ),</FONT>
|
||||
|
||||
<FONT color=#a020f0>#endif</FONT>
|
||||
|
||||
|
@@ -4,6 +4,9 @@ from wxPython.stc import *
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
debug = 1
|
||||
|
||||
|
||||
demoText = """\
|
||||
|
||||
This editor is provided by a class named wxStyledTextCtrl. As
|
||||
@@ -52,9 +55,48 @@ class MySTC(wxStyledTextCtrl):
|
||||
wxStyledTextCtrl.__init__(self, parent, ID)
|
||||
self.log = log
|
||||
|
||||
EVT_STC_DO_DROP(self, ID, self.OnDoDrop)
|
||||
EVT_STC_DRAG_OVER(self, ID, self.OnDragOver)
|
||||
EVT_STC_START_DRAG(self, ID, self.OnStartDrag)
|
||||
EVT_STC_MODIFIED(self, ID, self.OnModified)
|
||||
|
||||
|
||||
def OnStartDrag(self, evt):
|
||||
self.log.write("OnStartDrag: %d, %s\n"
|
||||
% (evt.GetDragAllowMove(), evt.GetDragText()))
|
||||
|
||||
if debug and evt.GetPosition() < 250:
|
||||
evt.SetDragAllowMove(false) # you can prevent moving of text (only copy)
|
||||
evt.SetDragText("DRAGGED TEXT") # you can change what is dragged
|
||||
#evt.SetDragText("") # or prevent the drag with empty text
|
||||
|
||||
|
||||
def OnDragOver(self, evt):
|
||||
self.log.write("OnDragOver: x,y=(%d, %d) pos: %d DragResult: %d\n"
|
||||
% (evt.GetX(), evt.GetY(), evt.GetPosition(), evt.GetDragResult()))
|
||||
|
||||
if debug and evt.GetPosition() < 250:
|
||||
evt.SetDragResult(wxDragNone) # prevent dropping at the begining of the buffer
|
||||
|
||||
|
||||
def OnDoDrop(self, evt):
|
||||
self.log.write("OnDoDrop: x,y=(%d, %d) pos: %d DragResult: %d\n"
|
||||
"\ttext: %s\n"
|
||||
% (evt.GetX(), evt.GetY(), evt.GetPosition(), evt.GetDragResult(),
|
||||
evt.GetDragText()))
|
||||
|
||||
if debug and evt.GetPosition() < 500:
|
||||
evt.SetDragText("DROPPED TEXT") # Can change text if needed
|
||||
##evt.SetDragResult(wxDragNone) # Can also change the drag operation, but it
|
||||
# is probably better to do it in OnDragOver so
|
||||
# there is visual feedback
|
||||
|
||||
##evt.SetPosition(25) # Can also change position, but I'm not sure why
|
||||
# you would want to...
|
||||
|
||||
|
||||
|
||||
|
||||
def OnModified(self, evt):
|
||||
self.log.write("""OnModified
|
||||
Mod type: %s
|
||||
@@ -67,6 +109,7 @@ class MySTC(wxStyledTextCtrl):
|
||||
evt.GetLength(),
|
||||
evt.GetText() ))
|
||||
|
||||
|
||||
def transModType(self, modType):
|
||||
st = ""
|
||||
table = [(wxSTC_MOD_INSERTTEXT, "InsertText"),
|
||||
@@ -93,6 +136,7 @@ class MySTC(wxStyledTextCtrl):
|
||||
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
_USE_PANEL = 1
|
||||
@@ -168,7 +212,7 @@ def runTest(frame, nb, log):
|
||||
ed.SetStyling(10, wxSTC_INDIC2_MASK | wxSTC_INDIC1_MASK)
|
||||
|
||||
# some test stuff...
|
||||
if 1:
|
||||
if debug:
|
||||
print "GetTextLength(): ", ed.GetTextLength(), len(ed.GetText())
|
||||
print "GetText(): ", repr(ed.GetText())
|
||||
print
|
||||
|
@@ -116,7 +116,7 @@ class PythonSTC(wxStyledTextCtrl):
|
||||
|
||||
self.SetCaretForeground("BLUE")
|
||||
|
||||
EVT_KEY_UP(self, self.OnKeyPressed)
|
||||
EVT_KEY_DOWN(self, self.OnKeyPressed)
|
||||
|
||||
|
||||
def OnKeyPressed(self, event):
|
||||
|
Reference in New Issue
Block a user