21 #include <wx/msgdlg.h> 22 #include <wx/notebook.h> 49 _(
"PCB Calculator" ),
52 wxDEFAULT_FRAME_STYLE | wxRESIZE_BORDER | wxFULL_REPAINT_ON_RESIZE | wxTAB_TRAVERSAL,
53 wxT(
"pcb_calculator" ) ),
54 m_lastNotebookPage( -1 ),
62 SetSizeHints( wxDefaultSize, wxDefaultSize );
68 m_notebook =
new wxNotebook(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
79 _(
"RF Attenuators" ) );
91 _(
"Electrical Spacing" ) );
98 regPanel->ReadDataFile();
102 wxIconBundle icon_bundle;
105 icon_bundle.AddIcon( icon );
107 icon_bundle.AddIcon( icon );
109 icon_bundle.AddIcon( icon );
111 SetIcons( icon_bundle );
113 GetSizer()->SetSizeHints(
this );
125 Bind( wxEVT_SYS_COLOUR_CHANGED,
144 m_notebook->AddPage( aPanel, panelUIName,
false );
155 panel->ThemeChanged();
173 wxASSERT( translinePanel );
174 wxASSERT( attenPanel );
175 wxASSERT( viaSizePanel );
176 wxASSERT( regulPanel );
177 wxASSERT( elecSpacingPanel );
180 wxCommandEvent event2( wxEVT_RADIOBUTTON );
191 wxCommandEvent event2( wxEVT_RADIOBUTTON );
201 viaSizePanel->Layout();
202 regulPanel->Layout();
213 wxSize pageSize = elecSpacingPanel->GetSize();
216 elecSpacingPanel->SetSize( pageSize );
217 elecSpacingPanel->Layout();
220 elecSpacingPanel->SetSize( pageSize );
221 elecSpacingPanel->Layout();
237 wxASSERT( regPanel );
242 wxString title =
_(
"Write Data Failed" );
246 msg =
_(
"No data filename to save modifications.\n" 247 "Do you want to exit and abandon your changes?" );
249 if( wxMessageBox( msg, title, wxYES_NO | wxICON_QUESTION ) == wxNO )
256 msg.Printf(
_(
"Unable to write file '%s'\n" 257 "Do you want to exit and abandon your changes?"),
260 if( wxMessageBox( msg, title, wxYES_NO | wxICON_ERROR ) == wxNO )
272 if( aCfg ==
nullptr )
282 panel->LoadSettings( cfg );
288 if( aCfg ==
nullptr )
294 auto cfg = dynamic_cast<PCB_CALCULATOR_SETTINGS*>(
Kiface().KifaceSettings() );
301 panel->SaveSettings( cfg );
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
void SetKiway(wxWindow *aDest, KIWAY *aKiway)
It is only used for debugging, since "this" is not a wxWindow*.
void AddCalculator(CALCULATOR_PANEL *aPanel, const wxString &panelUIName)
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
void OnClosePcbCalc(wxCloseEvent &event)
virtual void SaveSettings(APP_SETTINGS_BASE *aCfg)
Save common frame parameters to a configuration data file.
PCB_CALCULATOR_FRAME(KIWAY *aKiway, wxWindow *aParent)
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
std::map< std::size_t, CALCULATOR_PANEL * > m_panelTypes
std::vector< CALCULATOR_PANEL * > m_panels
std::vector< ATTENUATOR * > m_AttenuatorList
bool m_RegulatorListChanged
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Represent a set of closed polygons.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
const wxString GetDataFilename()
void ThemeChanged()
Notifies the store that the icon theme has been changed by the user, so caches must be invalidated.
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
void OnUpdateUI(wxUpdateUIEvent &event)
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
TRANSLINE_TYPE_ID GetCurrTransLineType()
wxRadioBox * GetTranslineSelector()
ATTENUATOR * m_CurrAttenuator
void onThemeChanged(wxSysColourChangedEvent &aEvent)
wxRadioBox * GetAttenuatorsSelector()
virtual void LoadSettings(APP_SETTINGS_BASE *aCfg)
Load common frame parameters from a configuration file.
BITMAP_STORE * GetBitmapStore()