KiCad PCB EDA Suite
Loading...
Searching...
No Matches
GRID_CELL_ICON_TEXT_RENDERER Class Reference

#include <grid_icon_text_helpers.h>

Inheritance diagram for GRID_CELL_ICON_TEXT_RENDERER:

Public Member Functions

 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.
 
 GRID_CELL_ICON_TEXT_RENDERER (const wxBitmapBundle &aIcon, wxSize aPreferredIconSize=wxDefaultSize)
 Construct a renderer that renders a single icon next to the cell's value text.
 
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
 

Private Attributes

std::vector< BITMAPS > m_icons
 
wxArrayString m_names
 
wxBitmapBundle m_icon
 
wxSize m_iconSize
 

Detailed Description

Definition at line 36 of file grid_icon_text_helpers.h.

Constructor & Destructor Documentation

◆ GRID_CELL_ICON_TEXT_RENDERER() [1/2]

GRID_CELL_ICON_TEXT_RENDERER::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.

Parameters
iconsis a list of possible icons to render
namesis a list of names to render - must be the same length as icons

Definition at line 31 of file grid_icon_text_helpers.cpp.

References m_icons, and m_names.

◆ GRID_CELL_ICON_TEXT_RENDERER() [2/2]

GRID_CELL_ICON_TEXT_RENDERER::GRID_CELL_ICON_TEXT_RENDERER ( const wxBitmapBundle & aIcon,
wxSize aPreferredIconSize = wxDefaultSize )

Construct a renderer that renders a single icon next to the cell's value text.

Parameters
aIconis the icon to render next to the cell's value.
aPreferredIconSizeis the preferred icon size.

Definition at line 39 of file grid_icon_text_helpers.cpp.

References m_icon, and m_iconSize.

Member Function Documentation

◆ Draw()

void GRID_CELL_ICON_TEXT_RENDERER::Draw ( wxGrid & aGrid,
wxGridCellAttr & aAttr,
wxDC & aDC,
const wxRect & aRect,
int aRow,
int aCol,
bool isSelected )
override

◆ GetBestSize()

wxSize GRID_CELL_ICON_TEXT_RENDERER::GetBestSize ( wxGrid & grid,
wxGridCellAttr & attr,
wxDC & dc,
int row,
int col )
override

Definition at line 121 of file grid_icon_text_helpers.cpp.

References grid, KiBitmapBundle(), m_icon, m_icons, m_iconSize, and text.

Member Data Documentation

◆ m_icon

wxBitmapBundle GRID_CELL_ICON_TEXT_RENDERER::m_icon
private

Definition at line 64 of file grid_icon_text_helpers.h.

Referenced by Draw(), GetBestSize(), and GRID_CELL_ICON_TEXT_RENDERER().

◆ m_icons

std::vector<BITMAPS> GRID_CELL_ICON_TEXT_RENDERER::m_icons
private

Definition at line 60 of file grid_icon_text_helpers.h.

Referenced by Draw(), GetBestSize(), and GRID_CELL_ICON_TEXT_RENDERER().

◆ m_iconSize

wxSize GRID_CELL_ICON_TEXT_RENDERER::m_iconSize
private

Definition at line 65 of file grid_icon_text_helpers.h.

Referenced by Draw(), GetBestSize(), and GRID_CELL_ICON_TEXT_RENDERER().

◆ m_names

wxArrayString GRID_CELL_ICON_TEXT_RENDERER::m_names
private

Definition at line 61 of file grid_icon_text_helpers.h.

Referenced by Draw(), and GRID_CELL_ICON_TEXT_RENDERER().


The documentation for this class was generated from the following files: