21#include <wx/treebook.h>
50 KIWAY_PLAYER( aParent, wxID_ANY,
_(
"Calculator Tools" ), wxDefaultPosition, wxSize( 646, 361 ),
51 wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL,
52 wxT(
"calculator_tools" ) ),
53 m_lastNotebookPage( -1 )
60 SetSizeHints( wxDefaultSize, wxDefaultSize );
72 m_treebook->AddPage(
nullptr,
_(
"General system design" ) );
76 m_treebook->AddPage(
nullptr,
_(
"Power, current and isolation" ) );
100 regPanel->ReadDataFile();
104 wxIconBundle icon_bundle;
106 icon.CopyFromBitmap(
KiBitmap( BITMAPS::icon_pcbcalculator ) );
107 icon_bundle.AddIcon( icon );
108 icon.CopyFromBitmap(
KiBitmap( BITMAPS::icon_pcbcalculator_32 ) );
109 icon_bundle.AddIcon( icon );
110 icon.CopyFromBitmap(
KiBitmap( BITMAPS::icon_pcbcalculator_16 ) );
111 icon_bundle.AddIcon( icon );
113 SetIcons( icon_bundle );
115 GetSizer()->SetSizeHints(
this );
124 for(
size_t pageId = 0; pageId <
m_treebook->GetPageCount(); pageId++ )
131 Bind( wxEVT_SYS_COLOUR_CHANGED,
134 m_treebook->Connect( wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED, wxTreebookEventHandler(
141 m_treebook->Disconnect( wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED, wxTreebookEventHandler(
150 int page = aEvent.GetSelection();
153 if (
m_treebook->GetPageParent( page ) == wxNOT_FOUND )
167 m_treebook->AddSubPage( aPanel, panelUIName );
178 panel->ThemeChanged();
196 wxASSERT( translinePanel );
197 wxASSERT( attenPanel );
198 wxASSERT( viaSizePanel );
199 wxASSERT( regulPanel );
200 wxASSERT( elecSpacingPanel );
203 wxCommandEvent event2( wxEVT_RADIOBUTTON );
214 wxCommandEvent event2( wxEVT_RADIOBUTTON );
224 viaSizePanel->Layout();
225 regulPanel->Layout();
239 wxASSERT( regPanel );
244 wxString title =
_(
"Write Data Failed" );
248 msg =
_(
"No data filename to save modifications.\n"
249 "Do you want to exit and abandon your changes?" );
251 if( wxMessageBox( msg, title, wxYES_NO | wxICON_QUESTION ) == wxNO )
258 msg.Printf(
_(
"Unable to write file '%s'\n"
259 "Do you want to exit and abandon your changes?"),
262 if( wxMessageBox( msg, title, wxYES_NO | wxICON_ERROR ) == wxNO )
274 if( aCfg ==
nullptr )
284 panel->LoadSettings( cfg );
290 if( aCfg ==
nullptr )
303 panel->SaveSettings( cfg );
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
BITMAP_STORE * GetBitmapStore()
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
void ThemeChanged()
Notifies the store that the icon theme has been changed by the user, so caches must be invalidated.
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
virtual void LoadSettings(APP_SETTINGS_BASE *aCfg)
Load common frame parameters from a configuration file.
virtual void SaveSettings(APP_SETTINGS_BASE *aCfg)
Save common frame parameters to a configuration data file.
APP_SETTINGS_BASE * KifaceSettings() const
void SetKiway(wxWindow *aDest, KIWAY *aKiway)
It is only used for debugging, since "this" is not a wxWindow*.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
bool m_RegulatorListChanged
const wxString GetDataFilename()
ATTENUATOR * m_CurrAttenuator
std::vector< ATTENUATOR * > m_AttenuatorList
wxRadioBox * GetAttenuatorsSelector()
wxRadioBox * GetTranslineSelector()
TRANSLINE_TYPE_ID GetCurrTransLineType()
void OnPageChanged(wxTreebookEvent &aEvent)
PCB_CALCULATOR_FRAME(KIWAY *aKiway, wxWindow *aParent)
std::vector< CALCULATOR_PANEL * > m_panels
void OnUpdateUI(wxUpdateUIEvent &event)
void onThemeChanged(wxSysColourChangedEvent &aEvent)
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void OnClosePcbCalc(wxCloseEvent &event)
void AddCalculator(CALCULATOR_PANEL *aPanel, const wxString &panelUIName)
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
std::map< std::size_t, CALCULATOR_PANEL * > m_panelTypes
Represent a set of closed polygons.
wxFont GetControlFont(wxWindow *aWindow)
std::vector< FAB_LAYER_COLOR > dummy