KiCad PCB EDA Suite
COLOR_SWATCH Class Reference

Class representing a simple color swatch, of the kind used to set layer colors. More...

#include <color_swatch.h>

Inheritance diagram for COLOR_SWATCH:

Public Member Functions

 COLOR_SWATCH (wxWindow *aParent, KIGFX::COLOR4D aColor, int aID, KIGFX::COLOR4D aBackground, const KIGFX::COLOR4D aDefault, SWATCH_SIZE aSwatchType)
 Construct a COLOR_SWATCH. More...
 
 COLOR_SWATCH (wxWindow *aParent, wxWindowID aId, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize, long aStyle=0)
 constructor for wxFormBuilder More...
 
void SetSwatchColor (KIGFX::COLOR4D aColor, bool aSendEvent)
 Set the current swatch color directly. More...
 
void SetDefaultColor (KIGFX::COLOR4D aColor)
 Sets the color that will be chosen with the "Reset to Default" button in the chooser. More...
 
void SetSwatchBackground (KIGFX::COLOR4D aBackground)
 Set the swatch background color. More...
 
void SetUserColors (CUSTOM_COLORS_LIST *aUserColors)
 Fetch a reference to the user colors list. More...
 
KIGFX::COLOR4D GetSwatchColor () const
 
void GetNewSwatchColor ()
 Prompt for a new colour, using the colour picker dialog. More...
 
void SetReadOnly (bool aReadOnly=true)
 
bool IsReadOnly () const
 
void SetSupportsOpacity (bool aSupportsOpacity)
 
void SetReadOnlyCallback (std::function< void()> aCallback)
 Registers a handler for when the user tries to interact with a read-only swatch. More...
 

Static Public Member Functions

static wxBitmap MakeBitmap (KIGFX::COLOR4D aColor, KIGFX::COLOR4D aBackground, wxSize aSize, wxSize aCheckerboardSize, KIGFX::COLOR4D aCheckerboardBackground)
 Make a simple color swatch bitmap. More...
 

Private Member Functions

void setupEvents ()
 
void rePostEvent (wxEvent &aEvent)
 Pass unwanted events on to listeners of this object. More...
 

Private Attributes

KIGFX::COLOR4D m_color
 
KIGFX::COLOR4D m_background
 
KIGFX::COLOR4D m_default
 
CUSTOM_COLORS_LISTm_userColors
 
wxStaticBitmap * m_swatch
 
wxSize m_size
 
wxSize m_checkerboardSize
 
KIGFX::COLOR4D m_checkerboardBg
 
bool m_readOnly
 A read-only swatch won't show the color chooser dialog but otherwise works normally. More...
 
std::function< void()> m_readOnlyCallback
 
bool m_supportsOpacity
 If opacity is not supported the color chooser dialog will be displayed without it. More...
 

Detailed Description

Class representing a simple color swatch, of the kind used to set layer colors.

Definition at line 57 of file color_swatch.h.

Constructor & Destructor Documentation

◆ COLOR_SWATCH() [1/2]

COLOR_SWATCH::COLOR_SWATCH ( wxWindow *  aParent,
KIGFX::COLOR4D  aColor,
int  aID,
KIGFX::COLOR4D  aBackground,
const KIGFX::COLOR4D  aDefault,
SWATCH_SIZE  aSwatchType 
)

Construct a COLOR_SWATCH.

Parameters
aParentparent window
aColorinitial swatch color
aIDid to use when sending swatch events

Definition at line 116 of file color_swatch.cpp.

