X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d79bd3eaf6fe173996b9fc71693891a11dabd96..31478355f8348d7dfb1c647919b62b224acfa8a0:/src/generic/choicdgg.cpp diff --git a/src/generic/choicdgg.cpp b/src/generic/choicdgg.cpp index a23450cfe4..695b283eef 100644 --- a/src/generic/choicdgg.cpp +++ b/src/generic/choicdgg.cpp @@ -6,7 +6,7 @@ // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) wxWindows team -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -39,6 +39,7 @@ #include "wx/stattext.h" #include "wx/intl.h" #include "wx/sizer.h" + #include "wx/arrstr.h" #endif #if wxUSE_STATLINE @@ -53,17 +54,6 @@ #define wxID_LISTBOX 3000 -#if defined(__WXMSW__) || defined(__WXMAC__) -#define wxCHOICEDLG_DIALOG_STYLE (wxDEFAULT_DIALOG_STYLE | \ - wxDIALOG_MODAL | \ - wxTAB_TRAVERSAL) -#else -#define wxCHOICEDLG_DIALOG_STYLE (wxDEFAULT_DIALOG_STYLE | \ - wxDIALOG_MODAL | \ - wxRESIZE_BORDER | \ - wxTAB_TRAVERSAL) -#endif - // ---------------------------------------------------------------------------- // private functions // ---------------------------------------------------------------------------- @@ -86,7 +76,7 @@ int ConvertWXArrayToC(const wxArrayString& aChoices, wxString **choices) for ( int i = 0; i < n; i++ ) { - (*choices)[i] = aChoices[i]; + (*choices)[i] = aChoices[i]; } return n; @@ -133,7 +123,7 @@ wxString wxGetSingleChoice( const wxString& message, // Overloaded for backward compatibility wxString wxGetSingleChoice( const wxString& message, const wxString& caption, - int n, char *choices[], + int n, wxChar *choices[], wxWindow *parent, int x, int y, bool centre, int width, int height ) @@ -317,12 +307,11 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent, const wxString& message, const wxString& caption, int n, const wxString *choices, - long WXUNUSED(styleDlg), // FIXME: why unused? + long styleDlg, const wxPoint& pos, long styleLbox) { - if ( !wxDialog::Create(parent, -1, caption, pos, wxDefaultSize, - wxCHOICEDLG_DIALOG_STYLE) ) + if ( !wxDialog::Create(parent, -1, caption, pos, wxDefaultSize, styleDlg) ) return FALSE; wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); @@ -346,7 +335,7 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent, #endif // 4) buttons - topsizer->Add( CreateButtonSizer( wxOK|wxCANCEL ), 0, wxCENTRE | wxALL, 10 ); + topsizer->Add( CreateButtonSizer( styleDlg & (wxOK|wxCANCEL) ), 0, wxCENTRE | wxALL, 10 ); SetAutoLayout( TRUE ); SetSizer( topsizer ); @@ -454,11 +443,8 @@ void wxSingleChoiceDialog::OnOK(wxCommandEvent& WXUNUSED(event)) { m_selection = m_listbox->GetSelection(); m_stringSelection = m_listbox->GetStringSelection(); - // TODO! -#ifndef __WXMOTIF__ if ( m_listbox->HasClientUntypedData() ) SetClientData(m_listbox->GetClientData(m_selection)); -#endif EndModal(wxID_OK); } @@ -467,11 +453,8 @@ void wxSingleChoiceDialog::OnListBoxDClick(wxCommandEvent& WXUNUSED(event)) m_selection = m_listbox->GetSelection(); m_stringSelection = m_listbox->GetStringSelection(); - // TODO! -#ifndef __WXMOTIF__ if ( m_listbox->HasClientUntypedData() ) SetClientData(m_listbox->GetClientData(m_selection)); -#endif EndModal(wxID_OK); } @@ -510,11 +493,6 @@ void wxMultiChoiceDialog::SetSelections(const wxArrayInt& selections) bool wxMultiChoiceDialog::TransferDataFromWindow() { - // VZ: I hate to do it but I can't fix wxMotif right now (FIXME) -#ifdef __WXMOTIF__ - #define IsSelected Selected -#endif - m_selections.Empty(); size_t count = m_listbox->GetCount(); for ( size_t n = 0; n < count; n++ )