Override CreateItem so wxListBox can turn its notifications into events.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2006-10-08 06:37:50 +00:00
parent ae50b288e0
commit e6fd62dd84
2 changed files with 11 additions and 2 deletions

View File

@@ -1054,6 +1054,8 @@ public:
wxMacDataBrowserListControl( wxWindow *peer, const wxPoint& pos, const wxSize& size, long style );
virtual ~wxMacDataBrowserListControl();
virtual wxMacDataItem* CreateItem();
// pointing back
wxWindow * GetPeer() const;

View File

@@ -503,10 +503,12 @@ void wxMacListBoxItem::Notification(wxMacDataItemBrowserControl *owner ,
event.SetString( m_label );
event.SetInt( owner->GetLineFromItem( this ) );
event.SetExtraLong( list->HasMultipleSelection() ? message == kDataBrowserItemSelected : true );
wxPostEvent( list->GetEventHandler(), event );
// direct notification is not always having the listbox GetSelection() having in synch with event
// direct notification is not always having the listbox GetSelection()
// having in synch with event, so use wxPostEvent instead
// list->GetEventHandler()->ProcessEvent(event);
wxPostEvent( list->GetEventHandler(), event );
}
}
@@ -602,6 +604,11 @@ wxWindow * wxMacDataBrowserListControl::GetPeer() const
return wxDynamicCast( wxMacControl::GetPeer() , wxWindow );
}
wxMacDataItem* wxMacDataBrowserListControl::CreateItem()
{
return new wxMacListBoxItem();
}
#if 0
// in case we need that one day