]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/choice.cpp
Changed wxYield calls to wxYieldIfNeeded
[wxWidgets.git] / src / mac / carbon / choice.cpp
index 1c36eef12d4d13502c256e7bcfbac7672778fe66..6c8444fc8af4cd7851530de623ecbd8ab92601ef 100644 (file)
 
 // 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) ;