pcb_calculator: Update panel images/text when system theme changes

This commit is contained in:
Ian McInerney 2021-10-08 17:30:36 +01:00
parent 1f4955a632
commit c14bdf7fe0
53 changed files with 372 additions and 126 deletions

View File

@ -49,7 +49,13 @@ bool HTML_WINDOW::SetPage( const wxString& aSource )
}
void HTML_WINDOW::onThemeChanged( wxSysColourChangedEvent &aEvent )
void HTML_WINDOW::ThemeChanged()
{
SetPage( m_pageSource );
}
void HTML_WINDOW::onThemeChanged( wxSysColourChangedEvent &aEvent )
{
ThemeChanged();
}

View File

@ -39,6 +39,11 @@ public:
bool SetPage( const wxString& aSource ) override;
/*
* Notify the HTML window the theme has changed.
*/
void ThemeChanged();
private:
void onThemeChanged( wxSysColourChangedEvent &aEvent );

View File

@ -0,0 +1,59 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Ian McInerney
* Copyright (C) 2021 Kicad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CALCULATOR_PANEL_H_
#define CALCULATOR_PANEL_H_
#include <wx/panel.h>
class PCB_CALCULATOR_SETTINGS;
class CALCULATOR_PANEL : public wxPanel
{
public:
CALCULATOR_PANEL( wxWindow* aParent, wxWindowID aId, const wxPoint& aPos, const wxSize& aSize,
long aStyle, const wxString& aName )
: wxPanel( aParent, aId, aPos, aSize, aStyle, aName )
{}
~CALCULATOR_PANEL() {}
/**
* Load the settings into the panel
*
*@param aCfg is the settings structure to load from
*/
virtual void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) = 0;
/**
* Save the settings from the panel
*
*@param aCfg is the settings structure to save to
*/
virtual void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) = 0;
/**
* Update UI elements of the panel when the theme changes to ensure the images
* and fonts/colors are appropriate for the new theme.
*/
virtual void ThemeChanged() = 0;
};
#endif

View File

