X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2646f485163f410baaad5bcf49028c604a352d19..3d971ca9f1b59d2cda15569b7d87adbfec4e0475:/src/mac/classic/choice.cpp diff --git a/src/mac/classic/choice.cpp b/src/mac/classic/choice.cpp index 9f8494db9a..c608874704 100644 --- a/src/mac/classic/choice.cpp +++ b/src/mac/classic/choice.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: choice.cpp +// Name: src/mac/classic/choice.cpp // Purpose: wxChoice // Author: Stefan Csomor // Modified by: @@ -9,18 +9,15 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "choice.h" -#endif - #include "wx/defs.h" + +#if wxUSE_CHOICE + #include "wx/choice.h" #include "wx/menu.h" #include "wx/mac/uma.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl) -#endif extern MenuHandle NewUniqueMenu() ; @@ -67,7 +64,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id, Str255 title ; MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ; - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , -12345 , 0 , + m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , -12345 , 0 , kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ; m_macPopUpMenuHandle = NewUniqueMenu() ; @@ -82,7 +79,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id, { Append(choices[i]); } - return TRUE; + return true; } // ---------------------------------------------------------------------------- @@ -174,16 +171,6 @@ int wxChoice::GetCount() const return m_strings.GetCount() ; } -int wxChoice::FindString(const wxString& s) const -{ - for( int i = 0 ; i < GetCount() ; i++ ) - { - if ( GetString( i ).IsSameAs(s, FALSE) ) - return i ; - } - return wxNOT_FOUND ; -} - void wxChoice::SetString(int n, const wxString& s) { wxFAIL_MSG(wxT("wxChoice::SetString() not yet implemented")); @@ -195,7 +182,7 @@ void wxChoice::SetString(int n, const wxString& s) wxString wxChoice::GetString(int n) const { - wxCHECK_MSG( n >= 0 && (size_t)n < m_strings.GetCount(), _T(""), + wxCHECK_MSG( n >= 0 && (size_t)n < m_strings.GetCount(), wxEmptyString, _T("wxChoice::GetString(): invalid index") ); return m_strings[n] ; @@ -229,7 +216,7 @@ wxClientData* wxChoice::DoGetItemClientObject( int n ) const return (wxClientData *)DoGetItemClientData(n); } -void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED(mouseStillDown)) +void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED(mouseStillDown)) { wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId ); int n = GetSelection(); @@ -298,3 +285,5 @@ wxSize wxChoice::DoGetBestSize() const } return wxSize(lbWidth, lbHeight); } + +#endif // wxUSE_CHOICE