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, DIMMED, ON, UP,
  DOWN
}
 

State constants to select the right icons

More...
 

Public Member Functions

 ROW_ICON_PROVIDER (int aSize)
 
const wxBitmap & GetIndicatorIcon (INDICATOR_ICON::ICON_ID aIconId) const override
 > More...
 

Private Attributes

wxBitmap m_blankBitmap
 
wxBitmap m_rightArrowBitmap
 
wxBitmap m_upArrowBitmap
 
wxBitmap m_downArrowBitmap
 
wxBitmap m_dotBitmap
 

Detailed Description

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

Definition at line 115 of file indicator_icon.h.

Member Enumeration Documentation

State constants to select the right icons

Enumerator
OFF 
DIMMED 

Row "off" or "deselected"

ON 

Row "dimmed"

UP 

Row "on" or "selected"

DOWN 

Row above design alpha

Definition at line 120 of file indicator_icon.h.

121  {
122  OFF,
123  DIMMED,
124  ON,
125  UP,
126  DOWN,
127  };
Row "off" or "deselected"
Row above design alpha
Row "on" or "selected"

Constructor & Destructor Documentation

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

Definition at line 155 of file indicator_icon.cpp.

References createArrow(), createBlankImage(), and createDiamond().

156 {
157  m_blankBitmap = wxBitmap( createBlankImage( aSize ) );
158  m_rightArrowBitmap = createArrow( aSize, 1, wxColour( 64, 72, 255 ) );
159  m_upArrowBitmap = createArrow( aSize - 2, 0, wxSystemSettings().GetColour( wxSYS_COLOUR_3DDKSHADOW ) );
160  m_downArrowBitmap = createArrow( aSize - 2, 2, wxSystemSettings().GetColour( wxSYS_COLOUR_3DDKSHADOW ) );
161  m_dotBitmap = createDiamond( aSize, wxColour( 128, 144, 255 ) );
162 }
wxBitmap createArrow(int size, int aDirection, wxColour aColour)
wxBitmap m_upArrowBitmap
wxBitmap m_downArrowBitmap
wxBitmap createDiamond(int size, wxColour aColour)
wxImage createBlankImage(int size)
wxBitmap m_rightArrowBitmap

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

References OFF, and ON.

166 {
167  switch( aId )
168  {
169  case STATE::UP:
170  return m_upArrowBitmap;
171  case STATE::DOWN:
172  return m_downArrowBitmap;
173  case STATE::ON:
174  return m_rightArrowBitmap;
175  case STATE::DIMMED:
176  return m_dotBitmap;
177  case STATE::OFF:
178  default:
179  return m_blankBitmap;
180  }
181 }
wxBitmap m_upArrowBitmap
wxBitmap m_downArrowBitmap
#define OFF
wxBitmap m_rightArrowBitmap
#define ON

Member Data Documentation

wxBitmap ROW_ICON_PROVIDER::m_blankBitmap
private

Definition at line 139 of file indicator_icon.h.

wxBitmap ROW_ICON_PROVIDER::m_dotBitmap
private

Definition at line 143 of file indicator_icon.h.

wxBitmap ROW_ICON_PROVIDER::m_downArrowBitmap
private

Definition at line 142 of file indicator_icon.h.

wxBitmap ROW_ICON_PROVIDER::m_rightArrowBitmap
private

Definition at line 140 of file indicator_icon.h.

wxBitmap ROW_ICON_PROVIDER::m_upArrowBitmap
private

Definition at line 141 of file indicator_icon.h.


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