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;
};
// -----------------------------------------------------------------------
m_pIt = it.m_pIt;
m_pIt->IncRef();
}
-#ifndef SWIG
const wxPGVIterator& operator=( const wxPGVIterator& it )
{
if (this != &it)
}
return *this;
}
-#endif
void Next() { m_pIt->Next(); }
bool AtEnd() const { return m_pIt->m_it.AtEnd(); }
wxPGProperty* GetProperty() const { return m_pIt->m_it.GetProperty(); }
// -----------------------------------------------------------------------
-#ifndef SWIG
-// We won't need this class from wxPython
-
/** @class wxPropertyGridPageState
Contains low-level property page information (properties, column widths,
*/
virtual void DoSetSplitterPosition( int pos,
int splitterColumn = 0,
- bool allPages = false,
- bool fromAutoCenter = false );
+ int flags = 0 );
bool EnableCategories( bool enable );
return DoSelectProperty(NULL);
}
+ void DoRemoveFromSelection( wxPGProperty* prop );
+
+ void DoSetColumnProportion( unsigned int column, int proportion );
+
+ int DoGetColumnProportion( unsigned int column ) const
+ {
+ return m_columnProportions[column];
+ }
+
+ void ResetColumnSizes( int setSplitterFlags );
+
wxPropertyCategory* GetPropertyCategory( const wxPGProperty* p ) const;
wxPGProperty* GetPropertyByLabel( const wxString& name,
protected:
+ // Utility to check if two properties are visibly next to each other
+ bool ArePropertiesAdjacent( wxPGProperty* prop1,
+ wxPGProperty* prop2,
+ int iterFlags = wxPG_ITERATE_VISIBLE ) const;
+
int DoGetSplitterPosition( int splitterIndex = 0 ) const;
/** Returns column at x coordinate (in GetGrid()->GetPanel()).
/** List of column widths (first column does not include margin). */
wxArrayInt m_colWidths;
+ /** List of indices of columns the user can edit by clicking it. */
+ wxArrayInt m_editableColumns;
+
+ /** Column proportions */
+ wxArrayInt m_columnProportions;
+
double m_fSplitterX;
/** Most recently added category. */
unsigned char m_vhCalcPending;
+ /** True if splitter has been pre-set by the application. */
+ bool m_isSplitterPreSet;
+
+ /** Used to (temporarily) disable splitter centering. */
+ bool m_dontCenterSplitter;
+
private:
/** Only inits arrays, doesn't migrate things or such. */
void InitNonCatMode();
};
-#endif // #ifndef SWIG
-
// -----------------------------------------------------------------------
#endif // wxUSE_PROPGRID