// event.GetExtraLong())
void Command(wxCommandEvent& event);
- // returns the item number at a point or wxNOT_FOUND
+ // return the index of the item at this position or wxNOT_FOUND
int HitTest(const wxPoint& point) const { return DoListHitTest(point); }
+ int HitTest(int x, int y) const { return DoListHitTest(wxPoint(x, y)); }
+
// For generating events in multiple and extended mode
wxArrayInt m_oldSelections;
virtual bool IsChecked(unsigned int uiIndex) const;
virtual void Check(unsigned int uiIndex, bool bCheck = true);
- // return the index of the item at this position or wxNOT_FOUND
- int HitTest(const wxPoint& pt) const { return DoHitTestItem(pt.x, pt.y); }
- int HitTest(wxCoord x, wxCoord y) const { return DoHitTestItem(x, y); }
-
// accessors
size_t GetItemHeight() const { return m_nItemHeight; }
virtual bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item);
protected:
- // this can't be called DoHitTest() because wxWindow already has this method
- int DoHitTestItem(wxCoord x, wxCoord y) const;
-
// pressing space or clicking the check box toggles the item
void OnKeyDown(wxKeyEvent& event);
void OnLeftClick(wxMouseEvent& event);
*/
virtual int GetSelections(wxArrayInt& selections) const;
+ //@{
/**
Returns the item located at @a point, or @c wxNOT_FOUND if there
is no item located at @a point.
@since 2.7.0
*/
int HitTest(const wxPoint& point) const;
+ int HitTest(int x, int y) const;
+ //@}
/**
Insert the given number of strings before the specified position.
}
}
-int wxCheckListBox::DoHitTestItem(wxCoord x, wxCoord y) const
-{
- int nItem = (int)::SendMessage
- (
- (HWND)GetHWND(),
- LB_ITEMFROMPOINT,
- 0,
- MAKELPARAM(x, y)
- );
-
- return nItem >= (int)m_noItems ? wxNOT_FOUND : nItem;
-}
-
-
wxSize wxCheckListBox::DoGetBestSize() const
{
wxSize best = wxListBox::DoGetBestSize();
return best;
}
-#endif
+#endif // wxUSE_CHECKLISTBOX