@ -65,6 +65,24 @@ PANEL_ATTENUATORS::~PANEL_ATTENUATORS()
}
void PANEL_ATTENUATORS::ThemeChanged()
{
// Update the bitmaps
m_bpButtonCalcAtt->SetBitmap( KiBitmap( BITMAPS::small_down ) );
m_attenuatorBitmap->SetBitmap( KiBitmap( m_CurrAttenuator->m_SchBitmapName ) );
// Update the font
m_staticTextAttMsg->SetFont( KIUI::GetInfoFont( this ).Italic() );
// Update the HTML windows
m_Attenuator_Messages->ThemeChanged();
m_panelAttFormula->ThemeChanged();
Layout();
Refresh();
}
void PANEL_ATTENUATORS::UpdateUI()
{
m_attenuatorBitmap->SetBitmap( KiBitmap( m_CurrAttenuator->m_SchBitmapName ) );

View File

@ -37,8 +37,12 @@ public:
~PANEL_ATTENUATORS();
wxRadioBox* GetAttenuatorsSelector() { return m_AttenuatorsSelection; }
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg );
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg );
// Methods from CALCULATOR_PANEL that must be overriden
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void ThemeChanged() override;
void UpdateUI(); // Update bitmaps
void OnAttenuatorSelection( wxCommandEvent& event ) override;

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -9,7 +9,7 @@
///////////////////////////////////////////////////////////////////////////
PANEL_ATTENUATORS_BASE::PANEL_ATTENUATORS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
PANEL_ATTENUATORS_BASE::PANEL_ATTENUATORS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : CALCULATOR_PANEL( parent, id, pos, size, style, name )
{
wxBoxSizer* bSizerAtt;
bSizerAtt = new wxBoxSizer( wxHORIZONTAL );

View File

@ -46,7 +46,7 @@
<property name="name">PANEL_ATTENUATORS_BASE</property>
<property name="pos"></property>
<property name="size">500,300</property>
<property name="subclass">; ; forward_declare</property>
<property name="subclass">CALCULATOR_PANEL; calculator_panel.h; forward_declare</property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -11,6 +11,7 @@
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "html_window.h"
#include "calculator_panel.h"
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
@ -36,7 +37,7 @@
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_ATTENUATORS_BASE
///////////////////////////////////////////////////////////////////////////////
class PANEL_ATTENUATORS_BASE : public wxPanel
class PANEL_ATTENUATORS_BASE : public CALCULATOR_PANEL
{
private:

View File

@ -38,6 +38,12 @@ PANEL_BOARD_CLASS::~PANEL_BOARD_CLASS()
}
void PANEL_BOARD_CLASS::ThemeChanged()
{
// TODO: Only the grid needs updating, but it isn't done automatically (https://trac.wxwidgets.org/ticket/19279)
}
void PANEL_BOARD_CLASS::SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg )
{
aCfg->m_BoardClassUnits = m_BoardClassesUnitsSelector->GetSelection();

View File

@ -34,11 +34,13 @@ public:
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_BOARD_CLASS();
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg );
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg );
// Methods from CALCULATOR_PANEL that must be overriden
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void ThemeChanged() override;
void OnBoardClassesUnitsSelection( wxCommandEvent& event ) override;
void BoardClassesUpdateData( double aUnitScale );
};
#endif
#endif

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -11,7 +11,7 @@
///////////////////////////////////////////////////////////////////////////
PANEL_BOARD_CLASS_BASE::PANEL_BOARD_CLASS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
PANEL_BOARD_CLASS_BASE::PANEL_BOARD_CLASS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : CALCULATOR_PANEL( parent, id, pos, size, style, name )
{
wxBoxSizer* bSizerBoardClass;
bSizerBoardClass = new wxBoxSizer( wxHORIZONTAL );
@ -32,7 +32,7 @@ PANEL_BOARD_CLASS_BASE::PANEL_BOARD_CLASS_BASE( wxWindow* parent, wxWindowID id,
m_staticTextBrdClass = new wxStaticText( this, wxID_ANY, _("Note: Values are minimal values"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextBrdClass->Wrap( -1 );
m_staticTextBrdClass->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
m_staticTextBrdClass->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
brdclsSizerRight->Add( m_staticTextBrdClass, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
@ -54,13 +54,13 @@ PANEL_BOARD_CLASS_BASE::PANEL_BOARD_CLASS_BASE( wxWindow* parent, wxWindowID id,
m_gridClassesValuesDisplay->SetColSize( 5, 100 );
m_gridClassesValuesDisplay->EnableDragColMove( false );
m_gridClassesValuesDisplay->EnableDragColSize( true );
m_gridClassesValuesDisplay->SetColLabelSize( 30 );
m_gridClassesValuesDisplay->SetColLabelValue( 0, _("Class 1") );
m_gridClassesValuesDisplay->SetColLabelValue( 1, _("Class 2") );
m_gridClassesValuesDisplay->SetColLabelValue( 2, _("Class 3") );
m_gridClassesValuesDisplay->SetColLabelValue( 3, _("Class 4") );
m_gridClassesValuesDisplay->SetColLabelValue( 4, _("Class 5") );
m_gridClassesValuesDisplay->SetColLabelValue( 5, _("Class 6") );
m_gridClassesValuesDisplay->SetColLabelSize( 30 );
m_gridClassesValuesDisplay->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Rows
@ -70,12 +70,12 @@ PANEL_BOARD_CLASS_BASE::PANEL_BOARD_CLASS_BASE( wxWindow* parent, wxWindowID id,
m_gridClassesValuesDisplay->SetRowSize( 3, 24 );
m_gridClassesValuesDisplay->SetRowSize( 4, 24 );
m_gridClassesValuesDisplay->EnableDragRowSize( false );
m_gridClassesValuesDisplay->SetRowLabelSize( 160 );
m_gridClassesValuesDisplay->SetRowLabelValue( 0, _("Lines width") );
m_gridClassesValuesDisplay->SetRowLabelValue( 1, _("Min clearance") );
m_gridClassesValuesDisplay->SetRowLabelValue( 2, _("Via: (diam - drill)") );
m_gridClassesValuesDisplay->SetRowLabelValue( 3, _("Plated Pad: (diam - drill)") );
m_gridClassesValuesDisplay->SetRowLabelValue( 4, _("NP Pad: (diam - drill)") );
m_gridClassesValuesDisplay->SetRowLabelSize( 160 );
m_gridClassesValuesDisplay->SetRowLabelAlignment( wxALIGN_RIGHT, wxALIGN_CENTER );
// Label Appearance

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="15" />
<FileVersion major="1" minor="16" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@ -14,6 +14,7 @@
<property name="file">panel_board_class_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">panel_board_class_base</property>
@ -25,6 +26,7 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1">
@ -44,8 +46,9 @@
<property name="name">PANEL_BOARD_CLASS_BASE</property>
<property name="pos"></property>
<property name="size">701,347</property>
<property name="subclass">; ; forward_declare</property>
<property name="subclass">CALCULATOR_PANEL; calculator_panels/calculator_panel.h; </property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -12,6 +12,7 @@
#include <wx/intl.h>
class UNIT_SELECTOR_LEN;
#include "calculator_panels/calculator_panel.h"
#include <wx/string.h>
#include <wx/choice.h>
#include <wx/gdicmn.h>
@ -29,7 +30,7 @@ class UNIT_SELECTOR_LEN;
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_BOARD_CLASS_BASE
///////////////////////////////////////////////////////////////////////////////
class PANEL_BOARD_CLASS_BASE : public wxPanel
class PANEL_BOARD_CLASS_BASE : public CALCULATOR_PANEL
{
private:
@ -39,13 +40,14 @@ class PANEL_BOARD_CLASS_BASE : public wxPanel
wxGrid* m_gridClassesValuesDisplay;
wxPanel* m_panelShowClassPrms;
// Virtual event handlers, overide them in your derived class
// Virtual event handlers, override them in your derived class
virtual void OnBoardClassesUnitsSelection( wxCommandEvent& event ) { event.Skip(); }
public:
PANEL_BOARD_CLASS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 701,347 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_BOARD_CLASS_BASE();
};

View File

@ -42,6 +42,12 @@ PANEL_COLOR_CODE::~PANEL_COLOR_CODE()
}
void PANEL_COLOR_CODE::ThemeChanged()
{
// Nothing to do for this panel
}
void PANEL_COLOR_CODE::LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg )
{
m_rbToleranceSelection->SetSelection( aCfg->m_ColorCodeTolerance );

View File

@ -35,8 +35,11 @@ public:
void OnToleranceSelection( wxCommandEvent& event ) override;
void ToleranceSelection( int aSelection );
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg );
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg );
// Methods from CALCULATOR_PANEL that must be overriden
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void ThemeChanged() override;
private:
void initColorCodePanel();
@ -47,4 +50,4 @@ private:
wxBitmap* m_ccTolerancesBitmap;
};
#endif
#endif

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -9,7 +9,7 @@
///////////////////////////////////////////////////////////////////////////
PANEL_COLOR_CODE_BASE::PANEL_COLOR_CODE_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
PANEL_COLOR_CODE_BASE::PANEL_COLOR_CODE_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : CALCULATOR_PANEL( parent, id, pos, size, style, name )
{
wxBoxSizer* bSizerPanelColorCode;
bSizerPanelColorCode = new wxBoxSizer( wxHORIZONTAL );

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="15" />
<FileVersion major="1" minor="16" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@ -14,6 +14,7 @@
<property name="file">panel_color_code_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">panel_color_code_base</property>
@ -25,6 +26,7 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1">
@ -44,8 +46,9 @@
<property name="name">PANEL_COLOR_CODE_BASE</property>
<property name="pos"></property>
<property name="size">500,300</property>
<property name="subclass">; ; forward_declare</property>
<property name="subclass">CALCULATOR_PANEL; calculator_panels/calculator_panel.h; </property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -10,6 +10,7 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "calculator_panels/calculator_panel.h"
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
@ -30,7 +31,7 @@
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_COLOR_CODE_BASE
///////////////////////////////////////////////////////////////////////////////
class PANEL_COLOR_CODE_BASE : public wxPanel
class PANEL_COLOR_CODE_BASE : public CALCULATOR_PANEL
{
private:
@ -49,13 +50,14 @@ class PANEL_COLOR_CODE_BASE : public wxPanel
wxStaticBitmap* m_Band_mult_bitmap;
wxStaticBitmap* m_Band_tol_bitmap;
// Virtual event handlers, overide them in your derived class
// Virtual event handlers, override them in your derived class
virtual void OnToleranceSelection( wxCommandEvent& event ) { event.Skip(); }
public:
PANEL_COLOR_CODE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_COLOR_CODE_BASE();
};

View File

@ -123,6 +123,12 @@ PANEL_ELECTRICAL_SPACING::~PANEL_ELECTRICAL_SPACING()
}
void PANEL_ELECTRICAL_SPACING::ThemeChanged()
{
// TODO: Only the grid needs updating, but it isn't done automatically (https://trac.wxwidgets.org/ticket/19279)
}
void PANEL_ELECTRICAL_SPACING::SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg )
{
aCfg->m_Electrical.spacing_units = m_ElectricalSpacingUnitsSelector->GetSelection();

View File

@ -34,12 +34,15 @@ public:
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_ELECTRICAL_SPACING();
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg );
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg );
// Methods from CALCULATOR_PANEL that must be overriden
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void ThemeChanged() override;
void OnElectricalSpacingUnitsSelection( wxCommandEvent& event ) override;
void OnElectricalSpacingRefresh( wxCommandEvent& event ) override;
void ElectricalSpacingUpdateData( double aUnitScale );
};
#endif
#endif

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -11,7 +11,7 @@
///////////////////////////////////////////////////////////////////////////
PANEL_ELECTRICAL_SPACING_BASE::PANEL_ELECTRICAL_SPACING_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
PANEL_ELECTRICAL_SPACING_BASE::PANEL_ELECTRICAL_SPACING_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : CALCULATOR_PANEL( parent, id, pos, size, style, name )
{
wxBoxSizer* bSizerElectricalClearance;
bSizerElectricalClearance = new wxBoxSizer( wxHORIZONTAL );
@ -22,7 +22,7 @@ PANEL_ELECTRICAL_SPACING_BASE::PANEL_ELECTRICAL_SPACING_BASE( wxWindow* parent,
wxArrayString m_ElectricalSpacingUnitsSelectorChoices;
m_ElectricalSpacingUnitsSelector = new UNIT_SELECTOR_LEN( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_ElectricalSpacingUnitsSelectorChoices, 0 );
m_ElectricalSpacingUnitsSelector->SetSelection( -1 );
m_ElectricalSpacingUnitsSelector->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_LIGHT, false, wxEmptyString ) );
m_ElectricalSpacingUnitsSelector->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
bLeftSizerElectricalClearance->Add( m_ElectricalSpacingUnitsSelector, 0, wxEXPAND|wxALL, 10 );
@ -46,7 +46,7 @@ PANEL_ELECTRICAL_SPACING_BASE::PANEL_ELECTRICAL_SPACING_BASE( wxWindow* parent,
m_staticTextElectricalSpacing = new wxStaticText( this, wxID_ANY, _("Note: Values are minimal values (from IPC 2221)"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextElectricalSpacing->Wrap( -1 );
m_staticTextElectricalSpacing->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
m_staticTextElectricalSpacing->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
m_electricalSpacingSizer->Add( m_staticTextElectricalSpacing, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 );
@ -69,7 +69,6 @@ PANEL_ELECTRICAL_SPACING_BASE::PANEL_ELECTRICAL_SPACING_BASE( wxWindow* parent,
m_gridElectricalSpacingValues->SetColSize( 6, 100 );
m_gridElectricalSpacingValues->EnableDragColMove( false );
m_gridElectricalSpacingValues->EnableDragColSize( true );
m_gridElectricalSpacingValues->SetColLabelSize( 30 );
m_gridElectricalSpacingValues->SetColLabelValue( 0, _("B1") );
m_gridElectricalSpacingValues->SetColLabelValue( 1, _("B2") );
m_gridElectricalSpacingValues->SetColLabelValue( 2, _("B3") );
@ -77,6 +76,7 @@ PANEL_ELECTRICAL_SPACING_BASE::PANEL_ELECTRICAL_SPACING_BASE( wxWindow* parent,
m_gridElectricalSpacingValues->SetColLabelValue( 4, _("A5") );
m_gridElectricalSpacingValues->SetColLabelValue( 5, _("A6") );
m_gridElectricalSpacingValues->SetColLabelValue( 6, _("A7") );
m_gridElectricalSpacingValues->SetColLabelSize( 30 );
m_gridElectricalSpacingValues->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Rows
@ -91,7 +91,6 @@ PANEL_ELECTRICAL_SPACING_BASE::PANEL_ELECTRICAL_SPACING_BASE( wxWindow* parent,
m_gridElectricalSpacingValues->SetRowSize( 8, 24 );
m_gridElectricalSpacingValues->SetRowSize( 9, 24 );
m_gridElectricalSpacingValues->EnableDragRowSize( false );
m_gridElectricalSpacingValues->SetRowLabelSize( 100 );
m_gridElectricalSpacingValues->SetRowLabelValue( 0, _("0 .. 15 V") );
m_gridElectricalSpacingValues->SetRowLabelValue( 1, _("16 .. 30 V") );
m_gridElectricalSpacingValues->SetRowLabelValue( 2, _("31 .. 50 V") );
@ -102,6 +101,7 @@ PANEL_ELECTRICAL_SPACING_BASE::PANEL_ELECTRICAL_SPACING_BASE( wxWindow* parent,
m_gridElectricalSpacingValues->SetRowLabelValue( 7, _("251 .. 300 V") );
m_gridElectricalSpacingValues->SetRowLabelValue( 8, _("301 .. 500 V") );
m_gridElectricalSpacingValues->SetRowLabelValue( 9, _(" > 500 V") );
m_gridElectricalSpacingValues->SetRowLabelSize( 100 );
m_gridElectricalSpacingValues->SetRowLabelAlignment( wxALIGN_RIGHT, wxALIGN_CENTER );
// Label Appearance

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="15" />
<FileVersion major="1" minor="16" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@ -14,6 +14,7 @@
<property name="file">panel_electrical_spacing_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">panel_electrical_spacing_base</property>
@ -25,6 +26,7 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1">
@ -44,8 +46,9 @@
<property name="name">PANEL_ELECTRICAL_SPACING_BASE</property>
<property name="pos"></property>
<property name="size">500,300</property>
<property name="subclass">; ; forward_declare</property>
<property name="subclass">CALCULATOR_PANEL; calculator_panels/calculator_panel.h; </property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
@ -324,6 +327,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -12,6 +12,7 @@
#include <wx/intl.h>
class UNIT_SELECTOR_LEN;
#include "calculator_panels/calculator_panel.h"
#include <wx/string.h>
#include <wx/choice.h>
#include <wx/gdicmn.h>
@ -21,10 +22,10 @@ class UNIT_SELECTOR_LEN;
#include <wx/statline.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/grid.h>
#include <wx/panel.h>
@ -35,7 +36,7 @@ class UNIT_SELECTOR_LEN;
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_ELECTRICAL_SPACING_BASE
///////////////////////////////////////////////////////////////////////////////
class PANEL_ELECTRICAL_SPACING_BASE : public wxPanel
class PANEL_ELECTRICAL_SPACING_BASE : public CALCULATOR_PANEL
{
private:
@ -50,7 +51,7 @@ class PANEL_ELECTRICAL_SPACING_BASE : public wxPanel
wxGrid* m_gridElectricalSpacingValues;
wxStaticText* m_staticText88;
// Virtual event handlers, overide them in your derived class
// Virtual event handlers, override them in your derived class
virtual void OnElectricalSpacingUnitsSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void OnElectricalSpacingRefresh( wxCommandEvent& event ) { event.Skip(); }
@ -58,6 +59,7 @@ class PANEL_ELECTRICAL_SPACING_BASE : public wxPanel
public:
PANEL_ELECTRICAL_SPACING_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_ELECTRICAL_SPACING_BASE();
};

View File

@ -49,6 +49,13 @@ PANEL_E_SERIE::~PANEL_E_SERIE()
}
void PANEL_E_SERIE::ThemeChanged()
{
// Update the HTML window with the help text
m_panelESeriesHelp->ThemeChanged();
}
void PANEL_E_SERIE::SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg )
{
}

View File

@ -34,8 +34,10 @@ public:
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_E_SERIE();
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg );
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg );
// Methods from CALCULATOR_PANEL that must be overriden
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void ThemeChanged() override;
/**
* Called on calculate button and executes all E-series calculations
@ -48,6 +50,8 @@ public:
* @param event contains the radio button state.
*/
void OnESeriesSelection( wxCommandEvent& event ) override;
void OnSystemThemeChange( wxSysColourChangedEvent &aEvent );
};
#endif
#endif

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -9,7 +9,7 @@
///////////////////////////////////////////////////////////////////////////
PANEL_E_SERIE_BASE::PANEL_E_SERIE_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
PANEL_E_SERIE_BASE::PANEL_E_SERIE_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : CALCULATOR_PANEL( parent, id, pos, size, style, name )
{
wxBoxSizer* bSizerESerie;
bSizerESerie = new wxBoxSizer( wxVERTICAL );

View File

@ -46,7 +46,7 @@
<property name="name">PANEL_E_SERIE_BASE</property>
<property name="pos"></property>
<property name="size">677,453</property>
<property name="subclass">; ; forward_declare</property>
<property name="subclass">CALCULATOR_PANEL; calculator_panels/calculator_panel.h; </property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -11,6 +11,7 @@
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "html_window.h"
#include "calculator_panels/calculator_panel.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
@ -35,7 +36,7 @@
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_E_SERIE_BASE
///////////////////////////////////////////////////////////////////////////////
class PANEL_E_SERIE_BASE : public wxPanel
class PANEL_E_SERIE_BASE : public CALCULATOR_PANEL
{
private:

View File

@ -60,6 +60,14 @@ PANEL_REGULATOR::~PANEL_REGULATOR()
}
void PANEL_REGULATOR::ThemeChanged()
{
// Update the bitmaps
m_bitmapRegul3pins->SetBitmap( KiBitmap( BITMAPS::regul_3pins ) );
m_bitmapRegul4pins->SetBitmap( KiBitmap( BITMAPS::regul ) );
}
void PANEL_REGULATOR::OnRegulatorCalcButtonClick( wxCommandEvent& event )
{
RegulatorsSolve();
@ -414,6 +422,7 @@ void PANEL_REGULATOR::Regulators_WriteConfig( PCB_CALCULATOR_SETTINGS* aCfg )
}
}
void PANEL_REGULATOR::LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg )
{
m_RegulR1Value->SetValue( aCfg->m_Regulators.r1 );
@ -435,6 +444,12 @@ void PANEL_REGULATOR::LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg )
}
void PANEL_REGULATOR::SaveSettings( PCB_CALCULATOR_SETTINGS *aCfg )
{
// TODO: This was empty for some reason, should we actually save settings here?
}
const wxString PANEL_REGULATOR::GetDataFilename()
{
if( m_regulators_fileNameCtrl->GetValue().IsEmpty() )

View File

@ -44,10 +44,10 @@ public:
void OnEditRegulator( wxCommandEvent& event ) override;
void OnRemoveRegulator( wxCommandEvent& event ) override;
/**
* Load settings specific to the regulators
*/
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg );
// Methods from CALCULATOR_PANEL that must be overriden
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void ThemeChanged() override;
/**
* Update the regulator page dialog display.
@ -95,4 +95,4 @@ public:
};
#endif
#endif

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -9,7 +9,7 @@
///////////////////////////////////////////////////////////////////////////
PANEL_REGULATOR_BASE::PANEL_REGULATOR_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
PANEL_REGULATOR_BASE::PANEL_REGULATOR_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : CALCULATOR_PANEL( parent, id, pos, size, style, name )
{
wxBoxSizer* bSizerMainReg;
bSizerMainReg = new wxBoxSizer( wxVERTICAL );
@ -56,7 +56,7 @@ PANEL_REGULATOR_BASE::PANEL_REGULATOR_BASE( wxWindow* parent, wxWindowID id, con
m_RegulFormula = new wxStaticText( sbSizerRegFormula->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_RegulFormula->Wrap( -1 );
m_RegulFormula->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
m_RegulFormula->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
sbSizerRegFormula->Add( m_RegulFormula, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="15" />
<FileVersion major="1" minor="16" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@ -14,6 +14,7 @@
<property name="file">panel_regulator_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">panel_regulator_base</property>
@ -25,6 +26,7 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1">
@ -44,8 +46,9 @@
<property name="name">PANEL_REGULATOR_BASE</property>
<property name="pos"></property>
<property name="size">688,436</property>
<property name="subclass">; ; forward_declare</property>
<property name="subclass">CALCULATOR_PANEL; calculator_panels/calculator_panel.h; </property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
@ -1633,6 +1636,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@ -1716,6 +1720,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@ -2073,6 +2078,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@ -2157,6 +2163,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@ -2230,6 +2237,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@ -2303,6 +2311,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -10,6 +10,7 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "calculator_panels/calculator_panel.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
@ -34,7 +35,7 @@
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_REGULATOR_BASE
///////////////////////////////////////////////////////////////////////////////
class PANEL_REGULATOR_BASE : public wxPanel
class PANEL_REGULATOR_BASE : public CALCULATOR_PANEL
{
private:
@ -73,7 +74,7 @@ class PANEL_REGULATOR_BASE : public wxPanel
wxButton* m_buttonAddItem;
wxButton* m_buttonRemoveItem;
// Virtual event handlers, overide them in your derived class
// Virtual event handlers, override them in your derived class
virtual void OnRegulTypeSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRegulatorCalcButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRegulatorResetButtonClick( wxCommandEvent& event ) { event.Skip(); }
@ -87,6 +88,7 @@ class PANEL_REGULATOR_BASE : public wxPanel
public:
PANEL_REGULATOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 688,436 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_REGULATOR_BASE();
};

View File

@ -66,6 +66,12 @@ PANEL_TRACK_WIDTH::~PANEL_TRACK_WIDTH()
}
void PANEL_TRACK_WIDTH::ThemeChanged()
{
m_htmlWinFormulas->ThemeChanged();
}
void PANEL_TRACK_WIDTH::SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg )
{
aCfg->m_TrackWidth.current = m_TrackCurrentValue->GetValue();

View File

@ -34,8 +34,10 @@ public:
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_TRACK_WIDTH();
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg );
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg );
// Methods from CALCULATOR_PANEL that must be overriden
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void ThemeChanged() override;
/**
* Update the calculations the user changes the general parameters.
@ -98,4 +100,4 @@ private:
bool m_TWNested; // Used to stop events caused by setting the answers.
};
#endif
#endif

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -11,7 +11,7 @@
///////////////////////////////////////////////////////////////////////////
PANEL_TRACK_WIDTH_BASE::PANEL_TRACK_WIDTH_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
PANEL_TRACK_WIDTH_BASE::PANEL_TRACK_WIDTH_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : CALCULATOR_PANEL( parent, id, pos, size, style, name )
{
wxBoxSizer* bSizerTrackWidth;
bSizerTrackWidth = new wxBoxSizer( wxHORIZONTAL );

View File

@ -46,7 +46,7 @@
<property name="name">PANEL_TRACK_WIDTH_BASE</property>
<property name="pos"></property>
<property name="size">623,457</property>
<property name="subclass">; ; forward_declare</property>
<property name="subclass">CALCULATOR_PANEL; calculator_panels/calculator_panel.h; </property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -14,6 +14,7 @@ class UNIT_SELECTOR_LEN;
class UNIT_SELECTOR_THICKNESS;
#include "html_window.h"
#include "calculator_panels/calculator_panel.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
@ -38,7 +39,7 @@ class UNIT_SELECTOR_THICKNESS;
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_TRACK_WIDTH_BASE
///////////////////////////////////////////////////////////////////////////////
class PANEL_TRACK_WIDTH_BASE : public wxPanel
class PANEL_TRACK_WIDTH_BASE : public CALCULATOR_PANEL
{
private:

View File

@ -63,6 +63,15 @@ PANEL_TRANSLINE::~PANEL_TRANSLINE()
}
void PANEL_TRANSLINE::ThemeChanged()
{
// Update the bitmaps
m_bpButtonAnalyze->SetBitmap( KiBitmap( BITMAPS::small_down ) );
m_bpButtonSynthetize->SetBitmap( KiBitmap( BITMAPS::small_up ) );
m_translineBitmap->SetBitmap( KiBitmap( m_transline_list[m_currTransLineType]->m_BitmapName ) );
}
void PANEL_TRANSLINE::SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg )
{
aCfg->m_TransLine.type = m_currTransLineType;

View File

@ -36,8 +36,10 @@ public:
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_TRANSLINE();
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg );
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg );
// Methods from CALCULATOR_PANEL that must be overriden
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void ThemeChanged() override;
// Accessors:
wxRadioBox* GetTranslineSelector() { return m_TranslineSelection; }
@ -143,4 +145,4 @@ private:
enum TRANSLINE_TYPE_ID m_currTransLineType;
};
#endif
#endif

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -11,7 +11,7 @@
///////////////////////////////////////////////////////////////////////////
PANEL_TRANSLINE_BASE::PANEL_TRANSLINE_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
PANEL_TRANSLINE_BASE::PANEL_TRANSLINE_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : CALCULATOR_PANEL( parent, id, pos, size, style, name )
{
wxBoxSizer* bSizeTransline;
bSizeTransline = new wxBoxSizer( wxHORIZONTAL );
@ -224,13 +224,13 @@ PANEL_TRANSLINE_BASE::PANEL_TRANSLINE_BASE( wxWindow* parent, wxWindowID id, con
m_staticTextZdiff = new wxStaticText( this, wxID_ANY, _("Zdiff =\n2*Z0( (1 - 0.48exp( -0.96*S/H ) )"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextZdiff->Wrap( -1 );
m_staticTextZdiff->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
m_staticTextZdiff->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
m_fgSizerZcomment->Add( m_staticTextZdiff, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_staticTextZcommon = new wxStaticText( this, wxID_ANY, _("Zcommon = Zeven / 2"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
m_staticTextZcommon->Wrap( -1 );
m_staticTextZcommon->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
m_staticTextZcommon->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
m_fgSizerZcomment->Add( m_staticTextZcommon, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="15" />
<FileVersion major="1" minor="16" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@ -14,6 +14,7 @@
<property name="file">panel_transline_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">panel_transline_base</property>
@ -25,6 +26,7 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1">
@ -44,8 +46,9 @@
<property name="name">PANEL_TRANSLINE_BASE</property>
<property name="pos"></property>
<property name="size">724,460</property>
<property name="subclass">; ; forward_declare</property>
<property name="subclass">CALCULATOR_PANEL; calculator_panels/calculator_panel.h; </property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
@ -384,6 +387,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@ -603,6 +607,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@ -822,6 +827,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@ -3241,6 +3247,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@ -3314,6 +3321,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@ -3387,6 +3395,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@ -3460,6 +3469,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@ -5144,6 +5154,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -15,6 +15,7 @@ class UNIT_SELECTOR_FREQUENCY;
class UNIT_SELECTOR_LEN;
class UNIT_SELECTOR_RESISTOR;
#include "calculator_panels/calculator_panel.h"
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
@ -41,7 +42,7 @@ class UNIT_SELECTOR_RESISTOR;
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_TRANSLINE_BASE
///////////////////////////////////////////////////////////////////////////////
class PANEL_TRANSLINE_BASE : public wxPanel
class PANEL_TRANSLINE_BASE : public CALCULATOR_PANEL
{
private:
@ -124,7 +125,7 @@ class PANEL_TRANSLINE_BASE : public wxPanel
wxStaticText* m_Message8;
wxButton* m_buttonTransLineReset;
// Virtual event handlers, overide them in your derived class
// Virtual event handlers, override them in your derived class
virtual void OnTranslineSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTranslineEpsilonR_Button( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTranslineTanD_Button( wxCommandEvent& event ) { event.Skip(); }
@ -137,6 +138,7 @@ class PANEL_TRANSLINE_BASE : public wxPanel
public:
PANEL_TRANSLINE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 724,460 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_TRANSLINE_BASE();
};

View File

@ -75,6 +75,12 @@ PANEL_VIA_SIZE::~PANEL_VIA_SIZE()
}
void PANEL_VIA_SIZE::ThemeChanged()
{
m_viaBitmap->SetBitmap( KiBitmap( BITMAPS::viacalc ) );
}
void PANEL_VIA_SIZE::OnViaEpsilonR_Button( wxCommandEvent& event )
{
//Shows a list of current relative dielectric constant(Er) and select a value.

View File

@ -34,11 +34,10 @@ public:
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_VIA_SIZE();
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg );
/**
* Write via size parameters in configuration.
*/
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg );
// Methods from CALCULATOR_PANEL that must be overriden
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
void ThemeChanged() override;
/**
* Called when the user changes any value in the via calculator.
@ -72,7 +71,8 @@ public:
double aEstimatedAmpacity, double aThermalResistance,
double aCapacitance, double aTimeDegradation, double aInductance,
double aReactance );
private:
};
#endif
#endif

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -11,7 +11,7 @@
///////////////////////////////////////////////////////////////////////////
PANEL_VIA_SIZE_BASE::PANEL_VIA_SIZE_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
PANEL_VIA_SIZE_BASE::PANEL_VIA_SIZE_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : CALCULATOR_PANEL( parent, id, pos, size, style, name )
{
wxBoxSizer* bSizerViaSize;
bSizerViaSize = new wxBoxSizer( wxHORIZONTAL );
@ -200,7 +200,7 @@ PANEL_VIA_SIZE_BASE::PANEL_VIA_SIZE_BASE( wxWindow* parent, wxWindowID id, const
m_staticTextWarning = new wxStaticText( this, wxID_ANY, _("Warning:\nVia pad diameter >= Clearance hole diameter.\nSome parameters cannot be calculated for a via inside a copper zone."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextWarning->Wrap( -1 );
m_staticTextWarning->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
m_staticTextWarning->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
bSizerViaLeftColumn->Add( m_staticTextWarning, 0, wxALL|wxEXPAND, 10 );

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="15" />
<FileVersion major="1" minor="16" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@ -14,6 +14,7 @@
<property name="file">panel_via_size_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">panel_via_size_base</property>
@ -25,6 +26,7 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1">
@ -44,8 +46,9 @@
<property name="name">PANEL_VIA_SIZE_BASE</property>
<property name="pos"></property>
<property name="size">554,417</property>
<property name="subclass">; ; forward_declare</property>
<property name="subclass">CALCULATOR_PANEL; calculator_panels/calculator_panel.h; </property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
@ -1572,6 +1575,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@ -1843,6 +1847,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@ -4126,6 +4131,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -13,6 +13,7 @@
class UNIT_SELECTOR_LEN;
#include "widgets/unit_selector.h"
#include "calculator_panels/calculator_panel.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
@ -21,10 +22,10 @@ class UNIT_SELECTOR_LEN;
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/choice.h>
#include <wx/button.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/statbmp.h>
@ -36,7 +37,7 @@ class UNIT_SELECTOR_LEN;
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_VIA_SIZE_BASE
///////////////////////////////////////////////////////////////////////////////
class PANEL_VIA_SIZE_BASE : public wxPanel
class PANEL_VIA_SIZE_BASE : public CALCULATOR_PANEL
{
private:
@ -106,7 +107,7 @@ class PANEL_VIA_SIZE_BASE : public wxPanel
wxStaticBitmap* m_viaBitmap;
wxButton* m_buttonViaReset;
// Virtual event handlers, overide them in your derived class
// Virtual event handlers, override them in your derived class
virtual void OnViaCalculate( wxCommandEvent& event ) { event.Skip(); }
virtual void OnViaRho_Button( wxCommandEvent& event ) { event.Skip(); }
virtual void OnViaEpsilonR_Button( wxCommandEvent& event ) { event.Skip(); }
@ -117,6 +118,7 @@ class PANEL_VIA_SIZE_BASE : public wxPanel
public:
PANEL_VIA_SIZE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 554,417 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_VIA_SIZE_BASE();
};

View File

@ -19,6 +19,7 @@
*/
#include <wx/msgdlg.h>
#include <bitmaps.h>
#include <bitmap_store.h>
#include <geometry/shape_poly_set.h>
#include <kiface_base.h>
#include "attenuators/attenuator_classes.h"
@ -60,6 +61,9 @@ PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
if( m_framePos == wxDefaultPosition )
Centre();
Bind( wxEVT_SYS_COLOUR_CHANGED,
wxSysColourChangedEventHandler( PCB_CALCULATOR_FRAME::onThemeChanged ), this );
}
@ -71,6 +75,25 @@ PCB_CALCULATOR_FRAME::~PCB_CALCULATOR_FRAME()
}
void PCB_CALCULATOR_FRAME::onThemeChanged( wxSysColourChangedEvent &aEvent )
{
// Force the bitmaps to refresh
GetBitmapStore()->ThemeChanged();
// Update the panels
m_panelTransline->ThemeChanged();
m_panelRegulators->ThemeChanged();
m_panelAttenuators->ThemeChanged();
m_panelColorCode->ThemeChanged();
m_panelViaSize->ThemeChanged();
m_panelTrackWidth->ThemeChanged();
m_panelElectricalSpacing->ThemeChanged();
m_panelBoardClass->ThemeChanged();
aEvent.Skip();
}
void PCB_CALCULATOR_FRAME::OnUpdateUI( wxUpdateUIEvent& event )
{
if( m_Notebook->GetSelection() != m_lastNotebookPage )

View File

@ -51,6 +51,8 @@ private:
void OnUpdateUI( wxUpdateUIEvent& event ) override;
void onThemeChanged( wxSysColourChangedEvent &aEvent );
// Config read-write, virtual from EDA_BASE_FRAME
void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;

View File

@ -182,7 +182,7 @@ void PANEL_TRANSLINE::TranslineTypeSelection( enum TRANSLINE_TYPE_ID aType )
m_currTransLineType = DEFAULT_TYPE;
}
m_translineBitmap->SetBitmap( *m_transline_list[m_currTransLineType]->m_Icon );
m_translineBitmap->SetBitmap( KiBitmap( m_transline_list[m_currTransLineType]->m_BitmapName ) );
// This helper bitmap is shown for coupled microstrip only:
m_bmCMicrostripZoddZeven->Show( aType == C_MICROSTRIP_TYPE );

