KiCad PCB EDA Suite
PANEL_3D_COLORS Class Reference

#include <panel_3D_colors.h>

Inheritance diagram for PANEL_3D_COLORS:
PANEL_3D_COLORS_BASE RESETTABLE_PANEL

Public Member Functions

 PANEL_3D_COLORS (wxWindow *aParent)
 
bool TransferDataFromWindow () override
 
bool TransferDataToWindow () override
 
void ResetPanel () override
 Reset the contents of this panel. More...
 
virtual wxString GetResetTooltip () const
 Get the tooltip the reset button should display when showing this panel. More...
 
wxString GetHelpTextAtPoint (const wxPoint &aPt, wxHelpEvent::Origin aOrigin) const override
 Overridden to supply the reset button tooltip when queried with { -INT_MAX, INT_MAX }. More...
 

Protected Attributes

wxStaticText * backgroundTopLabel
 
COLOR_SWATCHm_backgroundTop
 
wxStaticText * backgroundBotLabel
 
COLOR_SWATCHm_backgroundBottom
 
wxStaticText * solderPasteLabel
 
COLOR_SWATCHm_solderPaste
 
wxRadioButton * m_boardStackupRB
 
wxRadioButton * m_specificColorsRB
 
wxStaticText * silkscreenTopLabel
 
COLOR_SWATCHm_silkscreenTop
 
wxStaticText * silkscreenBottomLabel
 
COLOR_SWATCHm_silkscreenBottom
 
wxStaticText * solderMaskTopLabel
 
COLOR_SWATCHm_solderMaskTop
 
wxStaticText * solderMaskBottomLabel
 
COLOR_SWATCHm_solderMaskBottom
 
wxStaticText * surfaceFinishLabel
 
COLOR_SWATCHm_surfaceFinish
 
wxStaticText * boardBodyLabel
 
COLOR_SWATCHm_boardBody
 

Detailed Description

Definition at line 30 of file panel_3D_colors.h.

Constructor & Destructor Documentation

◆ PANEL_3D_COLORS()

PANEL_3D_COLORS::PANEL_3D_COLORS ( wxWindow *  aParent)
explicit

Definition at line 30 of file panel_3D_colors.cpp.

30 :
31 PANEL_3D_COLORS_BASE( aParent )
32{
35
40
45
48
51
54}
static CUSTOM_COLORS_LIST g_PasteColors
static CUSTOM_COLORS_LIST g_FinishColors
static KIGFX::COLOR4D g_DefaultBoardBody
static KIGFX::COLOR4D g_DefaultSolderMask
static CUSTOM_COLORS_LIST g_SilkscreenColors
static CUSTOM_COLORS_LIST g_MaskColors
static KIGFX::COLOR4D g_DefaultBackgroundTop
static KIGFX::COLOR4D g_DefaultSurfaceFinish
static KIGFX::COLOR4D g_DefaultSolderPaste
static CUSTOM_COLORS_LIST g_BoardColors
static KIGFX::COLOR4D g_DefaultSilkscreen
static KIGFX::COLOR4D g_DefaultBackgroundBot
void SetUserColors(CUSTOM_COLORS_LIST *aUserColors)
Fetch a reference to the user colors list.
Definition: color_swatch.h:95
void SetDefaultColor(const KIGFX::COLOR4D &aColor)
Sets the color that will be chosen with the "Reset to Default" button in the chooser.
COLOR_SWATCH * m_silkscreenBottom
COLOR_SWATCH * m_silkscreenTop
COLOR_SWATCH * m_backgroundTop
COLOR_SWATCH * m_solderMaskTop
COLOR_SWATCH * m_surfaceFinish
COLOR_SWATCH * m_backgroundBottom
COLOR_SWATCH * m_solderPaste
PANEL_3D_COLORS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
COLOR_SWATCH * m_solderMaskBottom

