remove duplicated HitTest implementation from wxCheckListBox, it already inherits wxListBox::HitTest() (which was however lacking an overload taking 2 coordinates, added now)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58406 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -91,8 +91,10 @@ public:
|
||||
// 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;
|
||||
|
@@ -64,10 +64,6 @@ public:
|
||||
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; }
|
||||
|
||||
@@ -77,9 +73,6 @@ public:
|
||||
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);
|
||||
|
@@ -171,6 +171,7 @@ public:
|
||||
*/
|
||||
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.
|
||||
@@ -186,6 +187,8 @@ public:
|
||||
@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.
|
||||
|
@@ -508,20 +508,6 @@ void wxCheckListBox::OnLeftClick(wxMouseEvent& event)
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
@@ -530,4 +516,4 @@ wxSize wxCheckListBox::DoGetBestSize() const
|
||||
return best;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // wxUSE_CHECKLISTBOX
|
||||
|
Reference in New Issue
Block a user