Fix wxSTC compilation without wxUSE_DRAG_AND_DROP after r65827.

Correct the changes of r65827 to also compile with wxUSE_DRAG_AND_DROP==0
(especially important for the ports without dnd support such as wxX11 and
wxDFB).

Also do the changes in the correct files, i.e. src/stc/stc.{h,cpp}.in and not
in the generated files themselves to prevent them from being overwritten the
next time gen_iface.py is ran.

Finally keep backwards compatibility as SetDragAllowMove(bool) is a public
method so preserve its old semantics and add a new SetDragFlags() instead of
silently breaking the existing code using SetDragAllowMove().

See #11709.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65840 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-10-17 18:17:30 +00:00
parent 5f8bf0ee6f
commit 35f8d83dbb
5 changed files with 48 additions and 26 deletions

View File

@@ -4325,10 +4325,20 @@ 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(int val) { m_dragAllowMove = val; }
#ifdef STC_USE_DND
void SetDragText(const wxString& val) { m_dragText = val; }
void SetDragFlags(int flags) { m_dragFlags = flags; }
void SetDragResult(wxDragResult val) { m_dragResult = val; }
// This method is kept mainly for backwards compatibility, use
// SetDragFlags() in the new code.
void SetDragAllowMove(bool allow)
{
if ( allow )
m_dragFlags |= wxDrag_AllowMove;
else
m_dragFlags &= ~(wxDrag_AllowMove | wxDrag_DefaultMove);
}
#endif
int GetPosition() const { return m_position; }
@@ -4348,10 +4358,12 @@ public:
int GetListType() const { return m_listType; }
int GetX() const { return m_x; }
int GetY() const { return m_y; }
wxString GetDragText() { return m_dragText; }
int GetDragAllowMove() { return m_dragAllowMove; }
#ifdef STC_USE_DND
wxString GetDragText() { return m_dragText; }
int GetDragFlags() { return m_dragFlags; }
wxDragResult GetDragResult() { return m_dragResult; }
bool GetDragAllowMove() { return (GetDragFlags() & wxDrag_AllowMove) != 0; }
#endif
bool GetShift() const;
@@ -4386,11 +4398,10 @@ private:
int m_x;
int m_y;
wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
int m_dragAllowMove; // wxEVT_STC_START_DRAG
#if wxUSE_DRAG_AND_DROP
wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
int m_dragFlags; // wxEVT_STC_START_DRAG
wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
#endif
#endif
};