References BOARD_ADAPTER::g_BoardColors, BOARD_ADAPTER::g_DefaultBackgroundBot, BOARD_ADAPTER::g_DefaultBackgroundTop, BOARD_ADAPTER::g_DefaultBoardBody, BOARD_ADAPTER::g_DefaultSilkscreen, BOARD_ADAPTER::g_DefaultSolderMask, BOARD_ADAPTER::g_DefaultSolderPaste, BOARD_ADAPTER::g_DefaultSurfaceFinish, BOARD_ADAPTER::g_FinishColors, BOARD_ADAPTER::g_MaskColors, BOARD_ADAPTER::g_PasteColors, BOARD_ADAPTER::g_SilkscreenColors, PANEL_3D_COLORS_BASE::m_backgroundBottom, PANEL_3D_COLORS_BASE::m_backgroundTop, PANEL_3D_COLORS_BASE::m_boardBody, PANEL_3D_COLORS_BASE::m_silkscreenBottom, PANEL_3D_COLORS_BASE::m_silkscreenTop, PANEL_3D_COLORS_BASE::m_solderMaskBottom, PANEL_3D_COLORS_BASE::m_solderMaskTop, PANEL_3D_COLORS_BASE::m_solderPaste, PANEL_3D_COLORS_BASE::m_surfaceFinish, COLOR_SWATCH::SetDefaultColor(), and COLOR_SWATCH::SetUserColors().

Member Function Documentation

◆ GetHelpTextAtPoint()

wxString RESETTABLE_PANEL::GetHelpTextAtPoint ( const wxPoint &  aPt,
wxHelpEvent::Origin  aOrigin 
) const
inlineoverrideinherited

Overridden to supply the reset button tooltip when queried with { -INT_MAX, INT_MAX }.

Definition at line 72 of file resettable_panel.h.

73 {
74 if( aPt == wxPoint( -INT_MAX, INT_MAX ) )
75 return GetResetTooltip();
76 else
77 return wxPanel::GetHelpTextAtPoint( aPt, aOrigin );
78 }
virtual wxString GetResetTooltip() const
Get the tooltip the reset button should display when showing this panel.

References RESETTABLE_PANEL::GetResetTooltip().

◆ GetResetTooltip()

virtual wxString RESETTABLE_PANEL::GetResetTooltip ( ) const
inlinevirtualinherited

Get the tooltip the reset button should display when showing this panel.

Returns
the tooltip

Reimplemented in PANEL_COLOR_SETTINGS, and PANEL_HOTKEYS_EDITOR.

Definition at line 64 of file resettable_panel.h.

65 {
66 return _( "Reset all settings on this page to their default" );
67 }
#define _(s)

References _.

Referenced by RESETTABLE_PANEL::GetHelpTextAtPoint().

◆ ResetPanel()

void PANEL_3D_COLORS::ResetPanel ( )
overridevirtual

Reset the contents of this panel.

Implements RESETTABLE_PANEL.

Definition at line 112 of file panel_3D_colors.cpp.

113{
114 COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
115
125
126 m_boardStackupRB->SetValue( true );
127}
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetDefaultColor(int aLayer)
void SetSwatchColor(const KIGFX::COLOR4D &aColor, bool aSendEvent)
Set the current swatch color directly.
wxRadioButton * m_boardStackupRB
@ LAYER_3D_SOLDERMASK_TOP
Definition: layer_ids.h:442
@ LAYER_3D_COPPER
Definition: layer_ids.h:438
@ LAYER_3D_BACKGROUND_TOP
Definition: layer_ids.h:436
@ LAYER_3D_SOLDERMASK_BOTTOM
Definition: layer_ids.h:441
@ LAYER_3D_BOARD
Definition: layer_ids.h:437
@ LAYER_3D_SILKSCREEN_TOP
Definition: layer_ids.h:440
@ LAYER_3D_SOLDERPASTE
Definition: layer_ids.h:443
@ LAYER_3D_BACKGROUND_BOTTOM
Definition: layer_ids.h:435
@ LAYER_3D_SILKSCREEN_BOTTOM
Definition: layer_ids.h:439
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111

References COLOR_SETTINGS::GetDefaultColor(), LAYER_3D_BACKGROUND_BOTTOM, LAYER_3D_BACKGROUND_TOP, LAYER_3D_BOARD, LAYER_3D_COPPER, LAYER_3D_SILKSCREEN_BOTTOM, LAYER_3D_SILKSCREEN_TOP, LAYER_3D_SOLDERMASK_BOTTOM, LAYER_3D_SOLDERMASK_TOP, LAYER_3D_SOLDERPASTE, PANEL_3D_COLORS_BASE::m_backgroundBottom, PANEL_3D_COLORS_BASE::m_backgroundTop, PANEL_3D_COLORS_BASE::m_boardBody, PANEL_3D_COLORS_BASE::m_boardStackupRB, PANEL_3D_COLORS_BASE::m_silkscreenBottom, PANEL_3D_COLORS_BASE::m_silkscreenTop, PANEL_3D_COLORS_BASE::m_solderMaskBottom, PANEL_3D_COLORS_BASE::m_solderMaskTop, PANEL_3D_COLORS_BASE::m_solderPaste, PANEL_3D_COLORS_BASE::m_surfaceFinish, Pgm(), and COLOR_SWATCH::SetSwatchColor().

