X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fbfb8bcc3fa17e079d4219655b173f8ed2ccc65a..f830b2b1fc8dfb094db2274b49d7ce9b882bccc4:/src/generic/textdlgg.cpp diff --git a/src/generic/textdlgg.cpp b/src/generic/textdlgg.cpp index 9b6ea31e90..bc1d4d2eb4 100644 --- a/src/generic/textdlgg.cpp +++ b/src/generic/textdlgg.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: textdlgg.cpp +// Name: src/generic/textdlgg.cpp // Purpose: wxTextEntryDialog // Author: Julian Smart // Modified by: @@ -96,7 +96,7 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, #if wxUSE_STATTEXT // 1) text message topsizer->Add( CreateTextSizer( message ), 0, wxALL, wxLARGESMALL(10,0) ); -#endif +#endif // 2) text ctrl m_textctrl = new wxTextCtrl(this, wxID_TEXT, value, @@ -107,25 +107,19 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, #if wxUSE_VALIDATORS wxTextValidator validator( wxFILTER_NONE, &m_value ); m_textctrl->SetValidator( validator ); -#endif - // wxUSE_VALIDATORS - - // smart phones does not support or do not waste space for wxButtons -#ifdef __SMARTPHONE__ - - SetRightMenu(wxID_CANCEL, _("Cancel")); - -#else // __SMARTPHONE__/!__SMARTPHONE__ - -#if wxUSE_STATLINE - // 3) static line - topsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); -#endif +#endif // wxUSE_VALIDATORS - // 4) buttons - topsizer->Add( CreateButtonSizer( style ), 0, wxEXPAND | wxALL, 10 ); - -#endif // !__SMARTPHONE__ + // 3) buttons if any + wxSizer *buttonSizer = CreateButtonSizer( style & ButtonSizerFlags , true, wxLARGESMALL(10,0) ); + if(buttonSizer->GetChildren().GetCount() > 0 ) + { + topsizer->Add( buttonSizer, 0, wxEXPAND | wxALL, wxLARGESMALL(10,0) ); + } + else + { + topsizer->AddSpacer( wxLARGESMALL(15,0) ); + delete buttonSizer; + } SetAutoLayout( true ); SetSizer( topsizer );