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:
Jaakko Salli
2009-08-23 18:38:13 +00:00
parent 1bfcd80c2f
commit 0ee316821c
2 changed files with 48 additions and 12 deletions

View File

@@ -23,25 +23,59 @@
A return value from wxPropertyGrid::HitTest(),
contains all you need to know about an arbitrary location on the grid.
*/
struct WXDLLIMPEXP_PROPGRID wxPropertyGridHitTestResult
class WXDLLIMPEXP_PROPGRID wxPropertyGridHitTestResult
{
friend class wxPropertyGridPageState;
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:
/** 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;
};
// -----------------------------------------------------------------------

View File

@@ -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;
result.column = HitTestH( pt.x, &result.splitter, &result.splitterHitOffset );
result.property = DoGetItemAtY( pt.y );
result.m_column = HitTestH( pt.x, &result.m_splitter,
&result.m_splitterHitOffset );
result.m_property = DoGetItemAtY( pt.y );
return result;
}