◆ TransferDataFromWindow()

bool PANEL_3D_COLORS::TransferDataFromWindow ( )
override

Definition at line 90 of file panel_3D_colors.cpp.

91{
92 COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
93
103
104 colors->SetUseBoardStackupColors( m_boardStackupRB->GetValue() );
105
106 Pgm().GetSettingsManager().SaveColorSettings( colors, "3d_viewer" );
107
108 return true;
109}
void SetColor(int aLayer, const COLOR4D &aColor)
void SetUseBoardStackupColors(bool aFlag)
KIGFX::COLOR4D GetSwatchColor() const

References COLOR_SWATCH::GetSwatchColor(), LAYER_3D_BACKGROUND_BOTTOM, LAYER_3D_BACKGROUND_TOP, LAYER_3D_BOARD, LAYER_3D_COPPER, LAYER_3D_SILKSCREEN_BOTTOM, LAYER_3D_SILKSCREEN_TOP, LAYER_3D_SOLDERMASK_BOTTOM, LAYER_3D_SOLDERMASK_TOP, LAYER_3D_SOLDERPASTE, PANEL_3D_COLORS_BASE::m_backgroundBottom, PANEL_3D_COLORS_BASE::m_backgroundTop, PANEL_3D_COLORS_BASE::m_boardBody, PANEL_3D_COLORS_BASE::m_boardStackupRB, PANEL_3D_COLORS_BASE::m_silkscreenBottom, PANEL_3D_COLORS_BASE::m_silkscreenTop, PANEL_3D_COLORS_BASE::m_solderMaskBottom, PANEL_3D_COLORS_BASE::m_solderMaskTop, PANEL_3D_COLORS_BASE::m_solderPaste, PANEL_3D_COLORS_BASE::m_surfaceFinish, Pgm(), COLOR_SETTINGS::SetColor(), and COLOR_SETTINGS::SetUseBoardStackupColors().

◆ TransferDataToWindow()

bool PANEL_3D_COLORS::TransferDataToWindow ( )
override

Definition at line 57 of file panel_3D_colors.cpp.

58{
59 COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
60
65 m_solderMaskTop->SetBackgroundColour( *wxWHITE );
66 m_solderMaskBottom->SetBackgroundColour( *wxWHITE );
69 m_boardBody->SetBackgroundColour( *wxWHITE );
70
80
81 if( colors->GetUseBoardStackupColors() )
82 m_boardStackupRB->SetValue( true );
83 else
84 m_specificColorsRB->SetValue( true );
85
86 return true;
87}
COLOR4D GetColor(int aLayer) const
bool GetUseBoardStackupColors() const
void SetSupportsOpacity(bool aSupportsOpacity)
Definition: color_swatch.h:122
wxRadioButton * m_specificColorsRB

References COLOR_SETTINGS::GetColor(), COLOR_SETTINGS::GetUseBoardStackupColors(), LAYER_3D_BACKGROUND_BOTTOM, LAYER_3D_BACKGROUND_TOP, LAYER_3D_BOARD, LAYER_3D_COPPER, LAYER_3D_SILKSCREEN_BOTTOM, LAYER_3D_SILKSCREEN_TOP, LAYER_3D_SOLDERMASK_BOTTOM, LAYER_3D_SOLDERMASK_TOP, LAYER_3D_SOLDERPASTE, PANEL_3D_COLORS_BASE::m_backgroundBottom, PANEL_3D_COLORS_BASE::m_backgroundTop, PANEL_3D_COLORS_BASE::m_boardBody, PANEL_3D_COLORS_BASE::m_boardStackupRB, PANEL_3D_COLORS_BASE::m_silkscreenBottom, PANEL_3D_COLORS_BASE::m_silkscreenTop, PANEL_3D_COLORS_BASE::m_solderMaskBottom, PANEL_3D_COLORS_BASE::m_solderMaskTop, PANEL_3D_COLORS_BASE::m_solderPaste, PANEL_3D_COLORS_BASE::m_specificColorsRB, PANEL_3D_COLORS_BASE::m_surfaceFinish, Pgm(), COLOR_SWATCH::SetSupportsOpacity(), and COLOR_SWATCH::SetSwatchColor().

