+ wxCHECK_RET( n >= 0 && (size_t)n < m_datas.GetCount(),
+ wxT("wxChoice::DoSetItemClientData: invalid index") );
+
+ m_datas[n] = (char*)clientData ;
+}
+
+void * wxChoice::DoGetItemClientData( int n ) const
+{
+ wxCHECK_MSG( n >= 0 && (size_t)n < m_datas.GetCount(), NULL,
+ wxT("wxChoice::DoGetClientData: invalid index") );
+
+ return (void *)m_datas[n];
+}
+
+void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
+{
+ DoSetItemClientData( n, clientData ) ;
+}
+
+wxClientData* wxChoice::DoGetItemClientObject( int n ) const
+{
+ return (wxClientData*)DoGetItemClientData( n ) ;
+}
+
+wxInt32 wxChoice::MacControlHit( WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF WXUNUSED(event) )
+{
+ wxCommandEvent event( wxEVT_COMMAND_CHOICE_SELECTED, m_windowId );
+
+ // actually n should be made sure by the os to be a valid selection, but ...
+ int n = GetSelection();
+ if ( n > -1 )
+ {
+ event.SetInt( n );
+ event.SetString( GetStringSelection() );
+ event.SetEventObject( this );
+
+ if ( HasClientObjectData() )
+ event.SetClientObject( GetClientObject( n ) );
+ else if ( HasClientUntypedData() )
+ event.SetClientData( GetClientData( n ) );
+
+ ProcessCommand( event );
+ }
+
+ return noErr ;