X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a319ce7d748f43a697c2e71bd22457b5c5384204..6945b5878c8d46a56f1a59f558837a0943492f3c:/src/generic/choicdgg.cpp diff --git a/src/generic/choicdgg.cpp b/src/generic/choicdgg.cpp index d54c97ba64..2a77c9692e 100644 --- a/src/generic/choicdgg.cpp +++ b/src/generic/choicdgg.cpp @@ -39,10 +39,7 @@ #include "wx/arrstr.h" #endif -#if wxUSE_STATLINE - #include "wx/statline.h" -#endif - +#include "wx/statline.h" #include "wx/generic/choicdgg.h" // ---------------------------------------------------------------------------- @@ -288,25 +285,17 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent, topsizer->Add( m_listbox, 1, wxEXPAND|wxLEFT|wxRIGHT, wxLARGESMALL(15,0) ); - // smart phones does not support or do not waste space for wxButtons -#ifdef __SMARTPHONE__ - - SetRightMenu(wxID_CANCEL, _("Cancel")); - -#else // __SMARTPHONE__/!__SMARTPHONE__ - - // Mac Human Interface Guidelines recommend not to use static lines as grouping elements -#ifndef __WXMAC__ -#if wxUSE_STATLINE - // 3) static line - topsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); -#endif -#endif - - // 4) buttons - topsizer->Add( CreateButtonSizer( styleDlg & (wxOK|wxCANCEL) ), 0, wxEXPAND | wxALL, 10 ); - -#endif // !__SMARTPHONE__ + // 3) buttons if any + wxSizer *buttonSizer = CreateButtonSizer( styleDlg & 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; + } SetSizer( topsizer );