]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/rearrangectrl.h
Make storing non-trivial data in wxThreadSpecificInfo possible.
[wxWidgets.git] / interface / wx / rearrangectrl.h
index 721fe1c15eb5cec96215ae40f522bf91ea07b113..fede1749eb2518674bfd895849d7f32ab2e35eb5 100644 (file)
@@ -3,9 +3,8 @@
 // Purpose:     interface of wxRearrangeList
 // Author:      Vadim Zeitlin
 // Created:     2008-12-15
-// RCS-ID:      $Id$
 // Copyright:   (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 /**
@@ -42,6 +41,8 @@
     is to use wxRearrangeCtrl which combines it with two standard buttons to
     move the current item up or down.
 
+    @since 2.9.0
+
     @library{wxcore}
     @category{ctrl}
 */
@@ -173,10 +174,12 @@ public:
     the "Up" and "Down" buttons to move the currently selected item up or down.
     It is used as the main part of a wxRearrangeDialog.
 
+    @since 2.9.0
+
     @library{wxcore}
     @category{ctrl}
  */
-class wxRearrangeCtrl
+class wxRearrangeCtrl : public wxPanel
 {
 public:
     /**
@@ -260,15 +263,38 @@ public:
         }
     @endcode
 
+    @since 2.9.0
+
     @library{wxcore}
     @category{cmndlg}
  */
-class wxRearrangeDialog
+class wxRearrangeDialog : public wxDialog
 {
 public:
+    /**
+        Default constructor.
+
+        Create() must be called later to effectively create the control.
+     */
+    wxRearrangeDialog();
+
     /**
         Constructor creating the dialog.
 
+        Please see Create() for the parameters description.
+     */
+    wxRearrangeDialog(wxWindow *parent,
+                      const wxString& message,
+                      const wxString& title,
+                      const wxArrayInt& order,
+                      const wxArrayString& items,
+                      const wxPoint& pos = wxDefaultPosition,
+                      const wxString& name = wxRearrangeDialogNameStr);
+
+    /**
+        Effectively creates the dialog for an object created using the default
+        constructor. 
+
         @param parent
             The dialog parent, possibly @NULL.
         @param message
@@ -284,14 +310,63 @@ public:
             Optional dialog position.
         @param name
             Optional dialog name.
+        @return
+            @true if the dialog was successfully created or @false if creation
+            failed.
      */
-    wxRearrangeDialog(wxWindow *parent,
-                      const wxString& message,
-                      const wxString& title,
-                      const wxArrayInt& order,
-                      const wxArrayString& items,
-                      const wxPoint& pos = wxDefaultPosition,
-                      const wxString& name = wxRearrangeDialogNameStr);
+    bool Create(wxWindow *parent,
+                const wxString& message,
+                const wxString& title,
+                const wxArrayInt& order,
+                const wxArrayString& items,
+                const wxPoint& pos = wxDefaultPosition,
+                const wxString& name = wxRearrangeDialogNameStr);
+
+    /**
+        Customize the dialog by adding extra controls to it.
+
+        This function adds the given @a win to the dialog, putting it just
+        below the part occupied by wxRearrangeCtrl. It must be called after
+        creating the dialog and you will typically need to process the events
+        generated by the extra controls for them to do something useful.
+
+        For example:
+        @code
+            class MyRearrangeDialog : public wxRearrangeDialog
+            {
+            public:
+                MyRearrangeDialog(wxWindow *parent, ...)
+                    : wxRearrangeDialog(parent, ...)
+                {
+                    wxPanel *panel = new wxPanel(this);
+                    wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
+                    sizer->Add(new wxStaticText(panel, wxID_ANY,
+                                                "Column width in pixels:"));
+                    sizer->Add(new wxTextCtrl(panel, wxID_ANY, ""));
+                    panel->SetSizer(sizer);
+                    AddExtraControls(panel);
+                }
+
+                ... code to update the text control with the currently selected
+                    item width and to react to its changes omitted ...
+            };
+        @endcode
+
+        See also the complete example of a custom rearrange dialog in the
+        dialogs sample.
+
+        @param win
+            The window containing the extra controls. It must have this dialog
+            as its parent.
+     */
+    void AddExtraControls(wxWindow *win);
+
+    /**
+        Return the list control used by the dialog.
+
+        @see wxRearrangeCtrl::GetList()
+     */
+    wxRearrangeList *GetList() const;
 
     /**
         Return the array describing the order of items after it was modified by