]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/textdlgg.cpp
Added ability to switch off more components of the size page UI
[wxWidgets.git] / src / generic / textdlgg.cpp
index 50ea1ad378c70b41754b185d04ca26b129f08b04..b00d192f7bd02ab21af62ced1efb07e8e06dfd33 100644 (file)
@@ -65,17 +65,21 @@ END_EVENT_TABLE()
 
 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),
-                            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 | wxRESIZE_BORDER) )
+    {
+        return false;
+    }
+
     m_dialogStyle = style;
     m_value = value;
 
@@ -107,7 +111,7 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent,
 #endif // wxUSE_VALIDATORS
 
     // 3) buttons if any
-    wxSizer *buttonSizer = CreateSeparatedButtonSizer(style & ButtonSizerFlags);
+    wxSizer *buttonSizer = CreateSeparatedButtonSizer(style & (wxOK | wxCANCEL));
     if ( buttonSizer )
     {
         topsizer->Add(buttonSizer, wxSizerFlags(flagsBorder2).Expand());
@@ -122,10 +126,12 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent,
     if ( style & wxCENTRE )
         Centre( wxBOTH );
 
-    m_textctrl->SetSelection(-1, -1);
+    m_textctrl->SelectAll();
     m_textctrl->SetFocus();
 
     wxEndBusyCursor();
+
+    return true;
 }
 
 void wxTextEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event) )
@@ -151,7 +157,15 @@ void wxTextEntryDialog::SetValue(const wxString& val)
 }
 
 #if wxUSE_VALIDATORS
+
+#if WXWIN_COMPATIBILITY_2_8
 void wxTextEntryDialog::SetTextValidator( long style )
+{
+    SetTextValidator((wxTextValidatorStyle)style);
+}
+#endif
+
+void wxTextEntryDialog::SetTextValidator( wxTextValidatorStyle style )
 {
     wxTextValidator validator( style, &m_value );
     m_textctrl->SetValidator( validator );