]> git.saurik.com Git - wxWidgets.git/commitdiff
Made wxPropertyGridHitTestResult a real class (works better that way with SWIG)
authorJaakko Salli <jaakko.salli@dnainternet.net>
Sun, 23 Aug 2009 18:38:13 +0000 (18:38 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Sun, 23 Aug 2009 18:38:13 +0000 (18:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/propgridpagestate.h
src/propgrid/propgridpagestate.cpp

index 3ebebcf9ce7afe622f773087a6f9031f9f4023a5..c38413477e23d1480145bbb4281f83935fdcb810 100644 (file)
     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;
 };
 
 // -----------------------------------------------------------------------
index 39765a7ee7cc66184f7839720f6532560a54c7a2..8f5d8a0325b968c6258406a94dab782994ea0b4f 100644 (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;
 }