//
int GetDefaultRowSize() const;
int GetRowSize( int row ) const;
+ bool IsRowShown(int row) const { return GetRowSize(row) != 0; }
int GetDefaultColSize() const;
int GetColSize( int col ) const;
+ bool IsColShown(int col) const { return GetColSize(col) != 0; }
wxColour GetDefaultCellBackgroundColour() const;
wxColour GetCellBackgroundColour( int row, int col ) const;
wxColour GetDefaultCellTextColour() const;
return s;
}
+ // ------ row and col sizes
void SetDefaultRowSize( int height, bool resizeExistingRows = false );
void SetRowSize( int row, int height );
- void SetDefaultColSize( int width, bool resizeExistingCols = false );
+ void HideRow(int row) { SetRowSize(row, 0); }
+ void ShowRow(int row) { SetRowSize(row, -1); }
+ void SetDefaultColSize( int width, bool resizeExistingCols = false );
void SetColSize( int col, int width );
+ void HideCol(int col) { SetColSize(col, 0); }
+ void ShowCol(int col) { SetColSize(col, -1); }
+
+
+ // ------- columns (only, for now) reordering
// columns index <-> positions mapping: by default, the position of the
// column is the same as its index, but the columns can also be reordered
return wxNOT_FOUND;
}
+ // reset the columns positions to the default order
+ void ResetColPos();
// automatically size the column or row to fit to its contents, if
wxWindow* GetGridColLabelWindow() const { return m_colWindow; }
wxWindow* GetGridCornerLabelWindow() const { return (wxWindow*)m_cornerLabelWin; }
+ // This one can only be called if we are using the native header window
+ wxHeaderCtrl *GetGridColHeader() const
+ {
+ wxASSERT_MSG( m_useNativeHeader, "no column header window" );
+
+ // static_cast<> doesn't work without the full class declaration in
+ // view and we prefer to avoid adding more compile-time dependencies
+ // even at the cost of using reinterpret_cast<>
+ return reinterpret_cast<wxHeaderCtrl *>(m_colWindow);
+ }
+
// Allow adjustment of scroll increment. The default is (15, 15).
void SetScrollLineX(int x) { m_scrollLineX = x; }
void SetScrollLineY(int y) { m_scrollLineY = y; }
// wxGridColLabelWindow, use accessors below when the real type matters
wxWindow *m_colWindow;
- wxHeaderCtrl *GetColHeader() const
- {
- wxASSERT_MSG( m_useNativeHeader, "no column header window" );
-
- // static_cast<> doesn't work without the full class declaration in
- // view and we prefer to avoid adding more compile-time dependencies
- // even at the cost of using reinterpret_cast<>
- return reinterpret_cast<wxHeaderCtrl *>(m_colWindow);
- }
-
wxGridColLabelWindow *GetColLabelWindow() const
{
wxASSERT_MSG( !m_useNativeHeader, "no column label window" );
// the sorting indicator to effectively show
void UpdateColumnSortingIndicator(int col);
+ // update the grid after changing the columns order (common part of
+ // SetColPos() and ResetColPos())
+ void RefreshAfterColPosChange();
+
// return the position (not index) of the column at the given logical pixel
// position