117  :
118  wxPanel( aParent, aID ),
119  m_color( aColor ),
120  m_background( aBackground ),
121  m_default( aDefault ),
122  m_userColors( nullptr ),
123  m_readOnly( false ),
124  m_supportsOpacity( true )
125 {
126  wxASSERT_MSG( aSwatchSize != SWATCH_EXPAND, "SWATCH_EXPAND not supported in COLOR_SWATCH" );
127 
128  switch( aSwatchSize )
129  {
130  case SWATCH_MEDIUM: m_size = ConvertDialogToPixels( SWATCH_SIZE_MEDIUM_DU ); break;
131  case SWATCH_SMALL: m_size = ConvertDialogToPixels( SWATCH_SIZE_SMALL_DU ); break;
132  case SWATCH_LARGE: m_size = ConvertDialogToPixels( SWATCH_SIZE_LARGE_DU ); break;
133  case SWATCH_EXPAND: m_size = ConvertDialogToPixels( SWATCH_SIZE_LARGE_DU ); break;
134  }
135 
136  m_checkerboardSize = ConvertDialogToPixels( CHECKERBOARD_SIZE_DU );
137  m_checkerboardBg = aParent->GetBackgroundColour();
138 
139  auto sizer = new wxBoxSizer( wxHORIZONTAL );
140  SetSizer( sizer );
141 
142  wxBitmap bitmap = COLOR_SWATCH::MakeBitmap( aColor, aBackground, m_size,
144  m_swatch = new wxStaticBitmap( this, aID, bitmap );
145 
146  sizer->Add( m_swatch, 0, 0 );
147 
148  setupEvents();
149 }
void setupEvents()
static wxBitmap MakeBitmap(KIGFX::COLOR4D aColor, KIGFX::COLOR4D aBackground, wxSize aSize, wxSize aCheckerboardSize, KIGFX::COLOR4D aCheckerboardBackground)
Make a simple color swatch bitmap.
static const wxSize SWATCH_SIZE_LARGE_DU(24, 16)
bool m_supportsOpacity
If opacity is not supported the color chooser dialog will be displayed without it.
Definition: color_swatch.h:144
KIGFX::COLOR4D m_default
Definition: color_swatch.h:130
wxSize m_checkerboardSize
Definition: color_swatch.h:136
KIGFX::COLOR4D m_background
Definition: color_swatch.h:129
static const wxSize SWATCH_SIZE_MEDIUM_DU(24, 10)
CUSTOM_COLORS_LIST * m_userColors
Definition: color_swatch.h:131
wxStaticBitmap * m_swatch
Definition: color_swatch.h:133
KIGFX::COLOR4D m_checkerboardBg
Definition: color_swatch.h:137
bool m_readOnly
A read-only swatch won't show the color chooser dialog but otherwise works normally.
Definition: color_swatch.h:140
static const wxSize CHECKERBOARD_SIZE_DU(3, 3)
static const wxSize SWATCH_SIZE_SMALL_DU(8, 6)
KIGFX::COLOR4D m_color
Definition: color_swatch.h:128

References CHECKERBOARD_SIZE_DU(), m_checkerboardBg, m_checkerboardSize, m_size, m_swatch, MakeBitmap(), setupEvents(), SWATCH_EXPAND, SWATCH_LARGE, SWATCH_MEDIUM, SWATCH_SIZE_LARGE_DU(), SWATCH_SIZE_MEDIUM_DU(), SWATCH_SIZE_SMALL_DU(), and SWATCH_SMALL.

◆ COLOR_SWATCH() [2/2]

COLOR_SWATCH::COLOR_SWATCH ( wxWindow *  aParent,
wxWindowID  aId,
const wxPoint &  aPos = wxDefaultPosition,
const wxSize &  aSize = wxDefaultSize,
long  aStyle = 0 
)

constructor for wxFormBuilder

Definition at line 152 of file color_swatch.cpp.

153  :
154  wxPanel( aParent, aID, aPos, aSize, aStyle ),
155  m_userColors( nullptr ),
156  m_readOnly( false ),
157  m_supportsOpacity( true )
158 {
159  if( aSize == wxDefaultSize )
160  m_size = ConvertDialogToPixels( SWATCH_SIZE_MEDIUM_DU );
161  else
162  m_size = aSize;
163 
164  m_checkerboardSize = ConvertDialogToPixels( CHECKERBOARD_SIZE_DU );
165  m_checkerboardBg = aParent->GetBackgroundColour();
166 
167  SetSize( m_size );
168 
169  auto sizer = new wxBoxSizer( wxHORIZONTAL );
170  SetSizer( sizer );
171 
172  wxBitmap bitmap = COLOR_SWATCH::MakeBitmap( COLOR4D::UNSPECIFIED, COLOR4D::UNSPECIFIED,
174  m_swatch = new wxStaticBitmap( this, aID, bitmap );
175 
176  sizer->Add( m_swatch, 0, 0 );
177 
178  setupEvents();
179 }
void setupEvents()
static wxBitmap MakeBitmap(KIGFX::COLOR4D aColor, KIGFX::COLOR4D aBackground, wxSize aSize, wxSize aCheckerboardSize, KIGFX::COLOR4D aCheckerboardBackground)
Make a simple color swatch bitmap.
bool m_supportsOpacity
If opacity is not supported the color chooser dialog will be displayed without it.
Definition: color_swatch.h:144
wxSize m_checkerboardSize
Definition: color_swatch.h:136
static const wxSize SWATCH_SIZE_MEDIUM_DU(24, 10)
CUSTOM_COLORS_LIST * m_userColors
Definition: color_swatch.h:131
wxStaticBitmap * m_swatch
Definition: color_swatch.h:133
KIGFX::COLOR4D m_checkerboardBg
Definition: color_swatch.h:137
bool m_readOnly
A read-only swatch won't show the color chooser dialog but otherwise works normally.
Definition: color_swatch.h:140
static const wxSize CHECKERBOARD_SIZE_DU(3, 3)

References CHECKERBOARD_SIZE_DU(), m_checkerboardBg, m_checkerboardSize, m_size, m_swatch, MakeBitmap(), setupEvents(), and SWATCH_SIZE_MEDIUM_DU().

Member Function Documentation

◆ GetNewSwatchColor()

void COLOR_SWATCH::GetNewSwatchColor ( )

Prompt for a new colour, using the colour picker dialog.

A colour change event will be sent if it's set.

Definition at line 270 of file color_swatch.cpp.

271 {
272  if( m_readOnly )
273  {
274  if( m_readOnlyCallback )
276 
277  return;
278  }
279 
280  DIALOG_COLOR_PICKER dialog( ::wxGetTopLevelParent( this ), m_color, m_supportsOpacity,
282 
283  if( dialog.ShowModal() == wxID_OK )
284  {
285  COLOR4D newColor = dialog.GetColor();
286 
287  if( newColor != COLOR4D::UNSPECIFIED || m_default == COLOR4D::UNSPECIFIED )
288  {
289  m_color = newColor;
290 
291  wxBitmap bm = MakeBitmap( newColor, m_background, m_size, m_checkerboardSize,
293  m_swatch->SetBitmap( bm );
294 
295  sendSwatchChangeEvent( *this );
296  }
297  }
298 }
static wxBitmap MakeBitmap(KIGFX::COLOR4D aColor, KIGFX::COLOR4D aBackground, wxSize aSize, wxSize aCheckerboardSize, KIGFX::COLOR4D aCheckerboardBackground)
Make a simple color swatch bitmap.
bool m_supportsOpacity
If opacity is not supported the color chooser dialog will be displayed without it.
Definition: color_swatch.h:144
KIGFX::COLOR4D m_default
Definition: color_swatch.h:130
wxSize m_checkerboardSize
Definition: color_swatch.h:136
KIGFX::COLOR4D m_background
Definition: color_swatch.h:129
std::function< void()> m_readOnlyCallback
Definition: color_swatch.h:141
CUSTOM_COLORS_LIST * m_userColors
Definition: color_swatch.h:131
wxStaticBitmap * m_swatch
Definition: color_swatch.h:133
KIGFX::COLOR4D m_checkerboardBg
Definition: color_swatch.h:137
bool m_readOnly
A read-only swatch won't show the color chooser dialog but otherwise works normally.
Definition: color_swatch.h:140
static void sendSwatchChangeEvent(COLOR_SWATCH &aSender)
KIGFX::COLOR4D m_color
Definition: color_swatch.h:128
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References DIALOG_COLOR_PICKER::GetColor(), m_background, m_checkerboardBg, m_checkerboardSize, m_color, m_default, m_readOnly, m_readOnlyCallback, m_size, m_supportsOpacity, m_swatch, m_userColors, MakeBitmap(), and sendSwatchChangeEvent().

Referenced by APPEARANCE_CONTROLS::onNetclassContextMenu(), LAYER_WIDGET::OnRightDownLayer(), LAYER_WIDGET::OnRightDownRender(), and setupEvents().

◆ GetSwatchColor()

◆ IsReadOnly()

bool COLOR_SWATCH::IsReadOnly ( ) const
inline

Definition at line 110 of file color_swatch.h.

110 { return m_readOnly; }
bool m_readOnly
A read-only swatch won't show the color chooser dialog but otherwise works normally.
Definition: color_swatch.h:140

References m_readOnly.

◆ MakeBitmap()

wxBitmap COLOR_SWATCH::MakeBitmap ( KIGFX::COLOR4D  aColor,
KIGFX::COLOR4D  aBackground,
wxSize  aSize,
wxSize  aCheckerboardSize,
KIGFX::COLOR4D  aCheckerboardBackground 
)
static

Make a simple color swatch bitmap.

Parameters
aWindow- window used as context for device-independent size

Definition at line 44 of file color_swatch.cpp.

46 {
47  wxBitmap bitmap( aSize );
48  wxBrush brush;
49  wxPen pen;
50  wxMemoryDC iconDC;
51 
52  iconDC.SelectObject( bitmap );
53  brush.SetStyle( wxBRUSHSTYLE_SOLID );
54 
55  if( aColor == COLOR4D::UNSPECIFIED )
56  {
57  // Draw a checkerboard
58  COLOR4D white;
59  COLOR4D black;
60  bool rowCycle;
61 
62  if( aCheckerboardBackground.GetBrightness() > 0.4 )
63  {
64  white = COLOR4D::WHITE;
65  black = white.Darkened( 0.15 );
66  rowCycle = true;
67  }
68  else
69  {
70  black = COLOR4D::BLACK;
71  white = black.Brightened( 0.15 );
72  rowCycle = false;
73  }
74 
75  for( int x = 0; x < aSize.x; x += aCheckerboardSize.x )
76  {
77  bool colCycle = rowCycle;
78 
79  for( int y = 0; y < aSize.y; y += aCheckerboardSize.y )
80  {
81  COLOR4D color = colCycle ? black : white;
82  brush.SetColour( color.ToColour() );
83  pen.SetColour( color.ToColour() );
84 
85  iconDC.SetBrush( brush );
86  iconDC.SetPen( pen );
87  iconDC.DrawRectangle( x, y, x + aCheckerboardSize.x, y + aCheckerboardSize.y );
88 
89  colCycle = !colCycle;
90  }
91 
92  rowCycle = !rowCycle;
93  }
94  }
95  else
96  {
97  brush.SetColour( aBackground.WithAlpha(1.0).ToColour() );
98  pen.SetColour( aBackground.WithAlpha(1.0).ToColour() );
99 
100  iconDC.SetBrush( brush );
101  iconDC.SetPen( pen );
102  iconDC.DrawRectangle( 0, 0, aSize.x, aSize.y );
103 
104  brush.SetColour( aColor.ToColour() );
105  pen.SetColour( aColor.ToColour() );
106 
107  iconDC.SetBrush( brush );
108  iconDC.SetPen( pen );
109  iconDC.DrawRectangle( 0, 0, aSize.x, aSize.y );
110  }
111 
112  return bitmap;
113 }
double GetBrightness() const
Returns the brightness value of the color ranged from 0.0 to 1.0.
Definition: color4d.h:327
int color
Definition: DXF_plotter.cpp:60
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
Definition: color4d.h:305
Definition: color4d.h:44
COLOR4D Darkened(double aFactor) const
Return a color that is darker by a given factor, without modifying object.
Definition: color4d.h:276
COLOR4D Brightened(double aFactor) const
Return a color that is brighter by a given factor, without modifying object.
Definition: color4d.h:262
Definition: color4d.h:48
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References BLACK, KIGFX::COLOR4D::Brightened(), color, KIGFX::COLOR4D::Darkened(), KIGFX::COLOR4D::GetBrightness(), WHITE, and KIGFX::COLOR4D::WithAlpha().

Referenced by COLOR_SWATCH(), GRID_CELL_COLOR_RENDERER::Draw(), GetNewSwatchColor(), DIALOG_COLOR_PICKER::initDefinedColors(), SetSwatchBackground(), SetSwatchColor(), ZONE_SETTINGS::SetupLayersList(), and DIALOG_COLOR_PICKER::updatePreview().

◆ rePostEvent()

void COLOR_SWATCH::rePostEvent ( wxEvent &  aEvent)
private

Pass unwanted events on to listeners of this object.

Definition at line 220 of file color_swatch.cpp.

221 {
222  wxPostEvent( this, aEvent );
223 }

Referenced by setupEvents().

◆ SetDefaultColor()

◆ SetReadOnly()

void COLOR_SWATCH::SetReadOnly ( bool  aReadOnly = true)
inline

Definition at line 109 of file color_swatch.h.

109 { m_readOnly = aReadOnly; }
bool m_readOnly
A read-only swatch won't show the color chooser dialog but otherwise works normally.
Definition: color_swatch.h:140

References m_readOnly.

Referenced by APPEARANCE_CONTROLS::rebuildLayers().

◆ SetReadOnlyCallback()

void COLOR_SWATCH::SetReadOnlyCallback ( std::function< void()>  aCallback)
inline

Registers a handler for when the user tries to interact with a read-only swatch.

Definition at line 115 of file color_swatch.h.

115 { m_readOnlyCallback = aCallback; }
std::function< void()> m_readOnlyCallback
Definition: color_swatch.h:141

References m_readOnlyCallback.

Referenced by APPEARANCE_CONTROLS::rebuildLayers(), and APPEARANCE_CONTROLS::rebuildObjects().

◆ SetSupportsOpacity()

void COLOR_SWATCH::SetSupportsOpacity ( bool  aSupportsOpacity)
inline

Definition at line 112 of file color_swatch.h.

112 { m_supportsOpacity = aSupportsOpacity; }
bool m_supportsOpacity
If opacity is not supported the color chooser dialog will be displayed without it.
Definition: color_swatch.h:144

References m_supportsOpacity.

Referenced by PANEL_3D_OPENGL_OPTIONS::PANEL_3D_OPENGL_OPTIONS().

◆ SetSwatchBackground()

void COLOR_SWATCH::SetSwatchBackground ( KIGFX::COLOR4D  aBackground)

Set the swatch background color.

Definition at line 256 of file color_swatch.cpp.

257 {
258  m_background = aBackground;
260  m_swatch->SetBitmap( bm );
261 }
static wxBitmap MakeBitmap(KIGFX::COLOR4D aColor, KIGFX::COLOR4D aBackground, wxSize aSize, wxSize aCheckerboardSize, KIGFX::COLOR4D aCheckerboardBackground)
Make a simple color swatch bitmap.
wxSize m_checkerboardSize
Definition: color_swatch.h:136
KIGFX::COLOR4D m_background
Definition: color_swatch.h:129
wxStaticBitmap * m_swatch
Definition: color_swatch.h:133
KIGFX::COLOR4D m_checkerboardBg
Definition: color_swatch.h:137
KIGFX::COLOR4D m_color
Definition: color_swatch.h:128

References m_background, m_checkerboardBg, m_checkerboardSize, m_color, m_size, m_swatch, and MakeBitmap().

Referenced by LAYER_WIDGET::OnRenderSwatchChanged(), PANEL_EESCHEMA_EDITING_OPTIONS::TransferDataToWindow(), and DIALOG_SHEET_PROPERTIES::TransferDataToWindow().

◆ SetSwatchColor()

void COLOR_SWATCH::SetSwatchColor ( KIGFX::COLOR4D  aColor,
bool  aSendEvent 
)

Set the current swatch color directly.

Definition at line 238 of file color_swatch.cpp.

239 {
240  m_color = aColor;
241 
243  m_swatch->SetBitmap( bm );
244 
245  if( aSendEvent )
246  sendSwatchChangeEvent( *this );
247 }
static wxBitmap MakeBitmap(KIGFX::COLOR4D aColor, KIGFX::COLOR4D aBackground, wxSize aSize, wxSize aCheckerboardSize, KIGFX::COLOR4D aCheckerboardBackground)
Make a simple color swatch bitmap.
wxSize m_checkerboardSize
Definition: color_swatch.h:136
KIGFX::COLOR4D m_background
Definition: color_swatch.h:129
wxStaticBitmap * m_swatch
Definition: color_swatch.h:133
KIGFX::COLOR4D m_checkerboardBg
Definition: color_swatch.h:137
static void sendSwatchChangeEvent(COLOR_SWATCH &aSender)
KIGFX::COLOR4D m_color
Definition: color_swatch.h:128

References m_background, m_checkerboardBg, m_checkerboardSize, m_color, m_size, m_swatch, MakeBitmap(), and sendSwatchChangeEvent().

Referenced by DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS(), DIALOG_JUNCTION_PROPS::resetDefaults(), DIALOG_LINE_WIRE_BUS_PROPERTIES::resetDefaults(), PANEL_COLOR_SETTINGS::ResetPanel(), PANEL_EESCHEMA_EDITING_OPTIONS::TransferDataToWindow(), DIALOG_JUNCTION_PROPS::TransferDataToWindow(), PANEL_3D_COLORS::TransferDataToWindow(), PANEL_3D_OPENGL_OPTIONS::TransferDataToWindow(), DIALOG_LINE_WIRE_BUS_PROPERTIES::TransferDataToWindow(), and DIALOG_SHEET_PROPERTIES::TransferDataToWindow().

◆ setupEvents()

void COLOR_SWATCH::setupEvents ( )
private

Definition at line 182 of file color_swatch.cpp.

183 {
184  wxWindow* topLevelParent = GetParent();
185 
186  while( topLevelParent && !topLevelParent->IsTopLevel() )
187  topLevelParent = topLevelParent->GetParent();
188 
189  if( topLevelParent && dynamic_cast<DIALOG_SHIM*>( topLevelParent ) )
190  {
191  m_swatch->Bind( wxEVT_LEFT_DOWN,
192  [this] ( wxMouseEvent& aEvt )
193  {
195  } );
196  }
197  else
198  {
199  // forward click to any other listeners, since we don't want them
200  m_swatch->Bind( wxEVT_LEFT_DOWN, &COLOR_SWATCH::rePostEvent, this );
201 
202  // bind the events that trigger the dialog
203  m_swatch->Bind( wxEVT_LEFT_DCLICK,
204  [this] ( wxMouseEvent& aEvt )
205  {
207  } );
208  }
209 
210  m_swatch->Bind( wxEVT_MIDDLE_DOWN,
211  [this] ( wxMouseEvent& aEvt )
212  {
214  } );
215 
216  m_swatch->Bind( wxEVT_RIGHT_DOWN, &COLOR_SWATCH::rePostEvent, this );
217 }
wxStaticBitmap * m_swatch
Definition: color_swatch.h:133
void rePostEvent(wxEvent &aEvent)
Pass unwanted events on to listeners of this object.
void GetNewSwatchColor()
Prompt for a new colour, using the colour picker dialog.

References GetNewSwatchColor(), m_swatch, and rePostEvent().

Referenced by COLOR_SWATCH().

◆ SetUserColors()

void COLOR_SWATCH::SetUserColors ( CUSTOM_COLORS_LIST aUserColors)
inline

Fetch a reference to the user colors list.

Definition at line 95 of file color_swatch.h.

95 { m_userColors = aUserColors; }
CUSTOM_COLORS_LIST * m_userColors
Definition: color_swatch.h:131

References m_userColors.

Referenced by PANEL_3D_COLORS::PANEL_3D_COLORS().

Member Data Documentation

◆ m_background

KIGFX::COLOR4D COLOR_SWATCH::m_background
private

Definition at line 129 of file color_swatch.h.

Referenced by GetNewSwatchColor(), SetSwatchBackground(), and SetSwatchColor().

◆ m_checkerboardBg

KIGFX::COLOR4D COLOR_SWATCH::m_checkerboardBg
private

◆ m_checkerboardSize

wxSize COLOR_SWATCH::m_checkerboardSize
private

◆ m_color

KIGFX::COLOR4D COLOR_SWATCH::m_color
private

◆ m_default

KIGFX::COLOR4D COLOR_SWATCH::m_default
private

Definition at line 130 of file color_swatch.h.

Referenced by GetNewSwatchColor(), and SetDefaultColor().

◆ m_readOnly

bool COLOR_SWATCH::m_readOnly
private

A read-only swatch won't show the color chooser dialog but otherwise works normally.

Definition at line 140 of file color_swatch.h.

Referenced by GetNewSwatchColor(), IsReadOnly(), and SetReadOnly().

◆ m_readOnlyCallback

std::function<void()> COLOR_SWATCH::m_readOnlyCallback
private

Definition at line 141 of file color_swatch.h.

Referenced by GetNewSwatchColor(), and SetReadOnlyCallback().

◆ m_size

wxSize COLOR_SWATCH::m_size
private

◆ m_supportsOpacity

bool COLOR_SWATCH::m_supportsOpacity
private

If opacity is not supported the color chooser dialog will be displayed without it.

Definition at line 144 of file color_swatch.h.

Referenced by GetNewSwatchColor(), and SetSupportsOpacity().

◆ m_swatch

wxStaticBitmap* COLOR_SWATCH::m_swatch
private

◆ m_userColors

CUSTOM_COLORS_LIST* COLOR_SWATCH::m_userColors
private

Definition at line 131 of file color_swatch.h.

Referenced by GetNewSwatchColor(), and SetUserColors().


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