add a possibility to disable individual grid rows/columns resizing

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-04-26 17:02:53 +00:00
parent fa531da023
commit 82edfbe7d9
7 changed files with 189 additions and 91 deletions

View File

@@ -2037,6 +2037,8 @@ public:
/**
@name Column and Row Sizes
@see overview_grid_resizing
*/
//@{
@@ -2322,6 +2324,17 @@ public:
/**
@name User-Resizing and Dragging
Functions controlling various interactive mouse operations.
By default, columns and rows can be resized by dragging the edges of
their labels (this can be disabled using DisableDragColSize() and
DisableDragRowSize() methods). And if grid line dragging is enabled with
EnableDragGridSize() they can also be resized by dragging the right or
bottom edge of the grid cells.
Columns can also be moved to interactively change their order but this
needs to be explicitly enabled with EnableDragColMove().
*/
//@{
@@ -2338,13 +2351,15 @@ public:
bool CanDragColMove() const;
/**
Returns @true if columns can be resized by dragging with the mouse.
Returns @true if the given column can be resized by dragging with the
mouse.
Columns can be resized by dragging the edges of their labels. If grid
line dragging is enabled they can also be resized by dragging the right
edge of the column in the grid cell area (see EnableDragGridSize()).
This function returns @true if resizing the columns interactively is
globally enabled, i.e. if DisableDragColSize() hadn't been called, and
if this column wasn't explicitly marked as non-resizable with
DisableColResize().
*/
bool CanDragColSize() const;
bool CanDragColSize(int col) const;
/**
Return @true if the dragging of grid lines to resize rows and columns
@@ -2353,13 +2368,42 @@ public:
bool CanDragGridSize() const;
/**
Returns @true if rows can be resized by dragging with the mouse.
Returns @true if the given row can be resized by dragging with the
mouse.
Rows can be resized by dragging the edges of their labels. If grid line
dragging is enabled they can also be resized by dragging the lower edge
of the row in the grid cell area (see EnableDragGridSize()).
This is the same as CanDragColSize() but for rows.
*/
bool CanDragRowSize() const;
bool CanDragRowSize(int row) const;
/**
Disable interactive resizing of the specified column.
This method allows to disable resizing of an individual column in a
grid where the columns are otherwise resizable (which is the case by
default).
Notice that currently there is no way to make some columns resizable in
a grid where columns can't be resized by default as there doesn't seem
to be any need for this in practice. There is also no way to make the
column marked as fixed using this method resizeable again because it is
supposed that fixed columns are used for static parts of the grid and
so should remain fixed during the entire grid lifetime.
Also notice that disabling interactive column resizing will not prevent
the program from changing the column size.
@see EnableDragColSize()
*/
void DisableColResize(int col);
/**
Disable interactive resizing of the specified row.
This is the same as DisableColResize() but for rows.
@see EnableDragRowSize()
*/
void DisableRowResize(int row);
/**
Disables column moving by dragging with the mouse.
@@ -2401,6 +2445,8 @@ public:
/**
Enables or disables column sizing by dragging with the mouse.
@see DisableColResize()
*/
void EnableDragColSize(bool enable = true);
@@ -2412,6 +2458,8 @@ public:
/**
Enables or disables row sizing by dragging with the mouse.
@see DisableRowResize()
*/
void EnableDragRowSize(bool enable = true);