IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
BEGIN_EVENT_TABLE(wxListBox, wxControl)
-#if !TARGET_API_MAC_OSX
+#if !__WXMAC_OSX__
EVT_SIZE( wxListBox::OnSize )
EVT_CHAR( wxListBox::OnChar )
#endif
#include "wx/mac/uma.h"
+const short kTextColumnId = 1024 ;
+
// new databrowserbased version
// Listbox item
event.SetString( list->GetString(i) );
event.SetInt(i) ;
event.SetExtraLong( list->HasMultipleSelection() ? message == kDataBrowserItemSelected : TRUE );
- list->GetEventHandler()->ProcessEvent(event) ;
+ wxPostEvent( list->GetEventHandler() , event ) ;
+ // direct notification is not always having the listbox GetSelection() having in synch with event
+ // list->GetEventHandler()->ProcessEvent(event) ;
}
break ;
}
switch (property)
{
- case 1024:
+ case kTextColumnId:
{
long ref = GetControlReference( browser ) ;
if ( ref )
columnDesc.headerBtnDesc.btnFontStyle.style = normal;
columnDesc.headerBtnDesc.titleString = NULL ; // CFSTR( "" );
- columnDesc.propertyDesc.propertyID = 1024;
+ columnDesc.propertyDesc.propertyID = kTextColumnId;
columnDesc.propertyDesc.propertyType = kDataBrowserTextType;
columnDesc.propertyDesc.propertyFlags =
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
void wxListBox::MacScrollTo( int n )
{
- // TODO implement scrolling
+ UInt32 id = m_idArray[n] ;
+ verify_noerr( ::RevealDataBrowserItem((ControlRef) m_macControl , id , kTextColumnId , kDataBrowserRevealWithoutSelecting ) ) ;
}
+#if !TARGET_API_MAC_OSX
void wxListBox::OnSize( wxSizeEvent &event)
{
}
+#endif
void wxListBox::MacSetRedraw( bool doDraw )
{
*/
}
+#if !TARGET_API_MAC_OSX
+
void wxListBox::OnChar(wxKeyEvent& event)
{
// todo trigger proper events here
}
}
+#endif
+