X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2f1ae4143271ae63a17e052a1a471d16e9cd8c44..cd66f45bfebe5c37ee8ffbd7985d12511e6bb86c:/src/mac/carbon/choice.cpp?ds=inline diff --git a/src/mac/carbon/choice.cpp b/src/mac/carbon/choice.cpp index 1c36eef12d..6c8444fc8a 100644 --- a/src/mac/carbon/choice.cpp +++ b/src/mac/carbon/choice.cpp @@ -15,17 +15,26 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/choice.h" +#include "wx/menu.h" #include "wx/mac/uma.h" #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl) #endif +short nextMenuId = 100 ; // wxMenu takes the lower ids + +wxChoice::~wxChoice() +{ + // DeleteMenu( m_macPopUpMenuId ) ; + DisposeMenu( m_macPopUpMenuHandle ) ; +} + bool wxChoice::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - int n, const wxString choices[], - long style, + int n, const wxString choices[], + long style, const wxValidator& validator, const wxString& name) { @@ -35,6 +44,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id, MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ; + m_macPopUpMenuHandle = NewMenu( 1 , "\pPopUp Menu" ) ; m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , -12345 , 0 , kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ; @@ -66,6 +76,15 @@ void wxChoice::Append(const wxString& item) SetControlMaximum( m_macControl , Number()) ; } +void wxChoice::Append(const wxString &item, void *client_data) +{ +} + +void *wxChoice::GetClientData(int index) const +{ + return NULL; +} + void wxChoice::Delete(int n) { ::DeleteMenuItem( m_macPopUpMenuHandle , n + 1) ;