#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"
wxChoice::~wxChoice()
{
// DeleteMenu( m_macPopUpMenuId ) ;
- DisposeMenu( m_macPopUpMenuHandle ) ;
+ // DisposeMenu( m_macPopUpMenuHandle ) ;
}
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" ) ;
m_datas.Add( NULL ) ;
int index = m_strings.GetCount() - 1 ;
DoSetItemClientData( index , NULL ) ;
- SetControlMaximum( m_macControl , Number()) ;
+ SetControlMaximum( m_macControl , GetCount()) ;
return index ;
}
::DeleteMenuItem( m_macPopUpMenuHandle , n + 1) ;
m_strings.Remove( n ) ;
- SetControlMaximum( m_macControl , Number()) ;
+ m_datas.RemoveAt( n ) ;
+ SetControlMaximum( m_macControl , GetCount()) ;
}
void wxChoice::Clear()
}
m_strings.Empty() ;
m_datas.Empty() ;
- SetControlMaximum( m_macControl , 0 ) ;
+ SetControlMaximum( m_macControl , 0 ) ;
}
void wxChoice::Free()
event.SetString(GetStringSelection());
ProcessCommand(event);
}
+
+wxSize wxChoice::DoGetBestSize() const
+{
+ // TODO should modify this to take into account string length ala wxGTK
+ return wxSize(100,20);
+}
+
/*
void wxChoice::Command(wxCommandEvent & event)
{