X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b668a73527cd08aae1321bfb1c604c9b96fffbed..49a91764b57168d9f441578001b3206a7330ee70:/src/mac/carbon/choice.cpp?ds=sidebyside diff --git a/src/mac/carbon/choice.cpp b/src/mac/carbon/choice.cpp index 9c4e7d94a9..67aee1e928 100644 --- a/src/mac/carbon/choice.cpp +++ b/src/mac/carbon/choice.cpp @@ -13,7 +13,8 @@ #pragma implementation "choice.h" #endif -// For compilers that support precompilation, includes "wx.h". +#include "wx/defs.h" + #include "wx/choice.h" #include "wx/menu.h" #include "wx/mac/uma.h" @@ -27,7 +28,7 @@ short nextMenuId = 100 ; // wxMenu takes the lower ids wxChoice::~wxChoice() { // DeleteMenu( m_macPopUpMenuId ) ; - DisposeMenu( m_macPopUpMenuHandle ) ; + // DisposeMenu( m_macPopUpMenuHandle ) ; } bool wxChoice::Create(wxWindow *parent, wxWindowID id, @@ -44,7 +45,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id, MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ; - m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , -12345 , 0 , + m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , -12345 , 0 , kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ; m_macPopUpMenuHandle = NewMenu( 1 , "\pPopUp Menu" ) ; @@ -76,7 +77,7 @@ int wxChoice::DoAppend(const wxString& item) m_datas.Add( NULL ) ; int index = m_strings.GetCount() - 1 ; DoSetItemClientData( index , NULL ) ; - SetControlMaximum( m_macControl , Number()) ; + SetControlMaximum( m_macControl , GetCount()) ; return index ; } @@ -91,7 +92,8 @@ void wxChoice::Delete(int n) ::DeleteMenuItem( m_macPopUpMenuHandle , n + 1) ; m_strings.Remove( n ) ; - SetControlMaximum( m_macControl , Number()) ; + m_datas.Remove( n ) ; + SetControlMaximum( m_macControl , GetCount()) ; } void wxChoice::Clear() @@ -104,7 +106,7 @@ void wxChoice::Clear() } m_strings.Empty() ; m_datas.Empty() ; - SetControlMaximum( m_macControl , 0 ) ; + SetControlMaximum( m_macControl , 0 ) ; } void wxChoice::Free()