Fixed event propagation problems in wxMac native list control
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@60636 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -117,7 +117,11 @@ wxMSW:
|
|||||||
- Fixed generation of wxEVT_CHAR_HOOK events.
|
- Fixed generation of wxEVT_CHAR_HOOK events.
|
||||||
- Implement wxFileName::SetTimes() for directories (Steve Lamerton).
|
- Implement wxFileName::SetTimes() for directories (Steve Lamerton).
|
||||||
|
|
||||||
|
wxMac:
|
||||||
|
|
||||||
|
- Fixed a problem with wxListCtrl whereby event processing would change
|
||||||
|
the event object identifier, and thereby affect subsequent processing,
|
||||||
|
and defeat custom event propagation of commands from current focus window.
|
||||||
|
|
||||||
2.8.10:
|
2.8.10:
|
||||||
-------
|
-------
|
||||||
|
@@ -303,6 +303,9 @@ wxMacListCtrlEventDelegate::wxMacListCtrlEventDelegate( wxListCtrl* list, int id
|
|||||||
|
|
||||||
bool wxMacListCtrlEventDelegate::ProcessEvent( wxEvent& event )
|
bool wxMacListCtrlEventDelegate::ProcessEvent( wxEvent& event )
|
||||||
{
|
{
|
||||||
|
int id = event.GetId();
|
||||||
|
wxObject* obj = event.GetEventObject();
|
||||||
|
|
||||||
// even though we use a generic list ctrl underneath, make sure
|
// even though we use a generic list ctrl underneath, make sure
|
||||||
// we present ourselves as wxListCtrl.
|
// we present ourselves as wxListCtrl.
|
||||||
event.SetEventObject( m_list );
|
event.SetEventObject( m_list );
|
||||||
@@ -311,9 +314,19 @@ bool wxMacListCtrlEventDelegate::ProcessEvent( wxEvent& event )
|
|||||||
if ( !event.IsKindOf( CLASSINFO( wxCommandEvent ) ) )
|
if ( !event.IsKindOf( CLASSINFO( wxCommandEvent ) ) )
|
||||||
{
|
{
|
||||||
if (m_list->GetEventHandler()->ProcessEvent( event ))
|
if (m_list->GetEventHandler()->ProcessEvent( event ))
|
||||||
|
{
|
||||||
|
event.SetId(id);
|
||||||
|
event.SetEventObject(obj);
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return wxEvtHandler::ProcessEvent(event);
|
// Also try with the original id
|
||||||
|
bool success = wxEvtHandler::ProcessEvent(event);
|
||||||
|
event.SetId(id);
|
||||||
|
event.SetEventObject(obj);
|
||||||
|
if (!success && id != m_id)
|
||||||
|
success = wxEvtHandler::ProcessEvent(event);
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user