made wxTree/ListCtrl::HitTest() const
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39716 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
028285e4af
commit
be0e5d699f
@ -573,7 +573,7 @@ list or report views (this is a limitation of the native Win32 control).
|
||||
|
||||
\membersection{wxListCtrl::HitTest}\label{wxlistctrlhittest}
|
||||
|
||||
\func{long}{HitTest}{\param{const wxPoint\& }{point}, \param{int\& }{flags}, \param{long *}{ptrSubItem}}
|
||||
\constfunc{long}{HitTest}{\param{const wxPoint\& }{point}, \param{int\& }{flags}, \param{long *}{ptrSubItem}}
|
||||
|
||||
Determines which item (if any) is at the specified point,
|
||||
giving details in {\it flags}. Returns index of the item or {\tt wxNOT\_FOUND}
|
||||
|
@ -657,7 +657,7 @@ Returns the state image list (from which application-defined state images are ta
|
||||
|
||||
\membersection{wxTreeCtrl::HitTest}\label{wxtreectrlhittest}
|
||||
|
||||
\func{wxTreeItemId}{HitTest}{\param{const wxPoint\& }{point}, \param{int\& }{flags}}
|
||||
\constfunc{wxTreeItemId}{HitTest}{\param{const wxPoint\& }{point}, \param{int\& }{flags}}
|
||||
|
||||
Calculates which (if any) item is under the given point, returning the tree item
|
||||
id at this point plus extra information {\it flags}. {\it flags} is a bitlist of the following:
|
||||
|
@ -149,7 +149,7 @@ public:
|
||||
long FindItem( long start, const wxString& str, bool partial = false );
|
||||
long FindItem( long start, wxUIntPtr data );
|
||||
long FindItem( long start, const wxPoint& pt, int direction ); // not supported in wxGLC
|
||||
long HitTest( const wxPoint& point, int& flags, long *pSubItem = NULL );
|
||||
long HitTest( const wxPoint& point, int& flags, long *pSubItem = NULL ) const;
|
||||
long InsertItem(wxListItem& info);
|
||||
long InsertItem( long index, const wxString& label );
|
||||
long InsertItem( long index, int imageIndex );
|
||||
|
@ -304,7 +304,7 @@ protected:
|
||||
const wxString& text,
|
||||
int image = -1, int selImage = -1,
|
||||
wxTreeItemData *data = NULL);
|
||||
virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags);
|
||||
virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags) const;
|
||||
|
||||
// called by wxTextTreeCtrl when it marks itself for deletion
|
||||
void ResetTextControl();
|
||||
|
@ -297,7 +297,7 @@ public:
|
||||
// Determines which item (if any) is at the specified point,
|
||||
// giving details in 'flags' (see wxLIST_HITTEST_... flags above)
|
||||
// Request the subitem number as well at the given coordinate.
|
||||
long HitTest(const wxPoint& point, int& flags, long* ptrSubItem = NULL);
|
||||
long HitTest(const wxPoint& point, int& flags, long* ptrSubItem = NULL) const;
|
||||
|
||||
// Inserts an item, returning the index of the new item if successful,
|
||||
// -1 otherwise.
|
||||
|
@ -257,7 +257,7 @@ protected:
|
||||
const wxString& text,
|
||||
int image = -1, int selImage = -1,
|
||||
wxTreeItemData *data = NULL);
|
||||
virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags);
|
||||
virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags) const;
|
||||
|
||||
// obtain the user data for the lParam member of TV_ITEM
|
||||
class wxTreeItemParam *GetItemParam(const wxTreeItemId& item) const;
|
||||
|
@ -353,9 +353,9 @@ public:
|
||||
// coordinates specified are relative to the client area of tree ctrl)
|
||||
// and, in the second variant, fill the flags parameter with a bitmask
|
||||
// of wxTREE_HITTEST_xxx constants.
|
||||
wxTreeItemId HitTest(const wxPoint& point)
|
||||
wxTreeItemId HitTest(const wxPoint& point) const
|
||||
{ int dummy; return DoTreeHitTest(point, dummy); }
|
||||
wxTreeItemId HitTest(const wxPoint& point, int& flags)
|
||||
wxTreeItemId HitTest(const wxPoint& point, int& flags) const
|
||||
{ return DoTreeHitTest(point, flags); }
|
||||
|
||||
// get the bounding rectangle of the item (or of its label only)
|
||||
@ -398,7 +398,8 @@ protected:
|
||||
// real HitTest() implementation: again, can't be called just HitTest()
|
||||
// because it's overloaded and so the non-virtual overload would be hidden
|
||||
// (and can't be called DoHitTest() because this is already in wxWindow)
|
||||
virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags) = 0;
|
||||
virtual wxTreeItemId DoTreeHitTest(const wxPoint& point,
|
||||
int& flags) const = 0;
|
||||
|
||||
|
||||
wxImageList *m_imageListNormal, // images for tree elements
|
||||
|
@ -707,7 +707,7 @@ public:
|
||||
long FindItem( long start, const wxString& str, bool partial = false );
|
||||
long FindItem( long start, wxUIntPtr data);
|
||||
long FindItem( const wxPoint& pt );
|
||||
long HitTest( int x, int y, int &flags );
|
||||
long HitTest( int x, int y, int &flags ) const;
|
||||
void InsertItem( wxListItem &item );
|
||||
void InsertColumn( long col, wxListItem &item );
|
||||
int GetItemWidthWithImage(wxListItem * item);
|
||||
@ -4432,7 +4432,7 @@ long wxListMainWindow::FindItem( const wxPoint& pt )
|
||||
return wxNOT_FOUND;
|
||||
}
|
||||
|
||||
long wxListMainWindow::HitTest( int x, int y, int &flags )
|
||||
long wxListMainWindow::HitTest( int x, int y, int &flags ) const
|
||||
{
|
||||
CalcUnscrolledPosition( x, y, &x, &y );
|
||||
|
||||
@ -5257,7 +5257,7 @@ long wxGenericListCtrl::FindItem( long WXUNUSED(start), const wxPoint& pt,
|
||||
}
|
||||
|
||||
// TODO: sub item hit testing
|
||||
long wxGenericListCtrl::HitTest(const wxPoint& point, int& flags, long *)
|
||||
long wxGenericListCtrl::HitTest(const wxPoint& point, int& flags, long *) const
|
||||
{
|
||||
return m_mainWin->HitTest( (int)point.x, (int)point.y, flags );
|
||||
}
|
||||
|
@ -2852,11 +2852,9 @@ void wxGenericTreeCtrl::OnChar( wxKeyEvent &event )
|
||||
}
|
||||
}
|
||||
|
||||
wxTreeItemId wxGenericTreeCtrl::DoTreeHitTest(const wxPoint& point, int& flags)
|
||||
wxTreeItemId
|
||||
wxGenericTreeCtrl::DoTreeHitTest(const wxPoint& point, int& flags) const
|
||||
{
|
||||
// JACS: removed wxYieldIfNeeded() because it can cause the window
|
||||
// to be deleted from under us if a close window event is pending
|
||||
|
||||
int w, h;
|
||||
GetSize(&w, &h);
|
||||
flags=0;
|
||||
|
@ -1511,7 +1511,8 @@ long wxListCtrl::FindItem(long start, const wxPoint& pt, int direction)
|
||||
|
||||
// Determines which item (if any) is at the specified point,
|
||||
// giving details in 'flags' (see wxLIST_HITTEST_... flags above)
|
||||
long wxListCtrl::HitTest(const wxPoint& point, int& flags, long *ptrSubItem)
|
||||
long
|
||||
wxListCtrl::HitTest(const wxPoint& point, int& flags, long *ptrSubItem) const
|
||||
{
|
||||
LV_HITTESTINFO hitTestInfo;
|
||||
hitTestInfo.pt.x = (int) point.x;
|
||||
|
@ -1874,7 +1874,7 @@ void wxTreeCtrl::DoEndEditLabel(bool discardChanges)
|
||||
DeleteTextCtrl();
|
||||
}
|
||||
|
||||
wxTreeItemId wxTreeCtrl::DoTreeHitTest(const wxPoint& point, int& flags)
|
||||
wxTreeItemId wxTreeCtrl::DoTreeHitTest(const wxPoint& point, int& flags) const
|
||||
{
|
||||
TV_HITTESTINFO hitTestInfo;
|
||||
hitTestInfo.pt.x = (int)point.x;
|
||||
|
Loading…
Reference in New Issue
Block a user