View File

@ -80,10 +80,10 @@ double TRANSLINE_PRM::FromUserUnit()
TRANSLINE_IDENT::TRANSLINE_IDENT( enum TRANSLINE_TYPE_ID aType )
{
m_Type = aType; // The type of transline handled
m_Icon = nullptr; // An xpm icon to display in dialogs
m_TLine = nullptr; // The TRANSLINE itself
m_HasPrmSelection = false; // true if selection of parameters must be enabled in dialog menu
m_Type = aType; // The type of transline handled
m_BitmapName = BITMAPS::INVALID_BITMAP; // The icon to display
m_TLine = nullptr; // The TRANSLINE itself
m_HasPrmSelection = false; // true if selection of parameters must be enabled in dialog menu
// Add common prms:
// Default values are for FR4
@ -112,8 +112,8 @@ TRANSLINE_IDENT::TRANSLINE_IDENT( enum TRANSLINE_TYPE_ID aType )
switch( m_Type )
{
case MICROSTRIP_TYPE: // microstrip
m_TLine = new MICROSTRIP();
m_Icon = KiBitmapNew( BITMAPS::microstrip );
m_TLine = new MICROSTRIP();
m_BitmapName = BITMAPS::microstrip;
m_Messages.Add( wxString::Format( _( "Effective %s:" ), wxT( "εr" ) ) );
m_Messages.Add( _( "Conductor losses:" ) );
@ -153,8 +153,8 @@ TRANSLINE_IDENT::TRANSLINE_IDENT( enum TRANSLINE_TYPE_ID aType )
break;
case CPW_TYPE: // coplanar waveguide
m_TLine = new COPLANAR();
m_Icon = KiBitmapNew( BITMAPS::cpw );
m_TLine = new COPLANAR();
m_BitmapName = BITMAPS::cpw;
m_HasPrmSelection = true;
m_Messages.Add( wxString::Format( _( "Effective %s:" ), wxT( "εr" ) ) );
@ -187,8 +187,8 @@ TRANSLINE_IDENT::TRANSLINE_IDENT( enum TRANSLINE_TYPE_ID aType )
break;
case GROUNDED_CPW_TYPE: // grounded coplanar waveguide
m_TLine = new GROUNDEDCOPLANAR();
m_Icon = KiBitmapNew( BITMAPS::cpw_back );
m_TLine = new GROUNDEDCOPLANAR();
m_BitmapName = BITMAPS::cpw_back;
m_HasPrmSelection = true;
m_Messages.Add( wxString::Format( _( "Effective %s:" ), wxT( "εr" ) ) );
@ -222,8 +222,8 @@ TRANSLINE_IDENT::TRANSLINE_IDENT( enum TRANSLINE_TYPE_ID aType )
case RECTWAVEGUIDE_TYPE: // rectangular waveguide
m_TLine = new RECTWAVEGUIDE();
m_Icon = KiBitmapNew( BITMAPS::rectwaveguide );
m_TLine = new RECTWAVEGUIDE();
m_BitmapName = BITMAPS::rectwaveguide;
m_HasPrmSelection = true;
m_Messages.Add( _( "ZF(H10) = Ey / Hx:" ) );
@ -258,8 +258,8 @@ TRANSLINE_IDENT::TRANSLINE_IDENT( enum TRANSLINE_TYPE_ID aType )
break;
case COAX_TYPE: // coaxial cable
m_TLine = new COAX();
m_Icon = KiBitmapNew( BITMAPS::coax );
m_TLine = new COAX();
m_BitmapName = BITMAPS::coax;
m_HasPrmSelection = true;
m_Messages.Add( wxString::Format( _( "Effective %s:" ), wxT( "εr" ) ) );
@ -295,8 +295,8 @@ TRANSLINE_IDENT::TRANSLINE_IDENT( enum TRANSLINE_TYPE_ID aType )
break;
case C_MICROSTRIP_TYPE: // coupled microstrip
m_TLine = new C_MICROSTRIP();
m_Icon = KiBitmapNew( BITMAPS::c_microstrip );
m_TLine = new C_MICROSTRIP();
m_BitmapName = BITMAPS::c_microstrip;
m_HasPrmSelection = true;
m_Messages.Add( wxString::Format( _( "Effective %s (even):" ), wxT( "εr" ) ) );
@ -344,8 +344,8 @@ TRANSLINE_IDENT::TRANSLINE_IDENT( enum TRANSLINE_TYPE_ID aType )
break;
case STRIPLINE_TYPE: // stripline
m_TLine = new STRIPLINE();
m_Icon = KiBitmapNew( BITMAPS::stripline );
m_TLine = new STRIPLINE();
m_BitmapName = BITMAPS::stripline;
m_Messages.Add( wxString::Format( _( "Effective %s:" ), wxT( "εr" ) ) );
m_Messages.Add( _( "Conductor losses:" ) );
@ -377,8 +377,8 @@ TRANSLINE_IDENT::TRANSLINE_IDENT( enum TRANSLINE_TYPE_ID aType )
break;
case TWISTEDPAIR_TYPE: // twisted pair
m_TLine = new TWISTEDPAIR();
m_Icon = KiBitmapNew( BITMAPS::twistedpair );
m_TLine = new TWISTEDPAIR();
m_BitmapName = BITMAPS::twistedpair;
m_HasPrmSelection = true;
m_Messages.Add( wxString::Format( _( "Effective %s:" ), wxT( "εr" ) ) );
@ -423,7 +423,6 @@ TRANSLINE_IDENT::TRANSLINE_IDENT( enum TRANSLINE_TYPE_ID aType )
TRANSLINE_IDENT::~TRANSLINE_IDENT()
{
delete m_TLine;
delete m_Icon;
for( auto& ii : m_prms_List )
delete ii;

View File

@ -26,10 +26,12 @@
#define TRANSLINE_IDENT_H
#include <vector>
#include <wx/bitmap.h>
#include "transline/transline.h"
// Forward declare the bitmaps enum from bitmaps/bitmap_list.h
enum class BITMAPS : unsigned int;
// An enum to handle muwave shapes:
enum TRANSLINE_TYPE_ID {
START_OF_LIST_TYPE = 0,
@ -126,7 +128,7 @@ public:
public:
enum TRANSLINE_TYPE_ID m_Type; // The type of transline handled
wxBitmap * m_Icon; // An icon to display in dialogs
BITMAPS m_BitmapName; // The name of the bitmap to display in dialogs
TRANSLINE* m_TLine; // The TRANSLINE itself
wxArrayString m_Messages; // messages for results