class WXDLLIMPEXP_CORE wxTextEntryDialog : public wxDialog
{
public:
+ wxTextEntryDialog()
+ {
+ m_textctrl = NULL;
+ }
+
wxTextEntryDialog(wxWindow *parent,
const wxString& message,
const wxString& caption = wxGetTextFromUserPromptStr,
const wxString& value = wxEmptyString,
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);
wxString GetValue() const { return m_value; }
{
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
Parent window.
@param message
here.
@param pos
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& value = wxEmptyString,
long style = wxTextEntryDialogStyle,
IMPLEMENT_CLASS(wxTextEntryDialog, wxDialog)
-wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent,
+bool wxTextEntryDialog::Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxString& value,
long style,
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_value = value;
m_textctrl->SetFocus();
wxEndBusyCursor();
+
+ return true;
}
void wxTextEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event) )