From 9f6da5c40a522785f04e715550ae442268602dc7 Mon Sep 17 00:00:00 2001 From: lsv Date: Wed, 24 Dec 2025 16:19:17 +0500 Subject: [PATCH] Underlining the query results with a red line if they were truncated due to the set maximum column size. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Результаты запроса которые были усечены из-за превышения максимального размера колонки будут подчёркнуты красной линией. --- include/ctl/ctlSQLGrid.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/ctl/ctlSQLGrid.h b/include/ctl/ctlSQLGrid.h index 6cddd5c..1a3fe7c 100644 --- a/include/ctl/ctlSQLGrid.h +++ b/include/ctl/ctlSQLGrid.h @@ -224,10 +224,12 @@ public: ////////////////////////////////////////////////////////////////////////////// //CursorCellRenderer::Draw(grid, attr, dc, rect, row, col, isSelected); // dc.SetBackgroundMode(wxSOLID); + bool istruncateLine=false; wxString text = grid.GetCellValue(row, col); // grey out fields if the grid is disabled if (grid.IsEnabled()) { + istruncateLine=text.Right(5)=="(...)"; if (isSelected) { wxColour clr; @@ -326,6 +328,10 @@ public: } grid.DrawTextRectangle(dc, text, rect, hAlign, vAlign); + if (istruncateLine) { + dc.SetPen(*wxRED_PEN); + dc.DrawLine(wxPoint(rect.x,rect.y+rect.GetHeight()-2),wxPoint(rect.x+rect.width,rect.y+rect.GetHeight()-2)); + } } #else class CursorCellRenderer : public wxGridCellAutoWrapStringRenderer