A text renderer that can unescape text for display This is useful where it's desired to keep the underlying storage escaped.
More...
#include <grid_text_helpers.h>
|
| GRID_CELL_ESCAPED_TEXT_RENDERER () |
|
void | Draw (wxGrid &aGrid, wxGridCellAttr &aAttr, wxDC &aDC, const wxRect &aRect, int aRow, int aCol, bool isSelected) override |
|
wxSize | GetBestSize (wxGrid &grid, wxGridCellAttr &attr, wxDC &dc, int row, int col) override |
|
A text renderer that can unescape text for display This is useful where it's desired to keep the underlying storage escaped.
Definition at line 32 of file grid_text_helpers.h.
◆ GRID_CELL_ESCAPED_TEXT_RENDERER()
GRID_CELL_ESCAPED_TEXT_RENDERER::GRID_CELL_ESCAPED_TEXT_RENDERER |
( |
| ) |
|
◆ Draw()
void GRID_CELL_ESCAPED_TEXT_RENDERER::Draw |
( |
wxGrid & |
aGrid, |
|
|
wxGridCellAttr & |
aAttr, |
|
|
wxDC & |
aDC, |
|
|
const wxRect & |
aRect, |
|
|
int |
aRow, |
|
|
int |
aCol, |
|
|
bool |
isSelected |
|
) |
| |
|
override |
Definition at line 30 of file grid_text_helpers.cpp.
34 wxString unescaped =
UnescapeString( aGrid.GetCellValue( aRow, aCol ) );
40 wxGridCellRenderer::Draw( aGrid, aAttr, aDC, aRect, aRow, aCol, isSelected );
42 SetTextColoursAndFont( aGrid, aAttr, aDC, isSelected );
43 aGrid.DrawTextRectangle( aDC, unescaped, rect, wxALIGN_LEFT, wxALIGN_CENTRE );
wxString UnescapeString(const wxString &aSource)
References UnescapeString().
◆ GetBestSize()
wxSize GRID_CELL_ESCAPED_TEXT_RENDERER::GetBestSize |
( |
wxGrid & |
grid, |
|
|
wxGridCellAttr & |
attr, |
|
|
wxDC & |
dc, |
|
|
int |
row, |
|
|
int |
col |
|
) |
| |
|
override |
Definition at line 47 of file grid_text_helpers.cpp.
50 wxString unescaped =
UnescapeString( aGrid.GetCellValue( aRow, aCol ) );
51 return wxGridCellStringRenderer::DoGetBestSize( aAttr, aDC, unescaped );
wxString UnescapeString(const wxString &aSource)
References UnescapeString().
The documentation for this class was generated from the following files: