Added FindItemAtPoint
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24588 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -10,7 +10,11 @@ more than one row and/or column using \helpref{wxGBSpan}{wxgbspan}.
|
|||||||
|
|
||||||
\wxheading{Derived from}
|
\wxheading{Derived from}
|
||||||
|
|
||||||
\helpref{wxFlexGridSizer}{wxflexgridsizer}
|
\helpref{wxFlexGridSizer}{wxflexgridsizer}\\
|
||||||
|
\helpref{wxGridSizer}{wxgridsizer}\\
|
||||||
|
\helpref{wxSizer}{wxsizer}\\
|
||||||
|
\helpref{wxObject}{wxobject}
|
||||||
|
|
||||||
|
|
||||||
\wxheading{Include files}
|
\wxheading{Include files}
|
||||||
|
|
||||||
@@ -76,6 +80,17 @@ not found. (non-recursive)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\membersection{wxGridBagSizer::FindItemAtPoint}\label{wxgridbagsizerfinditematpoint}
|
||||||
|
|
||||||
|
\func{wxGBSizerItem*}{FindItemAtPoint}{\param{const wxPoint\& }{pt}}
|
||||||
|
|
||||||
|
Return the sizer item located at the point given in pt, or NULL if
|
||||||
|
there is no item at that point. The (x,y) coordinates in pt correspond
|
||||||
|
to the client coordinates of the window using the sizer for
|
||||||
|
layout. (non-recursive)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxGridBagSizer::FindItemAtPosition}\label{wxgridbagsizerfinditematposition}
|
\membersection{wxGridBagSizer::FindItemAtPosition}\label{wxgridbagsizerfinditematposition}
|
||||||
|
|
||||||
\func{wxGBSizerItem*}{FindItemAtPosition}{\param{const wxGBPosition\& }{pos}}
|
\func{wxGBSizerItem*}{FindItemAtPosition}{\param{const wxGBPosition\& }{pos}}
|
||||||
|
@@ -25,8 +25,8 @@
|
|||||||
// Classes to represent a position in the grid and a size of an item in the
|
// Classes to represent a position in the grid and a size of an item in the
|
||||||
// grid, IOW, the number of rows and columns it occupies. I chose to use these
|
// grid, IOW, the number of rows and columns it occupies. I chose to use these
|
||||||
// instead of wxPoint and wxSize because they are (x,y) and usually pixel
|
// instead of wxPoint and wxSize because they are (x,y) and usually pixel
|
||||||
// oriented whild grids and tables are usually thought of as (row,col) so some
|
// oriented while grids and tables are usually thought of as (row,col) so some
|
||||||
// confusion would definitly result in using wxPoint...
|
// confusion would definitely result in using wxPoint...
|
||||||
//
|
//
|
||||||
// NOTE: This should probably be refactored to a common RowCol data type which
|
// NOTE: This should probably be refactored to a common RowCol data type which
|
||||||
// is used for this and also for wxGridCellCoords.
|
// is used for this and also for wxGridCellCoords.
|
||||||
@@ -242,6 +242,13 @@ public:
|
|||||||
wxGBSizerItem* FindItemAtPosition(const wxGBPosition& pos);
|
wxGBSizerItem* FindItemAtPosition(const wxGBPosition& pos);
|
||||||
|
|
||||||
|
|
||||||
|
// Return the sizer item located at the point given in pt, or NULL if
|
||||||
|
// there is no item at that point. The (x,y) coordinates in pt correspond
|
||||||
|
// to the client coordinates of the window using the sizer for
|
||||||
|
// layout. (non-recursive)
|
||||||
|
wxGBSizerItem* FindItemAtPoint(const wxPoint& pt);
|
||||||
|
|
||||||
|
|
||||||
// Return the sizer item that has a matching user data (it only compares
|
// Return the sizer item that has a matching user data (it only compares
|
||||||
// pointer values) or NULL if not found. (non-recursive)
|
// pointer values) or NULL if not found. (non-recursive)
|
||||||
wxGBSizerItem* FindItemWithData(const wxObject* userData);
|
wxGBSizerItem* FindItemWithData(const wxObject* userData);
|
||||||
|
@@ -406,6 +406,24 @@ wxGBSizerItem* wxGridBagSizer::FindItemAtPosition(const wxGBPosition& pos)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
wxGBSizerItem* wxGridBagSizer::FindItemAtPoint(const wxPoint& pt)
|
||||||
|
{
|
||||||
|
wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
|
||||||
|
while (node)
|
||||||
|
{
|
||||||
|
wxGBSizerItem* item = (wxGBSizerItem*)node->GetData();
|
||||||
|
wxRect rect(item->GetPosition(), item->GetSize());
|
||||||
|
rect.Inflate(m_hgap, m_vgap);
|
||||||
|
if ( rect.Inside(pt) )
|
||||||
|
return item;
|
||||||
|
node = node->GetNext();
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wxGBSizerItem* wxGridBagSizer::FindItemWithData(const wxObject* userData)
|
wxGBSizerItem* wxGridBagSizer::FindItemWithData(const wxObject* userData)
|
||||||
{
|
{
|
||||||
wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
|
wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
|
||||||
|
Reference in New Issue
Block a user