+ Rect enclosingRect;
+ CGRect enclosingCGRect, iconCGRect, textCGRect;
+ int imgIndex = -1;
+ wxMacListCtrlItem* lcItem;
+
+ WXUNUSED_UNLESS_DEBUG( OSStatus status = ) m_dbImpl->GetItemPartBounds( id, kMinColumnId + column, kDataBrowserPropertyEnclosingPart, &enclosingRect );
+ wxASSERT( status == noErr );
+
+ enclosingCGRect = CGRectMake(enclosingRect.left,
+ enclosingRect.top,
+ enclosingRect.right - enclosingRect.left,
+ enclosingRect.bottom - enclosingRect.top);
+
+ if (column >= 0)
+ {
+ if ( !(GetWindowStyleFlag() & wxLC_VIRTUAL ) )
+ {
+ lcItem = (wxMacListCtrlItem*) id;
+ if (lcItem->HasColumnInfo(column))
+ {
+ wxListItem* item = lcItem->GetColumnInfo(column);
+
+ if (item->GetMask() & wxLIST_MASK_IMAGE)
+ {
+ imgIndex = item->GetImage();
+ }
+ }
+ }
+ else
+ {
+ long itemNum = (long)id-1;
+ if (itemNum >= 0 && itemNum < GetItemCount())
+ {
+ imgIndex = OnGetItemColumnImage( itemNum, column );
+ }
+ }
+ }
+
+ calculateCGDrawingBounds(enclosingCGRect, &iconCGRect, &textCGRect, (imgIndex != -1) );
+
+ if ( CGRectContainsPoint( iconCGRect, click_point ) )
+ {
+ flags = wxLIST_HITTEST_ONITEMICON;
+ if (ptrSubItem)
+ *ptrSubItem = column;
+ return row;
+ }
+ else if ( CGRectContainsPoint( textCGRect, click_point ) )
+ {
+ flags = wxLIST_HITTEST_ONITEMLABEL;
+ if (ptrSubItem)
+ *ptrSubItem = column;
+ return row;
+ }
+ }
+
+ if ( !(GetWindowStyleFlag() & wxLC_VIRTUAL ) )
+ {
+ wxMacListCtrlItem* lcItem;
+ lcItem = (wxMacListCtrlItem*) id;
+ if (lcItem)
+ {
+ flags = wxLIST_HITTEST_ONITEM;
+ if (ptrSubItem)
+ *ptrSubItem = column;
+ return row;
+ }
+ }
+ else
+ {
+ flags = wxLIST_HITTEST_ONITEM;
+ if (ptrSubItem)
+ *ptrSubItem = column;
+ return row;
+ }
+ }
+ else
+ {
+ if ( wxControl::HitTest( point ) )
+ flags = wxLIST_HITTEST_NOWHERE;
+ }