KiCad PCB EDA Suite
ROW_ICON_PROVIDER Class Reference

Icon provider for the "standard" row indicators, for example in layer selection lists. More...

#include <indicator_icon.h>

Inheritance diagram for ROW_ICON_PROVIDER:
INDICATOR_ICON::ICON_PROVIDER

Public Types

enum  STATE { OFF, ON }
 

State constants to select the right icons

More...
 

Public Member Functions

 ROW_ICON_PROVIDER (bool aAlt)
 
const wxBitmap & GetIndicatorIcon (INDICATOR_ICON::ICON_ID aIconId) const override
 > More...
 

Private Attributes

bool m_alt
 

Detailed Description

Icon provider for the "standard" row indicators, for example in layer selection lists.

Definition at line 121 of file indicator_icon.h.

Member Enumeration Documentation

State constants to select the right icons

Enumerator
OFF 
ON 

Row "off" or "deselected"

Definition at line 126 of file indicator_icon.h.

127  {
128  OFF,
129  ON,
130  };
Row "off" or "deselected"

Constructor & Destructor Documentation

ROW_ICON_PROVIDER::ROW_ICON_PROVIDER ( bool  aAlt)
Parameters
aAltfalse: normal icons (blue arrow/blank), true: alternative icons (blue arrow/green diamond)

Definition at line 191 of file indicator_icon.cpp.

191  :
192  m_alt( aAlt )
193 {}

Member Function Documentation

const wxBitmap & ROW_ICON_PROVIDER::GetIndicatorIcon ( INDICATOR_ICON::ICON_ID  aIconId) const
overridevirtual

>

Gets a reference to the row icon in the given mode.

Parameters
aIconIdthe id of the icon to get (depends on the provider).

Implements INDICATOR_ICON::ICON_PROVIDER.

Definition at line 196 of file indicator_icon.cpp.

References clear_alternate_xpm, clear_xpm, m_alt, ON, rightarrow_alternate_xpm, and rightarrow_xpm.

198 {
199  // need to wait until UI is ready before construction
200  // so can't go in the global scope
201  static const wxBitmap rightArrowBitmap( rightarrow_xpm );
202  static const wxBitmap rightArrowAlternateBitmap( rightarrow_alternate_xpm );
203  static const wxBitmap blankBitmap( clear_xpm );
204  static const wxBitmap blankAlternateBitmap( clear_alternate_xpm );
205 
206  const bool on = ( aIconId == STATE::ON );
207 
208  if( m_alt )
209  return ( on ? rightArrowAlternateBitmap : blankAlternateBitmap );
210 
211  return ( on ? rightArrowBitmap : blankBitmap );
212 }
static const char * clear_xpm[]
static const char * clear_alternate_xpm[]
static const char * rightarrow_alternate_xpm[]
static const char * rightarrow_xpm[]
#define ON

Member Data Documentation

bool ROW_ICON_PROVIDER::m_alt
private

Definition at line 142 of file indicator_icon.h.

Referenced by GetIndicatorIcon().


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