52                                         const wxRect& aRect, 
int aRow, 
int aCol, 
bool isSelected )
 
   54    wxString value = aGrid.GetCellValue( aRow, aCol );
 
   60    wxGridCellRenderer::Draw( aGrid, aAttr, aDC, aRect, aRow, aCol, isSelected );
 
   63    int leftCut = aDC.FromDIP( 4 );
 
   68                            ? 
m_icon.GetPreferredBitmapSizeAtScale( aDC.GetContentScaleFactor() )
 
   74            bitmap.SetScaleFactor( 
scale );
 
   76        aDC.DrawBitmap( bitmap,
 
   77                        rect.GetLeft() + leftCut,
 
   78                        rect.GetTop() + ( rect.GetHeight() - bitmap.GetLogicalHeight() ) / 2,
 
   81        leftCut += bitmap.GetLogicalWidth();
 
   87        int position = 
m_names.Index( value );
 
   89        if( position < (
int) 
m_icons.size() && position != wxNOT_FOUND )
 
   93            wxBitmap bitmap = bundle.GetBitmap(
 
   94                    bundle.GetPreferredBitmapSizeAtScale( aDC.GetContentScaleFactor() ) );
 
   96            aDC.DrawBitmap( bitmap,
 
   97                            rect.GetLeft() + leftCut,
 
   98                            rect.GetTop() + ( rect.GetHeight() - bitmap.GetLogicalHeight() ) / 2,
 
  101            leftCut += bitmap.GetLogicalWidth();
 
  107            wxBitmap bitmap = bundle.GetBitmap(
 
  108                    bundle.GetPreferredBitmapSizeAtScale( aDC.GetContentScaleFactor() ) );
 
  110            leftCut += bitmap.GetLogicalWidth();
 
  114    leftCut += aDC.FromDIP( 4 );
 
  117    rect.width -= leftCut;
 
  120    SetTextColoursAndFont( aGrid, aAttr, aDC, isSelected );
 
  121    aGrid.DrawTextRectangle( aDC, value, rect, wxALIGN_LEFT, wxALIGN_CENTRE );
 
 
  134                            ? 
m_icon.GetPreferredBitmapSizeAtScale( dc.GetContentScaleFactor() )
 
  139        int            bmpIdx = ( row < (int) 
m_icons.size() && row >= 0 ) ? row : 0;
 
  142        bitmap = bundle.GetBitmap(
 
  143                bundle.GetPreferredBitmapSizeAtScale( dc.GetContentScaleFactor() ) );
 
  144        bitmapSize = wxSize( bitmap.GetLogicalWidth(), -1 );
 
  147    wxString 
text = 
grid.GetCellValue( row, col );
 
  148    wxSize   size = wxGridCellStringRenderer::DoGetBestSize( attr, dc, 
text );
 
  150    size.x += bitmapSize.x + dc.FromDIP( 8 );
 
  151    size.y = std::max( size.y, bitmapSize.y + dc.FromDIP( 2 ) );
 
 
  164                                    const wxRect& aRect, 
int aRow, 
int aCol, 
bool isSelected )
 
  170    wxGridCellRenderer::Draw( aGrid, aAttr, aDC, aRect, aRow, aCol, isSelected );
 
  176                        rect.GetLeft() + ( rect.GetWidth() - 
m_icon.GetWidth() ) / 2,
 
  177                        rect.GetTop() + ( rect.GetHeight() - 
m_icon.GetHeight() ) / 2,
 
 
  218                                           const wxRect& aRect, 
int aRow, 
int aCol,
 
  225    wxGridCellRenderer::Draw( aGrid, aAttr, aDC, aRect, aRow, aCol, isSelected );
 
  231                        rect.GetLeft() + ( rect.GetWidth() - 
m_bitmap.GetWidth() ) / 2,
 
  232                        rect.GetTop() + ( rect.GetHeight() - 
m_bitmap.GetHeight() ) / 2,
 
 
  266                                        wxEvtHandler* aEventHandler )
 
  268    m_control = 
new wxBitmapComboBox( aParent, aId, wxEmptyString, wxDefaultPosition,
 
  269                                      wxDefaultSize, 0, 
nullptr,
 
  270                                      wxCB_READONLY | wxTE_PROCESS_ENTER | wxTE_PROCESS_TAB |
 
  273    for( 
unsigned i = 0; i < 
m_names.size(); ++i )
 
  283    wxGridCellEditor::Create(aParent, aId, aEventHandler);
 
 
void Draw(wxGrid &aGrid, wxGridCellAttr &aAttr, wxDC &aDC, const wxRect &aRect, int aRow, int aCol, bool isSelected) override
 
GRID_CELL_ICON_TEXT_RENDERER(const std::vector< BITMAPS > &icons, const wxArrayString &names)
Construct a renderer that maps a list of icons from the bitmap system to a list of strings.
 
std::vector< BITMAPS > m_icons
 
wxSize GetBestSize(wxGrid &grid, wxGridCellAttr &attr, wxDC &dc, int row, int col) override