Correct positioning of the entry text dialog.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29056 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -78,8 +78,8 @@ wxGetTextFromUser(const wxString& message,
|
|||||||
const wxString& caption = wxGetTextFromUserPromptStr,
|
const wxString& caption = wxGetTextFromUserPromptStr,
|
||||||
const wxString& default_value = wxEmptyString,
|
const wxString& default_value = wxEmptyString,
|
||||||
wxWindow *parent = (wxWindow *) NULL,
|
wxWindow *parent = (wxWindow *) NULL,
|
||||||
int x = wxDefaultCoord,
|
wxCoord x = wxDefaultCoord,
|
||||||
int y = wxDefaultCoord,
|
wxCoord y = wxDefaultCoord,
|
||||||
bool centre = true);
|
bool centre = true);
|
||||||
|
|
||||||
wxString WXDLLEXPORT
|
wxString WXDLLEXPORT
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) && !defined(__EMX__)
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) && !defined(__EMX__)
|
||||||
// Some older compilers (such as EMX) cannot handle
|
// 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
|
// #pragma implementation is used in _two_ translation
|
||||||
// units (as created by e.g. event.cpp compiled for
|
// units (as created by e.g. event.cpp compiled for
|
||||||
// libwx_base and event.cpp compiled for libwx_gui_core).
|
// 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,
|
wxString wxGetTextFromUser(const wxString& message, const wxString& caption,
|
||||||
const wxString& defaultValue, wxWindow *parent,
|
const wxString& defaultValue, wxWindow *parent,
|
||||||
int x, int y, bool WXUNUSED(centre) )
|
wxCoord x, wxCoord y, bool centre )
|
||||||
{
|
{
|
||||||
wxString str;
|
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)
|
if (dialog.ShowModal() == wxID_OK)
|
||||||
{
|
{
|
||||||
str = dialog.GetValue();
|
str = dialog.GetValue();
|
||||||
|
@@ -112,7 +112,8 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent,
|
|||||||
topsizer->SetSizeHints( this );
|
topsizer->SetSizeHints( this );
|
||||||
topsizer->Fit( this );
|
topsizer->Fit( this );
|
||||||
|
|
||||||
Centre( wxBOTH );
|
if ( ( style & wxCENTRE ) == wxCENTRE )
|
||||||
|
Centre( wxBOTH );
|
||||||
|
|
||||||
m_textctrl->SetSelection(-1, -1);
|
m_textctrl->SetSelection(-1, -1);
|
||||||
m_textctrl->SetFocus();
|
m_textctrl->SetFocus();
|
||||||
|
Reference in New Issue
Block a user