added default ctor and Create() to wxRearrangeDialog for consistency

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57688 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-12-31 13:27:28 +00:00
parent a37d94d3e1
commit ae7e6cc946
2 changed files with 51 additions and 8 deletions

View File

@@ -173,9 +173,25 @@ private:
class WXDLLIMPEXP_CORE wxRearrangeDialog : public wxDialog class WXDLLIMPEXP_CORE wxRearrangeDialog : public wxDialog
{ {
public: public:
// default ctor, use Create() later
wxRearrangeDialog() { Init(); }
// ctor for the dialog: message is shown inside the dialog itself, order // ctor for the dialog: message is shown inside the dialog itself, order
// and items are passed to wxRearrangeList used internally // and items are passed to wxRearrangeList used internally
wxRearrangeDialog(wxWindow *parent, wxRearrangeDialog(wxWindow *parent,
const wxString& message,
const wxString& title,
const wxArrayInt& order,
const wxArrayString& items,
const wxPoint& pos = wxDefaultPosition,
const wxString& name = wxRearrangeDialogNameStr)
{
Init();
Create(parent, message, title, order, items, pos, name);
}
bool Create(wxWindow *parent,
const wxString& message, const wxString& message,
const wxString& title, const wxString& title,
const wxArrayInt& order, const wxArrayInt& order,
@@ -188,6 +204,9 @@ public:
{ return m_ctrl->GetList()->GetCurrentOrder(); } { return m_ctrl->GetList()->GetCurrentOrder(); }
private: private:
// common part of all ctors
void Init() { m_ctrl = NULL; }
wxRearrangeCtrl *m_ctrl; wxRearrangeCtrl *m_ctrl;
DECLARE_NO_COPY_CLASS(wxRearrangeDialog) DECLARE_NO_COPY_CLASS(wxRearrangeDialog)

View File

@@ -266,9 +266,30 @@ public:
class wxRearrangeDialog class wxRearrangeDialog
{ {
public: public:
/**
Default constructor.
Create() must be called later to effectively create the control.
*/
wxRearrangeDialog();
/** /**
Constructor creating the dialog. 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 @param parent
The dialog parent, possibly @NULL. The dialog parent, possibly @NULL.
@param message @param message
@@ -284,8 +305,11 @@ public:
Optional dialog position. Optional dialog position.
@param name @param name
Optional dialog name. Optional dialog name.
@return
@true if the dialog was successfully created or @false if creation
failed.
*/ */
wxRearrangeDialog(wxWindow *parent, bool Create(wxWindow *parent,
const wxString& message, const wxString& message,
const wxString& title, const wxString& title,
const wxArrayInt& order, const wxArrayInt& order,