X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/60104cbafa4502c7592801ccb8507f779c5601cf..5cce8340b28be2eecea1822434eeff7055840f9c:/src/generic/choicdgg.cpp diff --git a/src/generic/choicdgg.cpp b/src/generic/choicdgg.cpp index 62beddd961..2a77c9692e 100644 --- a/src/generic/choicdgg.cpp +++ b/src/generic/choicdgg.cpp @@ -32,16 +32,14 @@ #include "wx/dialog.h" #include "wx/button.h" #include "wx/listbox.h" + #include "wx/checklst.h" #include "wx/stattext.h" #include "wx/intl.h" #include "wx/sizer.h" #include "wx/arrstr.h" #endif -#if wxUSE_STATLINE - #include "wx/statline.h" -#endif - +#include "wx/statline.h" #include "wx/generic/choicdgg.h" // ---------------------------------------------------------------------------- @@ -262,15 +260,23 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent, styleDlg &= ~wxRESIZE_BORDER; styleDlg &= ~wxCAPTION; #endif - +#ifdef __WXMAC__ + if ( !wxDialog::Create(parent, wxID_ANY, caption, pos, wxDefaultSize, styleDlg & (~wxCANCEL) ) ) + return false; +#else if ( !wxDialog::Create(parent, wxID_ANY, caption, pos, wxDefaultSize, styleDlg) ) return false; +#endif wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); // 1) text message +#ifdef __WXMAC__ + // align text and list at least on mac + topsizer->Add( CreateTextSizer( message ), 0, wxALL, wxLARGESMALL(15,0) ); +#else topsizer->Add( CreateTextSizer( message ), 0, wxALL, wxLARGESMALL(10,0) ); - +#endif // 2) list box m_listbox = CreateList(n,choices,styleLbox); @@ -279,22 +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__ - -#if wxUSE_STATLINE - // 3) static line - topsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); -#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 );