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 116 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 121 of file indicator_icon.h.

122  {
123  OFF,
124  ON,
125  };
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 170 of file indicator_icon.cpp.

170  :
171  m_alt( aAlt )
172 {}

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 175 of file indicator_icon.cpp.

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

177 {
178  // need to wait until UI is ready before construction
179  // so can't go in the global scope
180  static const wxBitmap rightArrowBitmap( rightarrow_xpm );
181  static const wxBitmap rightArrowAlternateBitmap( rightarrow_alternate_xpm );
182  static const wxBitmap blankBitmap( clear_xpm );
183  static const wxBitmap blankAlternateBitmap( clear_alternate_xpm );
184 
185  const bool on = ( aIconId == STATE::ON );
186 
187  if( m_alt )
188  return ( on ? rightArrowAlternateBitmap : blankAlternateBitmap );
189 
190  return ( on ? rightArrowBitmap : blankBitmap );
191 }
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 137 of file indicator_icon.h.

Referenced by GetIndicatorIcon().


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