X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/779e28da630ef9fba6441fb0bab01cd538a7e7bb..6a5c9ff8e8864c2a1540af521d9a93bae9617d93:/interface/wx/grid.h?ds=sidebyside diff --git a/interface/wx/grid.h b/interface/wx/grid.h index b69576f0b8..de9493045b 100644 --- a/interface/wx/grid.h +++ b/interface/wx/grid.h @@ -1894,6 +1894,29 @@ public: wxGRID_DRAW_BOX_RECT }; + /** + Constants defining different support built-in TAB handling behaviours. + + The elements of this enum determine what happens when TAB is pressed + when the cursor is in the rightmost column (or Shift-TAB is pressed + when the cursor is in the leftmost one). + + @see SetTabBehaviour(), @c wxEVT_GRID_TABBING + + @since 2.9.5 + */ + enum TabBehaviour + { + /// Do nothing, this is default. + Tab_Stop, + + /// Move to the beginning of the next (or the end of the previous) row. + Tab_Wrap, + + /// Move to the next (or the previous) control after the grid. + Tab_Leave + }; + /** @name Constructors and Initialization */ @@ -2810,6 +2833,13 @@ public: */ void AutoSizeRows(bool setAsMin = true); + /** + Returns @true if the cell value can overflow. + + A cell can overflow if the next cell in the row is empty. + */ + bool GetCellOverflow(int row, int col) const; + /** Returns the current height of the column labels. */ @@ -2835,6 +2865,11 @@ public: */ bool IsColShown(int col) const; + /** + Returns @true if the cells can overflow by default. + */ + bool GetDefaultCellOverflow() const; + /** Returns the default height for column labels. */ @@ -2880,6 +2915,11 @@ public: */ bool IsRowShown(int row) const; + /** + Sets the overflow permission of the cell. + */ + void SetCellOverflow(int row, int col, bool allow); + /** Sets the height of the column labels. @@ -2923,7 +2963,10 @@ public: Hides the specified column. To show the column later you need to call SetColSize() with non-0 - width or ShowCol(). + width or ShowCol() to restore the previous column width. + + Notice that this method shouldn't be called if the column is already + hidden. @param col The column index. @@ -2933,11 +2976,22 @@ public: /** Shows the previously hidden column by resizing it to non-0 size. + The column is shown again with the same width that it had before + HideCol() call. + + Notice that this method shouldn't be called if the column is not + currently hidden. + @see HideCol(), SetColSize() */ void ShowCol(int col); + /** + Sets the default overflow permission of the cells. + */ + void SetDefaultCellOverflow( bool allow ); + /** Sets the default width for columns in the grid. @@ -2994,7 +3048,7 @@ public: Hides the specified row. To show the row later you need to call SetRowSize() with non-0 - width or ShowRow(). + width or ShowRow() to restore its original height. @param col The row index. @@ -3002,7 +3056,10 @@ public: void HideRow(int col); /** - Shows the previously hidden row by resizing it to non-0 size. + Shows the previously hidden row. + + The row is shown again with the same height that it had before + HideRow() call. @see HideRow(), SetRowSize() */ @@ -3435,6 +3492,25 @@ public: */ void SetGridCursor(const wxGridCellCoords& coords); + /** + Set the grid's behaviour when the user presses the TAB key. + + Pressing the TAB key moves the grid cursor right in the current row, if + there is a cell at the right and, similarly, Shift-TAB moves the cursor + to the left in the current row if it's not in the first column. + + What happens if the cursor can't be moved because it it's already at + the beginning or end of the row can be configured using this function, + see wxGrid::TabBehaviour documentation for the detailed description. + + IF none of the standard behaviours is appropriate, you can always + handle @c wxEVT_GRID_TABBING event directly to implement a custom + TAB-handling logic. + + @since 2.9.5 + */ + void SetTabBehaviour(TabBehaviour behaviour); + //@} @@ -4428,6 +4504,12 @@ public: and updates the column to indicate the new sort order and refreshes itself. This event macro corresponds to @c wxEVT_GRID_COL_SORT event type. + @event{EVT_GRID_TABBING(func)} + This event is generated when the user presses TAB or Shift-TAB in the + grid. It can be used to customize the simple default TAB handling + logic, e.g. to go to the next non-empty cell instead of just the next + cell. See also wxGrid::SetTabBehaviour(). This event is new since + wxWidgets 2.9.5. @endEventTable @library{wxadv}