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:
@@ -1054,6 +1054,8 @@ public:
|
|||||||
wxMacDataBrowserListControl( wxWindow *peer, const wxPoint& pos, const wxSize& size, long style );
|
wxMacDataBrowserListControl( wxWindow *peer, const wxPoint& pos, const wxSize& size, long style );
|
||||||
virtual ~wxMacDataBrowserListControl();
|
virtual ~wxMacDataBrowserListControl();
|
||||||
|
|
||||||
|
virtual wxMacDataItem* CreateItem();
|
||||||
|
|
||||||
// pointing back
|
// pointing back
|
||||||
|
|
||||||
wxWindow * GetPeer() const;
|
wxWindow * GetPeer() const;
|
||||||
|
@@ -503,10 +503,12 @@ void wxMacListBoxItem::Notification(wxMacDataItemBrowserControl *owner ,
|
|||||||
event.SetString( m_label );
|
event.SetString( m_label );
|
||||||
event.SetInt( owner->GetLineFromItem( this ) );
|
event.SetInt( owner->GetLineFromItem( this ) );
|
||||||
event.SetExtraLong( list->HasMultipleSelection() ? message == kDataBrowserItemSelected : true );
|
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);
|
// list->GetEventHandler()->ProcessEvent(event);
|
||||||
|
|
||||||
|
wxPostEvent( list->GetEventHandler(), event );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,6 +604,11 @@ wxWindow * wxMacDataBrowserListControl::GetPeer() const
|
|||||||
return wxDynamicCast( wxMacControl::GetPeer() , wxWindow );
|
return wxDynamicCast( wxMacControl::GetPeer() , wxWindow );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxMacDataItem* wxMacDataBrowserListControl::CreateItem()
|
||||||
|
{
|
||||||
|
return new wxMacListBoxItem();
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
// in case we need that one day
|
// in case we need that one day
|
||||||
|
Reference in New Issue
Block a user