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,
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);
// get the order of items after it was modified by the user
wxArrayInt GetOrder() const
{ return m_ctrl->GetList()->GetCurrentOrder(); }
private:
+ // common part of all ctors
+ void Init() { m_ctrl = NULL; }
+
wxRearrangeCtrl *m_ctrl;
DECLARE_NO_COPY_CLASS(wxRearrangeDialog)
class wxRearrangeDialog
{
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
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);
/**
Return the array describing the order of items after it was modified by