From fe35ddd34b9e3b97f064042f16556ca4efe89b2c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 1 Nov 2019 18:46:45 +0100 Subject: [PATCH] Make date cells in the grid sample more readable Add labels for the columns using date format and labels for the cells using date renderer/editor explicitly to give a better idea about what's going on here. Also use the same rows numbers for date cells as for the column ones for consistency. No real changes. See 659ab78c6d106b6966a5f3f7d202690ad4065a32 --- samples/grid/griddemo.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/samples/grid/griddemo.cpp b/samples/grid/griddemo.cpp index 30617b9ee7..aa6f348e5e 100644 --- a/samples/grid/griddemo.cpp +++ b/samples/grid/griddemo.cpp @@ -565,15 +565,21 @@ GridFrame::GridFrame() grid->SetCellAlignment(3, 9, wxALIGN_CENTRE, wxALIGN_TOP); grid->SetCellValue(3, 10, "<- This numeric cell should be centred"); + grid->SetCellValue(0, 13, "Localized date\ncolumn"); grid->SetColFormatDate(13); // Localized by default. + grid->SetCellValue(1, 13, "Today"); + grid->SetCellValue(0, 14, "ISO 8601 date\ncolumn"); grid->SetColFormatDate(14, "%Y-%m-%d"); // ISO 8601 date format. + grid->SetCellValue(1, 14, "Tomorrow"); - grid->SetCellValue(7, 0, "Today"); - grid->SetCellRenderer(7, 0, new wxGridCellDateRenderer); - grid->SetCellEditor(7, 0, new wxGridCellDateEditor); - grid->SetCellValue(8, 0, "Tomorrow"); - grid->SetCellRenderer(8, 0, new wxGridCellDateRenderer("%Y-%m-%d")); - grid->SetCellEditor(8, 0, new wxGridCellDateEditor); + grid->SetCellValue(13, 0, "Date cell:"); + grid->SetCellValue(13, 1, "Today"); + grid->SetCellRenderer(13, 1, new wxGridCellDateRenderer); + grid->SetCellEditor(13, 1, new wxGridCellDateEditor); + grid->SetCellValue(14, 0, "ISO date cell:"); + grid->SetCellValue(14, 1, "Tomorrow"); + grid->SetCellRenderer(14, 1, new wxGridCellDateRenderer("%Y-%m-%d")); + grid->SetCellEditor(14, 1, new wxGridCellDateEditor); const wxString choices[] = {