X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a319ce7d748f43a697c2e71bd22457b5c5384204..134d7051bf501b1c07ac6963b38203bcfce1b6d4:/src/generic/choicdgg.cpp?ds=sidebyside diff --git a/src/generic/choicdgg.cpp b/src/generic/choicdgg.cpp index d54c97ba64..5a8d6f2135 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" // ---------------------------------------------------------------------------- @@ -258,11 +255,6 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent, const wxPoint& pos, long styleLbox) { -#if defined(__SMARTPHONE__) || defined(__POCKETPC__) - styleDlg &= ~wxBORDER_MASK; - styleDlg &= ~wxRESIZE_BORDER; - styleDlg &= ~wxCAPTION; -#endif #ifdef __WXMAC__ if ( !wxDialog::Create(parent, wxID_ANY, caption, pos, wxDefaultSize, styleDlg & (~wxCANCEL) ) ) return false; @@ -288,35 +280,25 @@ 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 ); -#if !defined(__SMARTPHONE__) && !defined(__POCKETPC__) topsizer->SetSizeHints( this ); topsizer->Fit( this ); if ( styleDlg & wxCENTRE ) Centre(wxBOTH); -#endif m_listbox->SetFocus();