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

Represent a row indicator icon for use in places like the layer widget. More...

#include <indicator_icon.h>

Inheritance diagram for INDICATOR_ICON:

Classes

class  ICON_PROVIDER
 A simple object that can provide fixed bitmaps for use as row indicators. More...
 

Public Types

using ICON_ID = int
 An id that refers to a certain icon state.
 

Public Member Functions

 INDICATOR_ICON (wxWindow *aParent, ICON_PROVIDER &aIconProvider, ICON_ID aInitialIcon, int aID)
 
void SetIndicatorState (ICON_ID aIconId)
 Set the row indicator to the given state.
 
ICON_ID GetIndicatorState () const
 
void SetWindowID (wxWindowID aId)
 Update the window ID of this control and its children.
 

Static Public Member Functions

static ICON_PROVIDERGetDefaultRowIconProvider (bool aAlternative)
 Accessor for the default icon providers, which take true and false for IDs, meaning on/off.
 

Private Attributes

ICON_PROVIDERm_iconProvider
 Object that delivers icons for the indicator (currently uses a default implementation).
 
wxStaticBitmap * m_bitmap
 Handle on the bitmap widget.
 
ICON_ID m_currentId
 Is the icon currently "on".
 

Detailed Description

Represent a row indicator icon for use in places like the layer widget.

Definition at line 35 of file indicator_icon.h.

Member Typedef Documentation

◆ ICON_ID

An id that refers to a certain icon state.

Exactly what that state might mean in terms of icons is up to the icon provider.

Definition at line 45 of file indicator_icon.h.

Constructor & Destructor Documentation

◆ INDICATOR_ICON()

INDICATOR_ICON::INDICATOR_ICON ( wxWindow *  aParent,
ICON_PROVIDER aIconProvider,
ICON_ID  aInitialIcon,
int  aID 
)
Parameters
aParentthe owning window.
aIconProviderthe icon provider to get icons from.
aInitialIconis the initial state of the icon (the meaning depends on what is the purpose of the icon).
aIDthe ID to use for the widgets - events will have this ID.

Definition at line 31 of file indicator_icon.cpp.

References INDICATOR_ICON::ICON_PROVIDER::GetIndicatorIcon(), m_bitmap, m_currentId, and m_iconProvider.

Member Function Documentation

◆ GetDefaultRowIconProvider()

static ICON_PROVIDER & INDICATOR_ICON::GetDefaultRowIconProvider ( bool  aAlternative)
static

Accessor for the default icon providers, which take true and false for IDs, meaning on/off.

Parameters
aAlternativefalse for blue arrow/blank, true for the green diamond.

◆ GetIndicatorState()

INDICATOR_ICON::ICON_ID INDICATOR_ICON::GetIndicatorState ( ) const
Returns
the current state of the indicator.

Definition at line 68 of file indicator_icon.cpp.

References m_currentId.

◆ SetIndicatorState()

void INDICATOR_ICON::SetIndicatorState ( ICON_ID  aIconId)

Set the row indicator to the given state.

Parameters
aIconIdthe icon ID to pass to the provider.

Definition at line 55 of file indicator_icon.cpp.

References INDICATOR_ICON::ICON_PROVIDER::GetIndicatorIcon(), m_bitmap, m_currentId, and m_iconProvider.

Referenced by APPEARANCE_CONTROLS::OnLayerChanged(), LAYER_WIDGET::SelectLayerRow(), LAYER_WIDGET::UpdateLayerIcons(), and LAYER_WIDGET::updateLayerRow().

◆ SetWindowID()

void INDICATOR_ICON::SetWindowID ( wxWindowID  aId)
inline

Update the window ID of this control and its children.

Parameters
aIdnew Window ID to set.

Definition at line 101 of file indicator_icon.h.

References m_bitmap.

Member Data Documentation

◆ m_bitmap

wxStaticBitmap* INDICATOR_ICON::m_bitmap
private

Handle on the bitmap widget.

Definition at line 113 of file indicator_icon.h.

Referenced by INDICATOR_ICON(), SetIndicatorState(), and SetWindowID().

◆ m_currentId

ICON_ID INDICATOR_ICON::m_currentId
private

Is the icon currently "on".

Definition at line 116 of file indicator_icon.h.

Referenced by GetIndicatorState(), INDICATOR_ICON(), and SetIndicatorState().

◆ m_iconProvider

ICON_PROVIDER& INDICATOR_ICON::m_iconProvider
private

Object that delivers icons for the indicator (currently uses a default implementation).

Definition at line 110 of file indicator_icon.h.

Referenced by INDICATOR_ICON(), and SetIndicatorState().


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