]> git.saurik.com Git - wxWidgets.git/commitdiff
Correct positioning of the entry text dialog.
authorWłodzimierz Skiba <abx@abx.art.pl>
Thu, 9 Sep 2004 14:14:20 +0000 (14:14 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Thu, 9 Sep 2004 14:14:20 +0000 (14:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29056 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/textdlgg.h
src/common/utilscmn.cpp
src/generic/textdlgg.cpp

index b255dd89a46e3a7227b6f6d69bb150f0de4d6be6..f39a29b6387e0ec253ca641619cb99d8aab86186 100644 (file)
@@ -78,8 +78,8 @@ wxGetTextFromUser(const wxString& message,
                   const wxString& caption = wxGetTextFromUserPromptStr,
                   const wxString& default_value = wxEmptyString,
                   wxWindow *parent = (wxWindow *) NULL,
-                  int x = wxDefaultCoord,
-                  int y = wxDefaultCoord,
+                  wxCoord x = wxDefaultCoord,
+                  wxCoord y = wxDefaultCoord,
                   bool centre = true);
 
 wxString WXDLLEXPORT
index 268fdd05f16faaae55da1706a059083d401f52cc..6c7f69d3b93cd3a437545985fdf2645eacb96903 100644 (file)
@@ -19,7 +19,7 @@
 
 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) && !defined(__EMX__)
 // Some older compilers (such as EMX) cannot handle
-// #pragma interface/implementation correctly, iff 
+// #pragma interface/implementation correctly, iff
 // #pragma implementation is used in _two_ translation
 // units (as created by e.g. event.cpp compiled for
 // libwx_base and event.cpp compiled for libwx_gui_core).
@@ -788,10 +788,18 @@ int wxMessageBox(const wxString& message, const wxString& caption, long style,
 
 wxString wxGetTextFromUser(const wxString& message, const wxString& caption,
                         const wxString& defaultValue, wxWindow *parent,
-                        int x, int y, bool WXUNUSED(centre) )
+                        wxCoord x, wxCoord y, bool centre )
 {
     wxString str;
-    wxTextEntryDialog dialog(parent, message, caption, defaultValue, wxOK|wxCANCEL, wxPoint(x, y));
+    long style = wxTextEntryDialogStyle;
+
+    if (centre)
+        style |= wxCENTRE;
+    else
+        style &= ~wxCENTRE;
+
+    wxTextEntryDialog dialog(parent, message, caption, defaultValue, style, wxPoint(x, y));
+
     if (dialog.ShowModal() == wxID_OK)
     {
         str = dialog.GetValue();
index 46b3f6ea66b3cd82dd4ad3ffac1e130786757aa7..cc2c28ebd70f548a30a8bb9c630831ad08a296bb 100644 (file)
@@ -112,7 +112,8 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent,
     topsizer->SetSizeHints( this );
     topsizer->Fit( this );
 
-    Centre( wxBOTH );
+    if ( ( style & wxCENTRE ) == wxCENTRE )
+        Centre( wxBOTH );
 
     m_textctrl->SetSelection(-1, -1);
     m_textctrl->SetFocus();