From e483dfcb9db3e6cfe88a380f3ef31445bde8ae7e Mon Sep 17 00:00:00 2001
From: Robert Roebling <robert@roebling.de>
Date: Sat, 22 Dec 2007 18:29:14 +0000
Subject: [PATCH] Added API for column reordering

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50906 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/dataviewcolumn.tex | 7 ++++---
 docs/latex/wx/dataviewctrl.tex   | 1 +
 include/wx/dataview.h            | 9 ++++++---
 src/common/datavcmn.cpp          | 1 +
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/docs/latex/wx/dataviewcolumn.tex b/docs/latex/wx/dataviewcolumn.tex
index a8c6b839fd..7bb5ed2d58 100644
--- a/docs/latex/wx/dataviewcolumn.tex
+++ b/docs/latex/wx/dataviewcolumn.tex
@@ -17,9 +17,10 @@ These flags define behaviour of the column:
 \begin{verbatim}
 enum wxDataViewColumnFlags
 {
-    wxDATAVIEW_COL_RESIZABLE  = 1,    // the user can resize the column
-    wxDATAVIEW_COL_SORTABLE   = 2,    // same as SetSortable()
-    wxDATAVIEW_COL_HIDDEN     = 4     // column is hidden
+    wxDATAVIEW_COL_RESIZABLE    = 1,    // the user can resize the column
+    wxDATAVIEW_COL_SORTABLE     = 2,    // same as SetSortable()
+    wxDATAVIEW_COL_REORDERABLE  = 4,    // column can be reordered
+    wxDATAVIEW_COL_HIDDEN       = 8     // column is hidden
 };
 \end{verbatim}
 }
diff --git a/docs/latex/wx/dataviewctrl.tex b/docs/latex/wx/dataviewctrl.tex
index a363a7c721..9f749c4e8a 100644
--- a/docs/latex/wx/dataviewctrl.tex
+++ b/docs/latex/wx/dataviewctrl.tex
@@ -65,6 +65,7 @@ macros to direct input to member functions that take a
 \twocolitem{{\bf EVT\_DATAVIEW\_COLUMN\_HEADER\_CLICK(id, func)}}{Processes a wxEVT\_COMMAND\_DATAVIEW\_COLUMN\_HEADER\_CLICKED event.}
 \twocolitem{{\bf EVT\_DATAVIEW\_COLUMN\_HEADER\_RIGHT\_CLICK(id, func)}}{Processes a wxEVT\_COMMAND\_DATAVIEW\_COLUMN\_HEADER\_RIGHT\_CLICKED event.}
 \twocolitem{{\bf EVT\_DATAVIEW\_COLUMN\_HEADER\_SORTED(id, func)}}{Processes a wxEVT\_COMMAND\_DATAVIEW\_COLUMN\_HEADER\_SORTED event.}
+\twocolitem{{\bf EVT\_DATAVIEW\_COLUMN\_REORDERED(id, func)}}{Processes a wxEVT\_COMMAND\_DATAVIEW\_COLUMN\_REORDERED event.}
 
 \end{twocollist}
 
diff --git a/include/wx/dataview.h b/include/wx/dataview.h
index 4cd43d4856..575251cf15 100644
--- a/include/wx/dataview.h
+++ b/include/wx/dataview.h
@@ -424,9 +424,10 @@ DECLARE_VARIANT_OBJECT_EXPORTED(wxDataViewIconText, WXDLLIMPEXP_ADV)
 
 enum wxDataViewColumnFlags
 {
-    wxDATAVIEW_COL_RESIZABLE  = 1,
-    wxDATAVIEW_COL_SORTABLE   = 2,
-    wxDATAVIEW_COL_HIDDEN     = 4
+    wxDATAVIEW_COL_RESIZABLE     = 1,
+    wxDATAVIEW_COL_SORTABLE      = 2,
+    wxDATAVIEW_COL_REORDERABLE   = 4,
+    wxDATAVIEW_COL_HIDDEN        = 8
 };
 
 class WXDLLIMPEXP_ADV wxDataViewColumnBase: public wxObject
@@ -744,6 +745,7 @@ BEGIN_DECLARE_EVENT_TYPES()
     DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK, -1)
     DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, -1)
     DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, -1)
+    DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED, -1)
 END_DECLARE_EVENT_TYPES()
 
 typedef void (wxEvtHandler::*wxDataViewEventFunction)(wxDataViewEvent&);
@@ -770,6 +772,7 @@ typedef void (wxEvtHandler::*wxDataViewEventFunction)(wxDataViewEvent&);
 #define EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_CLICK, id, fn)
 #define EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_RIGHT_CLICK, id, fn)
 #define EVT_DATAVIEW_COLUMN_SORTED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_SORTED, id, fn)
+#define EVT_DATAVIEW_COLUMN_REORDERED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_REORDERED, id, fn)
 
 #if defined(wxUSE_GENERICDATAVIEWCTRL)
     #include "wx/generic/dataview.h"
diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp
index a77fcb9387..27174d8963 100644
--- a/src/common/datavcmn.cpp
+++ b/src/common/datavcmn.cpp
@@ -1154,6 +1154,7 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED)
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED)
 
 
 // -------------------------------------
-- 
2.50.0

