Allow to customize wxGrid column auto-sizing.

By default the columns are auto-sized to fit just their label, which is fast
but not very user-friendly. Allow customizing this behaviour by handling the
(new) wxEVT_GRID_COL_AUTO_SIZE event.

Closes #15077.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73789 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-04-05 21:11:59 +00:00
parent 8a47731406
commit 6f58f3d7e0
6 changed files with 37 additions and 5 deletions

View File

@@ -4707,6 +4707,13 @@ public:
type.
@event{EVT_GRID_COL_SIZE(func)}
Same as EVT_GRID_CMD_COL_SIZE() but uses `wxID_ANY` id.
@event{EVT_GRID_COL_AUTO_SIZE(func)}
This event is sent when a column must be resized to its best size, e.g.
when the user double clicks the column divider. The default
implementation simply resizes the column to fit the column label (but
not its contents as this could be too slow for big grids). This macro
corresponds to @c wxEVT_GRID_COL_AUTO_SIZE event type and is new since
wxWidgets 2.9.5.
@event{EVT_GRID_ROW_SIZE(func)}
Same as EVT_GRID_CMD_ROW_SIZE() but uses `wxID_ANY` id.
@endEventTable
@@ -4920,6 +4927,7 @@ wxEventType wxEVT_GRID_LABEL_LEFT_DCLICK;
wxEventType wxEVT_GRID_LABEL_RIGHT_DCLICK;
wxEventType wxEVT_GRID_ROW_SIZE;
wxEventType wxEVT_GRID_COL_SIZE;
wxEventType wxEVT_GRID_COL_AUTO_SIZE;
wxEventType wxEVT_GRID_RANGE_SELECT;
wxEventType wxEVT_GRID_CELL_CHANGING;
wxEventType wxEVT_GRID_CELL_CHANGED;