First pass at wxPython for Mac (darwin only so far). It
builds but doesn't run yet. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12178 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
e6056257ab
commit
1bc3250868
@ -1661,9 +1661,11 @@ public:
|
|||||||
void SetListType(int val) { m_listType = val; }
|
void SetListType(int val) { m_listType = val; }
|
||||||
void SetX(int val) { m_x = val; }
|
void SetX(int val) { m_x = val; }
|
||||||
void SetY(int val) { m_y = val; }
|
void SetY(int val) { m_y = val; }
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
void SetDragText(const wxString& val) { m_dragText = val; }
|
void SetDragText(const wxString& val) { m_dragText = val; }
|
||||||
void SetDragAllowMove(bool val) { m_dragAllowMove = val; }
|
void SetDragAllowMove(bool val) { m_dragAllowMove = val; }
|
||||||
void SetDragResult(wxDragResult val) { m_dragResult = val; }
|
void SetDragResult(wxDragResult val) { m_dragResult = val; }
|
||||||
|
#endif
|
||||||
|
|
||||||
int GetPosition() const { return m_position; }
|
int GetPosition() const { return m_position; }
|
||||||
int GetKey() const { return m_key; }
|
int GetKey() const { return m_key; }
|
||||||
@ -1682,9 +1684,11 @@ public:
|
|||||||
int GetListType() const { return m_listType; }
|
int GetListType() const { return m_listType; }
|
||||||
int GetX() const { return m_x; }
|
int GetX() const { return m_x; }
|
||||||
int GetY() const { return m_y; }
|
int GetY() const { return m_y; }
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
wxString GetDragText() { return m_dragText; }
|
wxString GetDragText() { return m_dragText; }
|
||||||
bool GetDragAllowMove() { return m_dragAllowMove; }
|
bool GetDragAllowMove() { return m_dragAllowMove; }
|
||||||
wxDragResult GetDragResult() { return m_dragResult; }
|
wxDragResult GetDragResult() { return m_dragResult; }
|
||||||
|
#endif
|
||||||
|
|
||||||
bool GetShift() const;
|
bool GetShift() const;
|
||||||
bool GetControl() const;
|
bool GetControl() const;
|
||||||
@ -1718,11 +1722,13 @@ private:
|
|||||||
int m_x;
|
int m_x;
|
||||||
int m_y;
|
int m_y;
|
||||||
|
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
|
wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
|
||||||
bool m_dragAllowMove; // wxEVT_STC_START_DRAG
|
bool m_dragAllowMove; // wxEVT_STC_START_DRAG
|
||||||
|
|
||||||
wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
|
wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef SWIG
|
#ifndef SWIG
|
||||||
@ -1746,9 +1752,11 @@ BEGIN_DECLARE_EVENT_TYPES()
|
|||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED, 1666)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED, 1666)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART, 1667)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART, 1667)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLEND, 1668)
|
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_START_DRAG, 1669)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
|
||||||
|
#endif
|
||||||
END_DECLARE_EVENT_TYPES()
|
END_DECLARE_EVENT_TYPES()
|
||||||
#else
|
#else
|
||||||
enum {
|
enum {
|
||||||
@ -1771,9 +1779,11 @@ END_DECLARE_EVENT_TYPES()
|
|||||||
wxEVT_STC_URIDROPPED,
|
wxEVT_STC_URIDROPPED,
|
||||||
wxEVT_STC_DWELLSTART,
|
wxEVT_STC_DWELLSTART,
|
||||||
wxEVT_STC_DWELLEND,
|
wxEVT_STC_DWELLEND,
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
wxEVT_STC_START_DRAG,
|
wxEVT_STC_START_DRAG,
|
||||||
wxEVT_STC_DRAG_OVER,
|
wxEVT_STC_DRAG_OVER,
|
||||||
wxEVT_STC_DO_DROP,
|
wxEVT_STC_DO_DROP,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1801,10 +1811,11 @@ 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_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_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_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_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_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 ),
|
#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
|
#endif
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -44,7 +44,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
bool wxSTCDropTarget::OnDropText(wxCoord x, wxCoord y, const wxString& data) {
|
bool wxSTCDropTarget::OnDropText(wxCoord x, wxCoord y, const wxString& data) {
|
||||||
return swx->DoDropText(x, y, data);
|
return swx->DoDropText(x, y, data);
|
||||||
}
|
}
|
||||||
@ -60,6 +60,7 @@ wxDragResult wxSTCDropTarget::OnDragOver(wxCoord x, wxCoord y, wxDragResult def
|
|||||||
void wxSTCDropTarget::OnLeave() {
|
void wxSTCDropTarget::OnLeave() {
|
||||||
swx->DoDragLeave();
|
swx->DoDragLeave();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
class wxSTCCallTip : public wxWindow {
|
class wxSTCCallTip : public wxWindow {
|
||||||
@ -109,9 +110,11 @@ ScintillaWX::~ScintillaWX() {
|
|||||||
|
|
||||||
void ScintillaWX::Initialise() {
|
void ScintillaWX::Initialise() {
|
||||||
//ScintillaBase::Initialise();
|
//ScintillaBase::Initialise();
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
dropTarget = new wxSTCDropTarget;
|
dropTarget = new wxSTCDropTarget;
|
||||||
dropTarget->SetScintilla(this);
|
dropTarget->SetScintilla(this);
|
||||||
stc->SetDropTarget(dropTarget);
|
stc->SetDropTarget(dropTarget);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -121,6 +124,7 @@ void ScintillaWX::Finalise() {
|
|||||||
|
|
||||||
|
|
||||||
void ScintillaWX::StartDrag() {
|
void ScintillaWX::StartDrag() {
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
wxString dragText(drag.s, drag.len);
|
wxString dragText(drag.s, drag.len);
|
||||||
|
|
||||||
// Send an event to allow the drag text to be changed
|
// Send an event to allow the drag text to be changed
|
||||||
@ -146,6 +150,7 @@ void ScintillaWX::StartDrag() {
|
|||||||
inDragDrop = FALSE;
|
inDragDrop = FALSE;
|
||||||
SetDragPosition(invalidPosition);
|
SetDragPosition(invalidPosition);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -500,6 +505,7 @@ void ScintillaWX::DoOnListBox() {
|
|||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
|
bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
|
||||||
SetDragPosition(invalidPosition);
|
SetDragPosition(invalidPosition);
|
||||||
|
|
||||||
@ -551,7 +557,7 @@ wxDragResult ScintillaWX::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) {
|
|||||||
void ScintillaWX::DoDragLeave() {
|
void ScintillaWX::DoDragLeave() {
|
||||||
SetDragPosition(invalidPosition);
|
SetDragPosition(invalidPosition);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
// Redraw all of text area. This paint will not be abandoned.
|
// Redraw all of text area. This paint will not be abandoned.
|
||||||
|
@ -56,6 +56,7 @@ class ScintillaWX;
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// Helper classes
|
// Helper classes
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
class wxSTCDropTarget : public wxTextDropTarget {
|
class wxSTCDropTarget : public wxTextDropTarget {
|
||||||
public:
|
public:
|
||||||
void SetScintilla(ScintillaWX* swx) {
|
void SetScintilla(ScintillaWX* swx) {
|
||||||
@ -70,7 +71,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
ScintillaWX* swx;
|
ScintillaWX* swx;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
@ -124,10 +125,12 @@ public:
|
|||||||
int DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool* consumed);
|
int DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool* consumed);
|
||||||
void DoTick() { Tick(); }
|
void DoTick() { Tick(); }
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
bool DoDropText(long x, long y, const wxString& data);
|
bool DoDropText(long x, long y, const wxString& data);
|
||||||
wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def);
|
wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def);
|
||||||
wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
||||||
void DoDragLeave();
|
void DoDragLeave();
|
||||||
|
#endif
|
||||||
|
|
||||||
void DoCommand(int ID);
|
void DoCommand(int ID);
|
||||||
void DoContextMenu(Point pt);
|
void DoContextMenu(Point pt);
|
||||||
@ -145,8 +148,10 @@ private:
|
|||||||
bool capturedMouse;
|
bool capturedMouse;
|
||||||
wxStyledTextCtrl* stc;
|
wxStyledTextCtrl* stc;
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
wxSTCDropTarget* dropTarget;
|
wxSTCDropTarget* dropTarget;
|
||||||
wxDragResult dragResult;
|
wxDragResult dragResult;
|
||||||
|
#endif
|
||||||
int wheelRotation;
|
int wheelRotation;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -64,6 +64,28 @@
|
|||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define ColourID scColourID
|
||||||
|
#define FontID scFontID
|
||||||
|
#define SurfaceID scSurfaceID
|
||||||
|
#define WindowID scWindowID
|
||||||
|
#define MenuID scMenuID
|
||||||
|
#define Point scPoint
|
||||||
|
#define PRectangle scPRectangle
|
||||||
|
#define Colour scColour
|
||||||
|
#define ColourPair scColourPair
|
||||||
|
#define Window scWindow
|
||||||
|
#define Palette scPalette
|
||||||
|
#define Font scFont
|
||||||
|
#define Surface scSurface
|
||||||
|
#define Window scWindow
|
||||||
|
#define ListBox scListBox
|
||||||
|
#define Menu scMenu
|
||||||
|
#define Platform scPlatform
|
||||||
|
#define TextRange scTextRange
|
||||||
|
#define KeyMap scKeyMap
|
||||||
|
#define Style scStyle
|
||||||
|
|
||||||
|
|
||||||
// Underlying the implementation of the platform classes are platform specific types.
|
// Underlying the implementation of the platform classes are platform specific types.
|
||||||
// Sometimes these need to be passed around by client code so they are defined here
|
// Sometimes these need to be passed around by client code so they are defined here
|
||||||
|
|
||||||
|
@ -93,9 +93,11 @@ DEFINE_EVENT_TYPE( wxEVT_STC_USERLISTSELECTION )
|
|||||||
DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED )
|
DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
|
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
||||||
@ -2052,8 +2054,10 @@ wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType, int id)
|
|||||||
m_listType = 0;
|
m_listType = 0;
|
||||||
m_x = 0;
|
m_x = 0;
|
||||||
m_y = 0;
|
m_y = 0;
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
m_dragAllowMove = FALSE;
|
m_dragAllowMove = FALSE;
|
||||||
m_dragResult = wxDragNone;
|
m_dragResult = wxDragNone;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxStyledTextEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; }
|
bool wxStyledTextEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; }
|
||||||
@ -2085,9 +2089,11 @@ void wxStyledTextEvent::CopyObject(wxObject& obj) const {
|
|||||||
o->m_x = m_x;
|
o->m_x = m_x;
|
||||||
o->m_y = m_y;
|
o->m_y = m_y;
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
o->m_dragText = m_dragText;
|
o->m_dragText = m_dragText;
|
||||||
o->m_dragAllowMove =m_dragAllowMove;
|
o->m_dragAllowMove =m_dragAllowMove;
|
||||||
o->m_dragResult = m_dragResult;
|
o->m_dragResult = m_dragResult;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -93,9 +93,11 @@ DEFINE_EVENT_TYPE( wxEVT_STC_USERLISTSELECTION )
|
|||||||
DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED )
|
DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
|
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
||||||
@ -596,8 +598,10 @@ wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType, int id)
|
|||||||
m_listType = 0;
|
m_listType = 0;
|
||||||
m_x = 0;
|
m_x = 0;
|
||||||
m_y = 0;
|
m_y = 0;
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
m_dragAllowMove = FALSE;
|
m_dragAllowMove = FALSE;
|
||||||
m_dragResult = wxDragNone;
|
m_dragResult = wxDragNone;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxStyledTextEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; }
|
bool wxStyledTextEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; }
|
||||||
@ -629,9 +633,11 @@ void wxStyledTextEvent::CopyObject(wxObject& obj) const {
|
|||||||
o->m_x = m_x;
|
o->m_x = m_x;
|
||||||
o->m_y = m_y;
|
o->m_y = m_y;
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
o->m_dragText = m_dragText;
|
o->m_dragText = m_dragText;
|
||||||
o->m_dragAllowMove =m_dragAllowMove;
|
o->m_dragAllowMove =m_dragAllowMove;
|
||||||
o->m_dragResult = m_dragResult;
|
o->m_dragResult = m_dragResult;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -215,9 +215,11 @@ public:
|
|||||||
void SetListType(int val) { m_listType = val; }
|
void SetListType(int val) { m_listType = val; }
|
||||||
void SetX(int val) { m_x = val; }
|
void SetX(int val) { m_x = val; }
|
||||||
void SetY(int val) { m_y = val; }
|
void SetY(int val) { m_y = val; }
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
void SetDragText(const wxString& val) { m_dragText = val; }
|
void SetDragText(const wxString& val) { m_dragText = val; }
|
||||||
void SetDragAllowMove(bool val) { m_dragAllowMove = val; }
|
void SetDragAllowMove(bool val) { m_dragAllowMove = val; }
|
||||||
void SetDragResult(wxDragResult val) { m_dragResult = val; }
|
void SetDragResult(wxDragResult val) { m_dragResult = val; }
|
||||||
|
#endif
|
||||||
|
|
||||||
int GetPosition() const { return m_position; }
|
int GetPosition() const { return m_position; }
|
||||||
int GetKey() const { return m_key; }
|
int GetKey() const { return m_key; }
|
||||||
@ -236,9 +238,11 @@ public:
|
|||||||
int GetListType() const { return m_listType; }
|
int GetListType() const { return m_listType; }
|
||||||
int GetX() const { return m_x; }
|
int GetX() const { return m_x; }
|
||||||
int GetY() const { return m_y; }
|
int GetY() const { return m_y; }
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
wxString GetDragText() { return m_dragText; }
|
wxString GetDragText() { return m_dragText; }
|
||||||
bool GetDragAllowMove() { return m_dragAllowMove; }
|
bool GetDragAllowMove() { return m_dragAllowMove; }
|
||||||
wxDragResult GetDragResult() { return m_dragResult; }
|
wxDragResult GetDragResult() { return m_dragResult; }
|
||||||
|
#endif
|
||||||
|
|
||||||
bool GetShift() const;
|
bool GetShift() const;
|
||||||
bool GetControl() const;
|
bool GetControl() const;
|
||||||
@ -272,11 +276,13 @@ private:
|
|||||||
int m_x;
|
int m_x;
|
||||||
int m_y;
|
int m_y;
|
||||||
|
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
|
wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
|
||||||
bool m_dragAllowMove; // wxEVT_STC_START_DRAG
|
bool m_dragAllowMove; // wxEVT_STC_START_DRAG
|
||||||
|
|
||||||
wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
|
wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef SWIG
|
#ifndef SWIG
|
||||||
@ -300,9 +306,11 @@ BEGIN_DECLARE_EVENT_TYPES()
|
|||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED, 1666)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED, 1666)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART, 1667)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART, 1667)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLEND, 1668)
|
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_START_DRAG, 1669)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
|
||||||
|
#endif
|
||||||
END_DECLARE_EVENT_TYPES()
|
END_DECLARE_EVENT_TYPES()
|
||||||
#else
|
#else
|
||||||
enum {
|
enum {
|
||||||
@ -325,9 +333,11 @@ END_DECLARE_EVENT_TYPES()
|
|||||||
wxEVT_STC_URIDROPPED,
|
wxEVT_STC_URIDROPPED,
|
||||||
wxEVT_STC_DWELLSTART,
|
wxEVT_STC_DWELLSTART,
|
||||||
wxEVT_STC_DWELLEND,
|
wxEVT_STC_DWELLEND,
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
wxEVT_STC_START_DRAG,
|
wxEVT_STC_START_DRAG,
|
||||||
wxEVT_STC_DRAG_OVER,
|
wxEVT_STC_DRAG_OVER,
|
||||||
wxEVT_STC_DO_DROP,
|
wxEVT_STC_DO_DROP,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -355,10 +365,11 @@ 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_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_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_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_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_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 ),
|
#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
|
#endif
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -1661,9 +1661,11 @@ public:
|
|||||||
void SetListType(int val) { m_listType = val; }
|
void SetListType(int val) { m_listType = val; }
|
||||||
void SetX(int val) { m_x = val; }
|
void SetX(int val) { m_x = val; }
|
||||||
void SetY(int val) { m_y = val; }
|
void SetY(int val) { m_y = val; }
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
void SetDragText(const wxString& val) { m_dragText = val; }
|
void SetDragText(const wxString& val) { m_dragText = val; }
|
||||||
void SetDragAllowMove(bool val) { m_dragAllowMove = val; }
|
void SetDragAllowMove(bool val) { m_dragAllowMove = val; }
|
||||||
void SetDragResult(wxDragResult val) { m_dragResult = val; }
|
void SetDragResult(wxDragResult val) { m_dragResult = val; }
|
||||||
|
#endif
|
||||||
|
|
||||||
int GetPosition() const { return m_position; }
|
int GetPosition() const { return m_position; }
|
||||||
int GetKey() const { return m_key; }
|
int GetKey() const { return m_key; }
|
||||||
@ -1682,9 +1684,11 @@ public:
|
|||||||
int GetListType() const { return m_listType; }
|
int GetListType() const { return m_listType; }
|
||||||
int GetX() const { return m_x; }
|
int GetX() const { return m_x; }
|
||||||
int GetY() const { return m_y; }
|
int GetY() const { return m_y; }
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
wxString GetDragText() { return m_dragText; }
|
wxString GetDragText() { return m_dragText; }
|
||||||
bool GetDragAllowMove() { return m_dragAllowMove; }
|
bool GetDragAllowMove() { return m_dragAllowMove; }
|
||||||
wxDragResult GetDragResult() { return m_dragResult; }
|
wxDragResult GetDragResult() { return m_dragResult; }
|
||||||
|
#endif
|
||||||
|
|
||||||
bool GetShift() const;
|
bool GetShift() const;
|
||||||
bool GetControl() const;
|
bool GetControl() const;
|
||||||
@ -1718,11 +1722,13 @@ private:
|
|||||||
int m_x;
|
int m_x;
|
||||||
int m_y;
|
int m_y;
|
||||||
|
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
|
wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
|
||||||
bool m_dragAllowMove; // wxEVT_STC_START_DRAG
|
bool m_dragAllowMove; // wxEVT_STC_START_DRAG
|
||||||
|
|
||||||
wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
|
wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef SWIG
|
#ifndef SWIG
|
||||||
@ -1746,9 +1752,11 @@ BEGIN_DECLARE_EVENT_TYPES()
|
|||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED, 1666)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED, 1666)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART, 1667)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART, 1667)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLEND, 1668)
|
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_START_DRAG, 1669)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
|
||||||
|
#endif
|
||||||
END_DECLARE_EVENT_TYPES()
|
END_DECLARE_EVENT_TYPES()
|
||||||
#else
|
#else
|
||||||
enum {
|
enum {
|
||||||
@ -1771,9 +1779,11 @@ END_DECLARE_EVENT_TYPES()
|
|||||||
wxEVT_STC_URIDROPPED,
|
wxEVT_STC_URIDROPPED,
|
||||||
wxEVT_STC_DWELLSTART,
|
wxEVT_STC_DWELLSTART,
|
||||||
wxEVT_STC_DWELLEND,
|
wxEVT_STC_DWELLEND,
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
wxEVT_STC_START_DRAG,
|
wxEVT_STC_START_DRAG,
|
||||||
wxEVT_STC_DRAG_OVER,
|
wxEVT_STC_DRAG_OVER,
|
||||||
wxEVT_STC_DO_DROP,
|
wxEVT_STC_DO_DROP,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1801,10 +1811,11 @@ 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_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_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_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_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_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 ),
|
#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
|
#endif
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -44,7 +44,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
bool wxSTCDropTarget::OnDropText(wxCoord x, wxCoord y, const wxString& data) {
|
bool wxSTCDropTarget::OnDropText(wxCoord x, wxCoord y, const wxString& data) {
|
||||||
return swx->DoDropText(x, y, data);
|
return swx->DoDropText(x, y, data);
|
||||||
}
|
}
|
||||||
@ -60,6 +60,7 @@ wxDragResult wxSTCDropTarget::OnDragOver(wxCoord x, wxCoord y, wxDragResult def
|
|||||||
void wxSTCDropTarget::OnLeave() {
|
void wxSTCDropTarget::OnLeave() {
|
||||||
swx->DoDragLeave();
|
swx->DoDragLeave();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
class wxSTCCallTip : public wxWindow {
|
class wxSTCCallTip : public wxWindow {
|
||||||
@ -109,9 +110,11 @@ ScintillaWX::~ScintillaWX() {
|
|||||||
|
|
||||||
void ScintillaWX::Initialise() {
|
void ScintillaWX::Initialise() {
|
||||||
//ScintillaBase::Initialise();
|
//ScintillaBase::Initialise();
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
dropTarget = new wxSTCDropTarget;
|
dropTarget = new wxSTCDropTarget;
|
||||||
dropTarget->SetScintilla(this);
|
dropTarget->SetScintilla(this);
|
||||||
stc->SetDropTarget(dropTarget);
|
stc->SetDropTarget(dropTarget);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -121,6 +124,7 @@ void ScintillaWX::Finalise() {
|
|||||||
|
|
||||||
|
|
||||||
void ScintillaWX::StartDrag() {
|
void ScintillaWX::StartDrag() {
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
wxString dragText(drag.s, drag.len);
|
wxString dragText(drag.s, drag.len);
|
||||||
|
|
||||||
// Send an event to allow the drag text to be changed
|
// Send an event to allow the drag text to be changed
|
||||||
@ -146,6 +150,7 @@ void ScintillaWX::StartDrag() {
|
|||||||
inDragDrop = FALSE;
|
inDragDrop = FALSE;
|
||||||
SetDragPosition(invalidPosition);
|
SetDragPosition(invalidPosition);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -500,6 +505,7 @@ void ScintillaWX::DoOnListBox() {
|
|||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
|
bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
|
||||||
SetDragPosition(invalidPosition);
|
SetDragPosition(invalidPosition);
|
||||||
|
|
||||||
@ -551,7 +557,7 @@ wxDragResult ScintillaWX::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) {
|
|||||||
void ScintillaWX::DoDragLeave() {
|
void ScintillaWX::DoDragLeave() {
|
||||||
SetDragPosition(invalidPosition);
|
SetDragPosition(invalidPosition);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
// Redraw all of text area. This paint will not be abandoned.
|
// Redraw all of text area. This paint will not be abandoned.
|
||||||
|
@ -56,6 +56,7 @@ class ScintillaWX;
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// Helper classes
|
// Helper classes
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
class wxSTCDropTarget : public wxTextDropTarget {
|
class wxSTCDropTarget : public wxTextDropTarget {
|
||||||
public:
|
public:
|
||||||
void SetScintilla(ScintillaWX* swx) {
|
void SetScintilla(ScintillaWX* swx) {
|
||||||
@ -70,7 +71,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
ScintillaWX* swx;
|
ScintillaWX* swx;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
@ -124,10 +125,12 @@ public:
|
|||||||
int DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool* consumed);
|
int DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool* consumed);
|
||||||
void DoTick() { Tick(); }
|
void DoTick() { Tick(); }
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
bool DoDropText(long x, long y, const wxString& data);
|
bool DoDropText(long x, long y, const wxString& data);
|
||||||
wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def);
|
wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def);
|
||||||
wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
||||||
void DoDragLeave();
|
void DoDragLeave();
|
||||||
|
#endif
|
||||||
|
|
||||||
void DoCommand(int ID);
|
void DoCommand(int ID);
|
||||||
void DoContextMenu(Point pt);
|
void DoContextMenu(Point pt);
|
||||||
@ -145,8 +148,10 @@ private:
|
|||||||
bool capturedMouse;
|
bool capturedMouse;
|
||||||
wxStyledTextCtrl* stc;
|
wxStyledTextCtrl* stc;
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
wxSTCDropTarget* dropTarget;
|
wxSTCDropTarget* dropTarget;
|
||||||
wxDragResult dragResult;
|
wxDragResult dragResult;
|
||||||
|
#endif
|
||||||
int wheelRotation;
|
int wheelRotation;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -64,6 +64,28 @@
|
|||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define ColourID scColourID
|
||||||
|
#define FontID scFontID
|
||||||
|
#define SurfaceID scSurfaceID
|
||||||
|
#define WindowID scWindowID
|
||||||
|
#define MenuID scMenuID
|
||||||
|
#define Point scPoint
|
||||||
|
#define PRectangle scPRectangle
|
||||||
|
#define Colour scColour
|
||||||
|
#define ColourPair scColourPair
|
||||||
|
#define Window scWindow
|
||||||
|
#define Palette scPalette
|
||||||
|
#define Font scFont
|
||||||
|
#define Surface scSurface
|
||||||
|
#define Window scWindow
|
||||||
|
#define ListBox scListBox
|
||||||
|
#define Menu scMenu
|
||||||
|
#define Platform scPlatform
|
||||||
|
#define TextRange scTextRange
|
||||||
|
#define KeyMap scKeyMap
|
||||||
|
#define Style scStyle
|
||||||
|
|
||||||
|
|
||||||
// Underlying the implementation of the platform classes are platform specific types.
|
// Underlying the implementation of the platform classes are platform specific types.
|
||||||
// Sometimes these need to be passed around by client code so they are defined here
|
// Sometimes these need to be passed around by client code so they are defined here
|
||||||
|
|
||||||
|
@ -93,9 +93,11 @@ DEFINE_EVENT_TYPE( wxEVT_STC_USERLISTSELECTION )
|
|||||||
DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED )
|
DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
|
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
||||||
@ -2052,8 +2054,10 @@ wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType, int id)
|
|||||||
m_listType = 0;
|
m_listType = 0;
|
||||||
m_x = 0;
|
m_x = 0;
|
||||||
m_y = 0;
|
m_y = 0;
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
m_dragAllowMove = FALSE;
|
m_dragAllowMove = FALSE;
|
||||||
m_dragResult = wxDragNone;
|
m_dragResult = wxDragNone;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxStyledTextEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; }
|
bool wxStyledTextEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; }
|
||||||
@ -2085,9 +2089,11 @@ void wxStyledTextEvent::CopyObject(wxObject& obj) const {
|
|||||||
o->m_x = m_x;
|
o->m_x = m_x;
|
||||||
o->m_y = m_y;
|
o->m_y = m_y;
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
o->m_dragText = m_dragText;
|
o->m_dragText = m_dragText;
|
||||||
o->m_dragAllowMove =m_dragAllowMove;
|
o->m_dragAllowMove =m_dragAllowMove;
|
||||||
o->m_dragResult = m_dragResult;
|
o->m_dragResult = m_dragResult;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -93,9 +93,11 @@ DEFINE_EVENT_TYPE( wxEVT_STC_USERLISTSELECTION )
|
|||||||
DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED )
|
DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND )
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
|
DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
||||||
@ -596,8 +598,10 @@ wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType, int id)
|
|||||||
m_listType = 0;
|
m_listType = 0;
|
||||||
m_x = 0;
|
m_x = 0;
|
||||||
m_y = 0;
|
m_y = 0;
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
m_dragAllowMove = FALSE;
|
m_dragAllowMove = FALSE;
|
||||||
m_dragResult = wxDragNone;
|
m_dragResult = wxDragNone;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxStyledTextEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; }
|
bool wxStyledTextEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; }
|
||||||
@ -629,9 +633,11 @@ void wxStyledTextEvent::CopyObject(wxObject& obj) const {
|
|||||||
o->m_x = m_x;
|
o->m_x = m_x;
|
||||||
o->m_y = m_y;
|
o->m_y = m_y;
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
o->m_dragText = m_dragText;
|
o->m_dragText = m_dragText;
|
||||||
o->m_dragAllowMove =m_dragAllowMove;
|
o->m_dragAllowMove =m_dragAllowMove;
|
||||||
o->m_dragResult = m_dragResult;
|
o->m_dragResult = m_dragResult;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -215,9 +215,11 @@ public:
|
|||||||
void SetListType(int val) { m_listType = val; }
|
void SetListType(int val) { m_listType = val; }
|
||||||
void SetX(int val) { m_x = val; }
|
void SetX(int val) { m_x = val; }
|
||||||
void SetY(int val) { m_y = val; }
|
void SetY(int val) { m_y = val; }
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
void SetDragText(const wxString& val) { m_dragText = val; }
|
void SetDragText(const wxString& val) { m_dragText = val; }
|
||||||
void SetDragAllowMove(bool val) { m_dragAllowMove = val; }
|
void SetDragAllowMove(bool val) { m_dragAllowMove = val; }
|
||||||
void SetDragResult(wxDragResult val) { m_dragResult = val; }
|
void SetDragResult(wxDragResult val) { m_dragResult = val; }
|
||||||
|
#endif
|
||||||
|
|
||||||
int GetPosition() const { return m_position; }
|
int GetPosition() const { return m_position; }
|
||||||
int GetKey() const { return m_key; }
|
int GetKey() const { return m_key; }
|
||||||
@ -236,9 +238,11 @@ public:
|
|||||||
int GetListType() const { return m_listType; }
|
int GetListType() const { return m_listType; }
|
||||||
int GetX() const { return m_x; }
|
int GetX() const { return m_x; }
|
||||||
int GetY() const { return m_y; }
|
int GetY() const { return m_y; }
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
wxString GetDragText() { return m_dragText; }
|
wxString GetDragText() { return m_dragText; }
|
||||||
bool GetDragAllowMove() { return m_dragAllowMove; }
|
bool GetDragAllowMove() { return m_dragAllowMove; }
|
||||||
wxDragResult GetDragResult() { return m_dragResult; }
|
wxDragResult GetDragResult() { return m_dragResult; }
|
||||||
|
#endif
|
||||||
|
|
||||||
bool GetShift() const;
|
bool GetShift() const;
|
||||||
bool GetControl() const;
|
bool GetControl() const;
|
||||||
@ -272,11 +276,13 @@ private:
|
|||||||
int m_x;
|
int m_x;
|
||||||
int m_y;
|
int m_y;
|
||||||
|
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
|
wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
|
||||||
bool m_dragAllowMove; // wxEVT_STC_START_DRAG
|
bool m_dragAllowMove; // wxEVT_STC_START_DRAG
|
||||||
|
|
||||||
wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
|
wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef SWIG
|
#ifndef SWIG
|
||||||
@ -300,9 +306,11 @@ BEGIN_DECLARE_EVENT_TYPES()
|
|||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED, 1666)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED, 1666)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART, 1667)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART, 1667)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLEND, 1668)
|
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_START_DRAG, 1669)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
|
||||||
|
#endif
|
||||||
END_DECLARE_EVENT_TYPES()
|
END_DECLARE_EVENT_TYPES()
|
||||||
#else
|
#else
|
||||||
enum {
|
enum {
|
||||||
@ -325,9 +333,11 @@ END_DECLARE_EVENT_TYPES()
|
|||||||
wxEVT_STC_URIDROPPED,
|
wxEVT_STC_URIDROPPED,
|
||||||
wxEVT_STC_DWELLSTART,
|
wxEVT_STC_DWELLSTART,
|
||||||
wxEVT_STC_DWELLEND,
|
wxEVT_STC_DWELLEND,
|
||||||
|
#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP
|
||||||
wxEVT_STC_START_DRAG,
|
wxEVT_STC_START_DRAG,
|
||||||
wxEVT_STC_DRAG_OVER,
|
wxEVT_STC_DRAG_OVER,
|
||||||
wxEVT_STC_DO_DROP,
|
wxEVT_STC_DO_DROP,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -355,10 +365,11 @@ 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_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_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_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_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_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 ),
|
#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
|
#endif
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user