26#include <wx/settings.h>
30wxString eseries_display_help =
35 const wxPoint& pos,
const wxSize& size,
36 long style,
const wxString&
name ) :
43 m_panelESeriesHelp->SetPage( msg );
49 const wxSystemAppearance appearances = wxSystemSettings::GetAppearance();
50 const bool selectDark = appearances.IsDark();
52 recalculateColumnColours( selectDark );
67 GetSizer()->SetSizeHints(
this );
73 wxColour gridLineColour = parent->GetBackgroundColour();
75 m_GridEseries112->SetDefaultCellTextColour( *wxBLACK );
76 m_GridEseries112->SetGridLineColour( gridLineColour );
77 m_GridEseries112->EnableGridLines(
true );
79 m_GridEseries112->SetColLabelSize( wxGRID_AUTOSIZE );
80 m_GridEseries112->AutoSize();
82 m_GridEseries2496->SetDefaultCellTextColour( *wxBLACK );
83 m_GridEseries2496->SetGridLineColour( gridLineColour );
84 m_GridEseries2496->EnableGridLines(
true );
86 m_GridEseries2496->SetColLabelSize( wxGRID_AUTOSIZE );
87 m_GridEseries2496->AutoSize();
102 const wxSystemAppearance appearances = wxSystemSettings::GetAppearance();
103 const bool selectDark = appearances.IsDark();
132 const wxColour colourE3Column( wxColour(
s_cE3BGR ).ChangeLightness( colourAdjust ) );
133 const wxColour colourE6Column( wxColour(
s_cE6BGR ).ChangeLightness( colourAdjust ) );
134 const wxColour colourE12Column( wxColour(
s_cE12BGR ).ChangeLightness( colourAdjust ) );
135 const wxColour colourE24Column( wxColour(
s_cE24BGR ).ChangeLightness( colourAdjust ) );
136 const wxColour colourE48Column( wxColour(
s_cE48BGR ).ChangeLightness( colourAdjust ) );
137 const wxColour colourE96Column( wxColour(
s_cE96BGR ).ChangeLightness( colourAdjust ) );
176 value = wxString(
"" ) << eSeries12[0];
181 for(
const uint16_t& seriesEntry : eSeries12 )
183 value = wxString(
"" ) << seriesEntry;
205 for(
int i = 0; i < 3; ++i )
225 constexpr unsigned int numStripes = 4;
226 constexpr unsigned int stripeHeight = 96 / numStripes;
261 for(
const uint16_t& seriesEntry : eSeries24 )
263 value = wxString(
"" ) << seriesEntry;
265 int row = ( idx * 4 ) % stripeHeight;
266 int colOffset = ( ( idx * 4 ) / stripeHeight ) * 4;
276 for(
const uint16_t& seriesEntry : eSeries96 )
278 value = wxString(
"" ) << seriesEntry;
280 int row = idx % stripeHeight;
281 int colOffset = ( idx / stripeHeight ) * 4;
298 for(
unsigned int stripeGap = 1; stripeGap < numStripes; ++stripeGap )
300 const int stripeColumn = -1 + stripeGap * 4;
305 for(
int i = 0; i < numStripes * 4 - 1; ++i )
324 bool alternateColour =
false;
325 int cellWidth = 0, cellHeight = 0;
328 for(
int row = 0; row < numRows; row += cellHeight )
334 alternateColour = !alternateColour;
341 alternateColour =
false;
343 for(
int row = 0; row < numRows; row += cellHeight )
349 alternateColour = !alternateColour;
356 alternateColour =
false;
358 for(
int row = 0; row < numRows; row += cellHeight )
364 alternateColour = !alternateColour;
377 constexpr unsigned int numStripes = 4;
378 constexpr unsigned int stripeHeight = 96 / numStripes;
382 bool alternateColour =
false;
383 int cellWidth = 0, cellHeight = 0;
386 for(
int row = 0; row < numRows; row += cellHeight )
388 for(
int stripe = 0; stripe < numStripes; ++stripe )
395 alternateColour = !alternateColour;
402 alternateColour =
false;
404 for(
int row = 0; row < numRows; row += cellHeight )
406 for(
int stripe = 0; stripe < numStripes; ++stripe )
413 alternateColour = !alternateColour;
420 alternateColour =
false;
422 for(
int row = 0; row < numRows; row += cellHeight )
424 for(
int stripe = 0; stripe < numStripes; ++stripe )
431 alternateColour = !alternateColour;
439 for(
unsigned int stripeGap = 1; stripeGap < numStripes; ++stripeGap )
441 const int stripeColumn = -1 + stripeGap * 4;
Class PANEL_ESERIES_DISPLAY_BASE.
wxGrid * m_GridEseries112
wxGrid * m_GridEseries2496
wxColour m_colourE48Pair[2]
Calculated colours for E48 column in current (light,dark) theme.
static constexpr uint32_t s_cE96BGR
Colour for E96 column in light theme. Passed to wxColour constructor.
wxColour m_colourE6Pair[2]
Calculated colours for E6 column in current (light,dark) theme.
wxColour m_colourE12Pair[2]
Calculated colours for E12 column in current (light,dark) theme.
wxColour s_colourMatching
Calculated matching colour for empty columns. Same as background of labels.
void recolourE2496Tree()
Colour large E-series tree according to current theme.
static constexpr uint32_t s_cE3BGR
Colour for E3 column in light theme. Passed to wxColour constructor.
static constexpr int s_darkAdjustValue
Adjustment factor to create darker grid cells in dark theme.
void LoadSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Load the settings into the panel.
void populateE2496Tree()
Fill larger E-series tree with values.
static constexpr uint32_t s_cE1BGR
Colour for E1 column in light theme. Passed to wxColour constructor.
static constexpr uint32_t s_cE48BGR
Colour for E48 column in light theme. Passed to wxColour constructor.
wxColour m_colourE24Pair[2]
Calculated colours for E24 column in current (light,dark) theme.
wxColour m_colourE1Column
Calculated colour for E1 column in current (light,dark) theme.
static constexpr uint32_t s_cE6BGR
Colour for E6 column in light theme. Passed to wxColour constructor.
static constexpr int s_altAdjustValue
Adjustment factor to create alternating R-series table entry colours.
void ThemeChanged() override
Update UI elements of the panel when the theme changes to ensure the images and fonts/colors are appr...
void recolourE112Tree()
Colour small E-series tree according to current theme.
void recalculateColumnColours(bool aDarkModeOn)
Recalculate colours used to highlight the E-series columns.
static constexpr uint32_t s_cE24BGR
Colour for E24 column in light theme. Passed to wxColour constructor.
void SaveSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Save the settings from the panel.
PANEL_ESERIES_DISPLAY(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
wxColour m_colourE96Pair[2]
Calculated colours for E96 column in current (light,dark) theme.
static constexpr uint32_t s_cE12BGR
Colour for E12 column in light theme. Passed to wxColour constructor.
wxColour m_colourE3Pair[2]
Calculated colours for E3 column in current (light,dark) theme.
void populateE112Tree()
Fill small E-series tree with values.
Some functions to handle hotkeys in KiCad.
void ConvertMarkdown2Html(const wxString &aMarkdownInput, wxString &aHtmlOutput)