#include "wx/mac/uma.h"
+const short kTextColumnId = 1024 ;
+
// new databrowserbased version
// Listbox item
long ref = GetControlReference( browser ) ;
if ( ref )
{
- wxListBox* list = wxDynamicCast( ref , wxListBox ) ;
+ wxListBox* list = wxDynamicCast( (wxObject*) ref , wxListBox ) ;
for ( size_t i = 0 ; i < list->m_idArray.GetCount() ; ++i )
if ( list->m_idArray[i] == (long) itemID )
{
switch (property)
{
- case 1024:
+ case kTextColumnId:
{
long ref = GetControlReference( browser ) ;
if ( ref )
{
- wxListBox* list = wxDynamicCast( ref , wxListBox ) ;
+ wxListBox* list = wxDynamicCast( (wxObject*) ref , wxListBox ) ;
for ( size_t i = 0 ; i < list->m_idArray.GetCount() ; ++i )
if ( list->m_idArray[i] == (long) itemID )
{
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
Append( choices[i] ) ;
}
+ SetBestSize(size); // Needed because it is a wxControlWithItems
+
return TRUE;
}
void wxListBox::MacScrollTo( int n )
{
- // TODO implement scrolling
+ UInt32 id = m_idArray[n] ;
+ verify_noerr( ::RevealDataBrowserItem((ControlRef) m_macControl , id , kTextColumnId , kDataBrowserRevealWithoutSelecting ) ) ;
}
void wxListBox::OnSize( wxSizeEvent &event)