Made wxPropertyGridHitTestResult a real class (works better that way with SWIG)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -23,25 +23,59 @@
|
|||||||
A return value from wxPropertyGrid::HitTest(),
|
A return value from wxPropertyGrid::HitTest(),
|
||||||
contains all you need to know about an arbitrary location on the grid.
|
contains all you need to know about an arbitrary location on the grid.
|
||||||
*/
|
*/
|
||||||
struct WXDLLIMPEXP_PROPGRID wxPropertyGridHitTestResult
|
class WXDLLIMPEXP_PROPGRID wxPropertyGridHitTestResult
|
||||||
{
|
{
|
||||||
friend class wxPropertyGridPageState;
|
friend class wxPropertyGridPageState;
|
||||||
public:
|
public:
|
||||||
|
wxPropertyGridHitTestResult()
|
||||||
|
{
|
||||||
|
m_property = NULL;
|
||||||
|
m_column = -1;
|
||||||
|
m_splitter = -1;
|
||||||
|
m_splitterHitOffset = 0;
|
||||||
|
}
|
||||||
|
|
||||||
wxPGProperty* GetProperty() const { return property; }
|
~wxPropertyGridHitTestResult()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/** Column. -1 for margin. */
|
/**
|
||||||
int column;
|
Returns column hit. -1 for margin.
|
||||||
|
*/
|
||||||
|
int GetColumn() const { return m_column; }
|
||||||
|
|
||||||
/** Index of splitter hit, -1 for none. */
|
/**
|
||||||
int splitter;
|
Returns property hit. NULL if empty space below
|
||||||
|
properties was hit instead.
|
||||||
|
*/
|
||||||
|
wxPGProperty* GetProperty() const
|
||||||
|
{
|
||||||
|
return m_property;
|
||||||
|
}
|
||||||
|
|
||||||
/** If splitter hit, offset to that */
|
/**
|
||||||
int splitterHitOffset;
|
Returns index of splitter hit, -1 for none.
|
||||||
|
*/
|
||||||
|
int GetSplitter() const { return m_splitter; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
If splitter hit, then this member function
|
||||||
|
returns offset to the exact splitter position.
|
||||||
|
*/
|
||||||
|
int GetSplitterHitOffset() const { return m_splitterHitOffset; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** Property. NULL if empty space below properties was hit */
|
/** Property. NULL if empty space below properties was hit */
|
||||||
wxPGProperty* property;
|
wxPGProperty* m_property;
|
||||||
|
|
||||||
|
/** Column. -1 for margin. */
|
||||||
|
int m_column;
|
||||||
|
|
||||||
|
/** Index of splitter hit, -1 for none. */
|
||||||
|
int m_splitter;
|
||||||
|
|
||||||
|
/** If splitter hit, offset to that */
|
||||||
|
int m_splitterHitOffset;
|
||||||
};
|
};
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
@@ -733,11 +733,13 @@ wxPGProperty* wxPropertyGridPageState::DoGetItemAtY( int y ) const
|
|||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
wxPropertyGridHitTestResult wxPropertyGridPageState::HitTest( const wxPoint&pt ) const
|
wxPropertyGridHitTestResult
|
||||||
|
wxPropertyGridPageState::HitTest( const wxPoint&pt ) const
|
||||||
{
|
{
|
||||||
wxPropertyGridHitTestResult result;
|
wxPropertyGridHitTestResult result;
|
||||||
result.column = HitTestH( pt.x, &result.splitter, &result.splitterHitOffset );
|
result.m_column = HitTestH( pt.x, &result.m_splitter,
|
||||||
result.property = DoGetItemAtY( pt.y );
|
&result.m_splitterHitOffset );
|
||||||
|
result.m_property = DoGetItemAtY( pt.y );
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user