Add two step creation to wxTextEntryDialog.
Add Create() method and default ctor for consistency with the other classes. See #14702. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72567 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -37,12 +37,27 @@ extern WXDLLIMPEXP_DATA_CORE(const char) wxGetPasswordFromUserPromptStr[];
|
|||||||
class WXDLLIMPEXP_CORE wxTextEntryDialog : public wxDialog
|
class WXDLLIMPEXP_CORE wxTextEntryDialog : public wxDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
wxTextEntryDialog()
|
||||||
|
{
|
||||||
|
m_textctrl = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
wxTextEntryDialog(wxWindow *parent,
|
wxTextEntryDialog(wxWindow *parent,
|
||||||
const wxString& message,
|
const wxString& message,
|
||||||
const wxString& caption = wxGetTextFromUserPromptStr,
|
const wxString& caption = wxGetTextFromUserPromptStr,
|
||||||
const wxString& value = wxEmptyString,
|
const wxString& value = wxEmptyString,
|
||||||
long style = wxTextEntryDialogStyle,
|
long style = wxTextEntryDialogStyle,
|
||||||
const wxPoint& pos = wxDefaultPosition);
|
const wxPoint& pos = wxDefaultPosition)
|
||||||
|
{
|
||||||
|
Create(parent, message, caption, value, style, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
const wxString& message,
|
||||||
|
const wxString& caption = wxGetTextFromUserPromptStr,
|
||||||
|
const wxString& value = wxEmptyString,
|
||||||
|
long style = wxTextEntryDialogStyle,
|
||||||
|
const wxPoint& pos = wxDefaultPosition);
|
||||||
|
|
||||||
void SetValue(const wxString& val);
|
void SetValue(const wxString& val);
|
||||||
wxString GetValue() const { return m_value; }
|
wxString GetValue() const { return m_value; }
|
||||||
|
@@ -78,8 +78,28 @@ class wxTextEntryDialog : public wxDialog
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
Constructor. Use ShowModal() to show the dialog.
|
Default constructor.
|
||||||
|
|
||||||
|
Call Create() to really create the dialog later.
|
||||||
|
|
||||||
|
@since 2.9.5
|
||||||
|
*/
|
||||||
|
wxTextEntryDialog();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Constructor.
|
||||||
|
|
||||||
|
Use ShowModal() to show the dialog.
|
||||||
|
|
||||||
|
See Create() method for parameter description.
|
||||||
|
*/
|
||||||
|
wxTextEntryDialog(wxWindow* parent, const wxString& message,
|
||||||
|
const wxString& caption = wxGetTextFromUserPromptStr,
|
||||||
|
const wxString& value = wxEmptyString,
|
||||||
|
long style = wxTextEntryDialogStyle,
|
||||||
|
const wxPoint& pos = wxDefaultPosition);
|
||||||
|
|
||||||
|
/**
|
||||||
@param parent
|
@param parent
|
||||||
Parent window.
|
Parent window.
|
||||||
@param message
|
@param message
|
||||||
@@ -95,8 +115,10 @@ public:
|
|||||||
here.
|
here.
|
||||||
@param pos
|
@param pos
|
||||||
Dialog position.
|
Dialog position.
|
||||||
|
|
||||||
|
@since 2.9.5
|
||||||
*/
|
*/
|
||||||
wxTextEntryDialog(wxWindow* parent, const wxString& message,
|
bool Create(wxWindow* parent, const wxString& message,
|
||||||
const wxString& caption = wxGetTextFromUserPromptStr,
|
const wxString& caption = wxGetTextFromUserPromptStr,
|
||||||
const wxString& value = wxEmptyString,
|
const wxString& value = wxEmptyString,
|
||||||
long style = wxTextEntryDialogStyle,
|
long style = wxTextEntryDialogStyle,
|
||||||
|
@@ -65,17 +65,21 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
IMPLEMENT_CLASS(wxTextEntryDialog, wxDialog)
|
IMPLEMENT_CLASS(wxTextEntryDialog, wxDialog)
|
||||||
|
|
||||||
wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent,
|
bool wxTextEntryDialog::Create(wxWindow *parent,
|
||||||
const wxString& message,
|
const wxString& message,
|
||||||
const wxString& caption,
|
const wxString& caption,
|
||||||
const wxString& value,
|
const wxString& value,
|
||||||
long style,
|
long style,
|
||||||
const wxPoint& pos)
|
const wxPoint& pos)
|
||||||
: wxDialog(GetParentForModalDialog(parent, style),
|
|
||||||
wxID_ANY, caption, pos, wxDefaultSize,
|
|
||||||
wxDEFAULT_DIALOG_STYLE),
|
|
||||||
m_value(value)
|
|
||||||
{
|
{
|
||||||
|
if ( !wxDialog::Create(GetParentForModalDialog(parent, style),
|
||||||
|
wxID_ANY, caption,
|
||||||
|
pos, wxDefaultSize,
|
||||||
|
wxDEFAULT_DIALOG_STYLE) )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
m_dialogStyle = style;
|
m_dialogStyle = style;
|
||||||
m_value = value;
|
m_value = value;
|
||||||
|
|
||||||
@@ -126,6 +130,8 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent,
|
|||||||
m_textctrl->SetFocus();
|
m_textctrl->SetFocus();
|
||||||
|
|
||||||
wxEndBusyCursor();
|
wxEndBusyCursor();
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTextEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event) )
|
void wxTextEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event) )
|
||||||
|
Reference in New Issue
Block a user