21#include <wx/treebook.h>
64 wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL,
73 SetSizeHints( wxDefaultSize, wxDefaultSize );
89 wxIconBundle icon_bundle;
92 icon_bundle.AddIcon( icon );
94 icon_bundle.AddIcon( icon );
96 icon_bundle.AddIcon( icon );
98 icon_bundle.AddIcon( icon );
100 icon_bundle.AddIcon( icon );
102 SetIcons( icon_bundle );
116 GetSizer()->SetSizeHints(
this );
125 for(
size_t pageId = 0; pageId <
m_treebook->GetPageCount(); pageId++ )
132 Bind( wxEVT_SYS_COLOUR_CHANGED,
135 m_treebook->Connect( wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED, wxTreebookEventHandler(
142 m_treebook->Disconnect( wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED, wxTreebookEventHandler(
162 m_treebook->AddPage(
nullptr,
_(
"General system design" ) );
167 m_treebook->AddPage(
nullptr,
_(
"Power, current and isolation" ) );
191 regPanel->ReadDataFile();
201 wxCHECK( base_frame, );
205 wxMenuBar* oldMenuBar = base_frame->GetMenuBar();
212 fileMenu->
AddClose(
_(
"Calculator Tools" ) );
213 fileMenu->
AddQuit(
_(
"Calculator Tools" ) );
221 prefsMenu->AppendSeparator();
227 menuBar->Append( fileMenu,
_(
"&File" ) );
228 menuBar->Append( prefsMenu,
_(
"&Preferences" ) );
229 base_frame->AddStandardHelpMenu( menuBar );
231 base_frame->SetMenuBar( menuBar );
240 SetTitle(
_(
"Calculator Tools" ) );
262 int page = aEvent.GetSelection();
265 if (
m_treebook->GetPageParent( page ) == wxNOT_FOUND )
282 m_treebook->AddSubPage( aPanel, panelUIName );
293 panel->ThemeChanged();
310 wxASSERT( translinePanel );
311 wxASSERT( attenPanel );
312 wxASSERT( viaSizePanel );
313 wxASSERT( regulPanel );
316 wxCommandEvent event2( wxEVT_RADIOBUTTON );
327 wxCommandEvent event2( wxEVT_RADIOBUTTON );
337 viaSizePanel->Layout();
338 regulPanel->Layout();
352 wxASSERT( regPanel );
357 wxString title =
_(
"Write Data Failed" );
361 msg =
_(
"No data filename to save modifications.\n"
362 "Do you want to exit and abandon your changes?" );
364 if( wxMessageBox( msg, title, wxYES_NO | wxICON_QUESTION ) == wxNO )
371 msg.Printf(
_(
"Unable to write file '%s'\n"
372 "Do you want to exit and abandon your changes?"),
375 if( wxMessageBox( msg, title, wxYES_NO | wxICON_ERROR ) == wxNO )
387 if( aCfg ==
nullptr )
397 panel->LoadSettings( cfg );
403 if( aCfg ==
nullptr )
416 panel->SaveSettings( cfg );
constexpr EDA_IU_SCALE unityScale
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()
static TOOL_ACTION openPreferences
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.
Handle actions that are shared between different applications.
virtual APP_SETTINGS_BASE * config() const
Return the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
EDA_BASE_FRAME(wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName, KIWAY *aKiway, const EDA_IU_SCALE &aIuScale)
void AddMenuLanguageList(ACTION_MENU *aMasterMenu, TOOL_INTERACTIVE *aControlTool)
Create a menu list for language choice, and add it as submenu to MasterMenu.
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.
void ReCreateMenuBar()
Recreate the menu bar.
APP_SETTINGS_BASE * KifaceSettings() const
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
KIWAY_PLAYER(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName, const EDA_IU_SCALE &aIuScale)
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()
PCB calculator the main frame.
void doReCreateMenuBar() override
void OnPageChanged(wxTreebookEvent &aEvent)
PCB_CALCULATOR_FRAME(KIWAY *aKiway, wxWindow *aParent)
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
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 OnExit(wxCommandEvent &aEvent)
Event handler for the wxID_EXIT and wxID_CLOSE events.
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.
KICOMMON_API wxFont GetControlFont(wxWindow *aWindow)
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
std::vector< FAB_LAYER_COLOR > dummy