]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/rearrangectrl.h
Add wxDataViewRendererBase::GetEffectiveAlignment() and use it.
[wxWidgets.git] / include / wx / rearrangectrl.h
index 3a422d0ed1a63975f5a025de28eaeb0084f37e32..b54b04fa113b79af3f6d69c3201bc48716d3ae89 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     various controls for rearranging the items interactively
 // Author:      Vadim Zeitlin
 // Created:     2008-12-15
-// RCS-ID:      $Id$
 // Copyright:   (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 #define _WX_REARRANGECTRL_H_
 
 #include "wx/checklst.h"
+
+#if wxUSE_REARRANGECTRL
+
+#include "wx/panel.h"
+#include "wx/dialog.h"
+
 #include "wx/arrstr.h"
 
 extern WXDLLIMPEXP_DATA_CORE(const char) wxRearrangeListNameStr[];
@@ -103,7 +108,7 @@ private:
 
 
     DECLARE_EVENT_TABLE()
-    DECLARE_NO_COPY_CLASS(wxRearrangeList)
+    wxDECLARE_NO_COPY_CLASS(wxRearrangeList);
 };
 
 // ----------------------------------------------------------------------------
@@ -160,7 +165,7 @@ private:
 
 
     DECLARE_EVENT_TABLE()
-    DECLARE_NO_COPY_CLASS(wxRearrangeCtrl)
+    wxDECLARE_NO_COPY_CLASS(wxRearrangeCtrl);
 };
 
 // ----------------------------------------------------------------------------
@@ -170,6 +175,9 @@ private:
 class WXDLLIMPEXP_CORE wxRearrangeDialog : public wxDialog
 {
 public:
+    // default ctor, use Create() later
+    wxRearrangeDialog() { Init(); }
+
     // ctor for the dialog: message is shown inside the dialog itself, order
     // and items are passed to wxRearrangeList used internally
     wxRearrangeDialog(wxWindow *parent,
@@ -178,17 +186,47 @@ public:
                       const wxArrayInt& order,
                       const wxArrayString& items,
                       const wxPoint& pos = wxDefaultPosition,
-                      const wxString& name = wxRearrangeDialogNameStr);
+                      const wxString& name = wxRearrangeDialogNameStr)
+    {
+        Init();
+
+        Create(parent, message, title, order, items, pos, name);
+    }
+
+    bool Create(wxWindow *parent,
+                const wxString& message,
+                const wxString& title,
+                const wxArrayInt& order,
+                const wxArrayString& items,
+                const wxPoint& pos = wxDefaultPosition,
+                const wxString& name = wxRearrangeDialogNameStr);
+
+
+    // methods for the dialog customization
+
+    // add extra contents to the dialog below the wxRearrangeCtrl part: the
+    // given window (usually a wxPanel containing more control inside it) must
+    // have the dialog as its parent and will be inserted into it at the right
+    // place by this method
+    void AddExtraControls(wxWindow *win);
+
+    // return the wxRearrangeList control used by the dialog
+    wxRearrangeList *GetList() const;
+
 
     // get the order of items after it was modified by the user
-    wxArrayInt GetOrder() const
-        { return m_ctrl->GetList()->GetCurrentOrder(); }
+    wxArrayInt GetOrder() const;
 
 private:
+    // common part of all ctors
+    void Init() { m_ctrl = NULL; }
+
     wxRearrangeCtrl *m_ctrl;
 
-    DECLARE_NO_COPY_CLASS(wxRearrangeDialog)
+    wxDECLARE_NO_COPY_CLASS(wxRearrangeDialog);
 };
 
+#endif // wxUSE_REARRANGECTRL
+
 #endif // _WX_REARRANGECTRL_H_