bool wxMacListCtrlEventDelegate::ProcessEvent( wxEvent& event )
{
+ int id = event.GetId();
+ wxObject* obj = event.GetEventObject();
+
// even though we use a generic list ctrl underneath, make sure
// we present ourselves as wxListCtrl.
event.SetEventObject( m_list );
if ( !event.IsKindOf( CLASSINFO( wxCommandEvent ) ) )
{
- if (m_list->HandleWindowEvent( event ))
+ if (m_list->GetEventHandler()->ProcessEvent( event ))
+ {
+ event.SetId(id);
+ event.SetEventObject(obj);
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;
}
//-----------------------------------------------------------------------------
void wxListCtrl::OnDblClick(wxMouseEvent& event)
{
- m_current = -1;
+ if ( m_renameTimer->IsRunning() )
+ m_renameTimer->Stop();
event.Skip();
}
if (info.m_itemId >= 0 && info.m_itemId < GetItemCount())
{
m_dbImpl->MacGetColumnInfo(info.m_itemId, info.m_col, info);
+ // MacGetColumnInfo returns erroneous information in the state field, so zero it.
+ info.SetState(0);
if (info.GetMask() & wxLIST_MASK_STATE)
{
DataBrowserItemID id = (DataBrowserItemID)m_dbImpl->GetItemFromLine(info.m_itemId);
if ( !IsVirtual() )
id = (DataBrowserItemID)m_dbImpl->GetItemFromLine(line);
+ if ( (state & wxLIST_STATE_FOCUSED) && (m_current == line))
+ return line;
+
if ( (state == wxLIST_STATE_DONTCARE ) )
return line;
if ( !IsVirtual() )
id = (DataBrowserItemID)m_dbImpl->GetItemFromLine(line);
+ if ( (state & wxLIST_STATE_FOCUSED) && (m_current == line))
+ return line;
+
if ( (state == wxLIST_STATE_DONTCARE ) )
return line;
// Deletes all items
bool wxListCtrl::DeleteAllItems()
{
+ m_current = -1;
if (m_genericImpl)
return m_genericImpl->DeleteAllItems();
}
-bool wxListCtrl::SortItems(wxListCtrlCompare fn, long data)
+bool wxListCtrl::SortItems(wxListCtrlCompare fn, wxIntPtr data)
{
if (m_genericImpl)
return m_genericImpl->SortItems(fn, data);
int imgIndex = -1;
DataBrowserTableViewColumnIndex listColumn = 0;
- OSStatus err = GetColumnPosition( property, &listColumn );
+ GetColumnPosition( property, &listColumn );
wxListCtrl* list = wxDynamicCast( GetWXPeer() , wxListCtrl );
wxMacListCtrlItem* lcItem;