Member Data Documentation

◆ backgroundBotLabel

wxStaticText* PANEL_3D_COLORS_BASE::backgroundBotLabel
protectedinherited

Definition at line 40 of file panel_3D_colors_base.h.

Referenced by PANEL_3D_COLORS_BASE::PANEL_3D_COLORS_BASE().

◆ backgroundTopLabel

wxStaticText* PANEL_3D_COLORS_BASE::backgroundTopLabel
protectedinherited

Definition at line 38 of file panel_3D_colors_base.h.

Referenced by PANEL_3D_COLORS_BASE::PANEL_3D_COLORS_BASE().

◆ boardBodyLabel

wxStaticText* PANEL_3D_COLORS_BASE::boardBodyLabel
protectedinherited

Definition at line 56 of file panel_3D_colors_base.h.

Referenced by PANEL_3D_COLORS_BASE::PANEL_3D_COLORS_BASE().

◆ m_backgroundBottom

COLOR_SWATCH* PANEL_3D_COLORS_BASE::m_backgroundBottom
protectedinherited

◆ m_backgroundTop

COLOR_SWATCH* PANEL_3D_COLORS_BASE::m_backgroundTop
protectedinherited

◆ m_boardBody

COLOR_SWATCH* PANEL_3D_COLORS_BASE::m_boardBody
protectedinherited

◆ m_boardStackupRB

wxRadioButton* PANEL_3D_COLORS_BASE::m_boardStackupRB
protectedinherited

◆ m_silkscreenBottom

COLOR_SWATCH* PANEL_3D_COLORS_BASE::m_silkscreenBottom
protectedinherited

◆ m_silkscreenTop

COLOR_SWATCH* PANEL_3D_COLORS_BASE::m_silkscreenTop
protectedinherited

◆ m_solderMaskBottom

COLOR_SWATCH* PANEL_3D_COLORS_BASE::m_solderMaskBottom
protectedinherited

◆ m_solderMaskTop

COLOR_SWATCH* PANEL_3D_COLORS_BASE::m_solderMaskTop
protectedinherited

◆ m_solderPaste

COLOR_SWATCH* PANEL_3D_COLORS_BASE::m_solderPaste
protectedinherited

◆ m_specificColorsRB

wxRadioButton* PANEL_3D_COLORS_BASE::m_specificColorsRB
protectedinherited

◆ m_surfaceFinish

COLOR_SWATCH* PANEL_3D_COLORS_BASE::m_surfaceFinish
protectedinherited

◆ silkscreenBottomLabel

wxStaticText* PANEL_3D_COLORS_BASE::silkscreenBottomLabel
protectedinherited

Definition at line 48 of file panel_3D_colors_base.h.

Referenced by PANEL_3D_COLORS_BASE::PANEL_3D_COLORS_BASE().

◆ silkscreenTopLabel

wxStaticText* PANEL_3D_COLORS_BASE::silkscreenTopLabel
protectedinherited

Definition at line 46 of file panel_3D_colors_base.h.

Referenced by PANEL_3D_COLORS_BASE::PANEL_3D_COLORS_BASE().

◆ solderMaskBottomLabel

wxStaticText* PANEL_3D_COLORS_BASE::solderMaskBottomLabel
protectedinherited

Definition at line 52 of file panel_3D_colors_base.h.

Referenced by PANEL_3D_COLORS_BASE::PANEL_3D_COLORS_BASE().

◆ solderMaskTopLabel

wxStaticText* PANEL_3D_COLORS_BASE::solderMaskTopLabel
protectedinherited

Definition at line 50 of file panel_3D_colors_base.h.

Referenced by PANEL_3D_COLORS_BASE::PANEL_3D_COLORS_BASE().

◆ solderPasteLabel

wxStaticText* PANEL_3D_COLORS_BASE::solderPasteLabel
protectedinherited

Definition at line 42 of file panel_3D_colors_base.h.

Referenced by PANEL_3D_COLORS_BASE::PANEL_3D_COLORS_BASE().

◆ surfaceFinishLabel

wxStaticText* PANEL_3D_COLORS_BASE::surfaceFinishLabel
protectedinherited

Definition at line 54 of file panel_3D_colors_base.h.

Referenced by PANEL_3D_COLORS_BASE::PANEL_3D_COLORS_BASE().


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