40#include <wx/listbox.h>
41#include <wx/statline.h>
42#include <wx/tokenzr.h>
43#include <wx/numformatter.h>
84 wxDefaultPosition, wxDefaultSize,
88 m_wizardListShown( false )
100 m_wizardName.Empty();
106 GetGalDisplayOptions(),
108 SetCanvas( gal_drawPanel );
110 SetBoard(
new BOARD() );
114 SetScreen(
new PCB_SCREEN( GetPageSizeIU() ) );
115 GetScreen()->m_Center =
true;
119 SetSize( m_framePos.x, m_framePos.y, m_frameSize.x, m_frameSize.y );
148 m_toolManager->InitTools();
151 m_toolManager->InvokeTool(
"pcbnew.InteractiveSelection" );
158 m_parametersPanel =
new wxPanel(
this, wxID_ANY );
161 wxDefaultPosition, wxDefaultSize, 0,
nullptr,
162 wxLB_HSCROLL | wxNO_BORDER );
164 auto divider =
new wxStaticLine( m_parametersPanel, wxID_ANY,
165 wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
169 m_parameterGrid->PushEventHandler(
new GRID_TRICKS( m_parameterGrid ) );
173 wxBoxSizer* parametersSizer =
new wxBoxSizer( wxHORIZONTAL );
174 parametersSizer->Add( m_pageList, 0, wxEXPAND, 5 );
175 parametersSizer->Add( divider, 0, wxEXPAND, 5 );
176 parametersSizer->Add( m_parameterGrid, 1, wxEXPAND, 5 );
177 m_parametersPanel->SetSizer( parametersSizer );
178 m_parametersPanel->Layout();
181 m_buildMessageBox =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString,
182 wxDefaultPosition, wxDefaultSize,
183 wxTE_MULTILINE | wxTE_READONLY | wxNO_BORDER );
185 DisplayWizardInfos();
187 m_auimgr.SetManagedWindow(
this );
189 m_auimgr.AddPane( m_mainToolBar,
EDA_PANE().HToolbar().Name(
"MainToolbar" ).Top().Layer(6) );
190 m_auimgr.AddPane( m_messagePanel,
EDA_PANE().Messages().Name(
"MsgPanel" ).Bottom().Layer(6)
191 .BestSize( -1, m_msgFrameHeight ) );
193 m_auimgr.AddPane( m_parametersPanel,
EDA_PANE().Palette().Name(
"Params" ).Left().Position(0)
194 .Caption(
_(
"Parameters" ) ).MinSize( 360, 180 ) );
195 m_auimgr.AddPane( m_buildMessageBox,
EDA_PANE().Palette().Name(
"Output" ).Left().Position(1)
196 .CaptionVisible(
false ).MinSize( 360, -1 ) );
198 m_auimgr.AddPane( GetCanvas(), wxAuiPaneInfo().Name(
"DrawFrame" ).CentrePane() );
200 auto& galOpts = GetGalDisplayOptions();
201 galOpts.m_fullscreenCursor =
true;
202 galOpts.m_forceDisplayCursor =
true;
203 galOpts.m_axesEnabled =
true;
208 SetActiveLayer(
F_Cu );
227 GetCanvas()->SetEvtHandlerEnabled(
false );
305 std::vector<MSG_PANEL_ITEM> items;
352 if( !footprintWizard )
358 for(
int i = 0; i < max_page; i++ )
380 if( footprintWizard ==
nullptr )
402 wxString designator,
name, value, units, hint;
404 for(
unsigned int i = 0; i < namesList.size(); i++ )
406 designator = designatorsList[i];
408 value = valuesList[i];
409 units = typesList[i];
426 else if( units.Contains( wxT(
"," ) ) )
428 wxStringTokenizer tokenizer( units, wxT(
"," ) );
429 wxArrayString options;
431 while( tokenizer.HasMoreTokens() )
433 options.Add( tokenizer.GetNextToken() );
437 new wxGridCellChoiceEditor( options ) );
456 value.Replace(
",", wxNumberFormatter::GetDecimalSeparator() );
457 value.Replace(
".", wxNumberFormatter::GetDecimalSeparator() );
533 return cfg ? &cfg->m_FootprintWizard :
nullptr;
540 if( !event.GetActive() )
552 bool footprintWizardsChanged =
false;
554 if( footprintWizardsChanged )
567 frm3Dtitle.Printf(
_(
"ModView: 3D Viewer [%s]" ),
m_wizardName );
588 _(
"Select wizard script to run" ) );
593 _(
"Reset wizard parameters to default") );
598 _(
"Select previous parameters page" ) );
601 _(
"Select next parameters page" ) );
617 wxEmptyString,
KiBitmap( BITMAPS::export_footprint_names ),
618 _(
"Export footprint to editor" ) );
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
static TOOL_ACTION zoomRedraw
static TOOL_ACTION show3DViewer
static TOOL_ACTION zoomOutCenter
static TOOL_ACTION pluginsReload
static TOOL_ACTION zoomFitScreen
static TOOL_ACTION zoomInCenter
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
wxString m_ColorTheme
Active color theme name.
std::shared_ptr< NET_SETTINGS > m_NetSettings
Abstract interface for BOARD_ITEMs capable of storing other items inside.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Information pertinent to a Pcbnew printed circuit board.
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
void SetVisibleAlls()
Change the bit-mask of visible element categories and layers.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Color settings are a bit different than most of the settings objects in that there can be more than o...
Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard.
static constexpr int KICAD_AUI_TB_STYLE
< Default style flags used for wxAUI toolbars.
virtual void ClearMsgPanel()
Clear all messages from the message panel.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
ACTION_TOOLBAR * m_mainToolBar
static constexpr GAL_TYPE GAL_FALLBACK
void StopDrawing()
Prevent the GAL canvas from further drawing until it is recreated or StartDrawing() is called.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the #VIEW_CONTROLS instance used in the panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Set a dispatcher that processes events and forwards them to tools.
virtual void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
Specialization of the wxAuiPaneInfo class for KiCad panels.
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
void DismissModal(bool aRetVal, const wxString &aResult=wxEmptyString)
bool IsModal() const override
Return true if the frame is shown in our modal mode and false if the frame is shown as an usual frame...
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
WINDOW_SETTINGS m_FootprintViewer
Gather all the actions that are shared by tools.
Common, abstract interface for edit frames.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
FOOTPRINT_EDITOR_SETTINGS * GetFootprintEditorSettings() const
EDA_3D_VIEWER_FRAME * Get3DViewerFrame()
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
Handle actions that are shared between different frames in PcbNew.
void UpdateColors()
Update the color settings in the painter and GAL.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void DisplayBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
The main frame for Pcbnew.
virtual SETTINGS_MANAGER & GetSettingsManager() const
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
EDA_UNITS GetUserUnits() const
void SetColLabelSize(int aHeight)
Hide wxGrid's SetColLabelSize() method with one which makes sure the size is tall enough for the syst...
void ClearRows()
wxWidgets recently added an ASSERT which fires if the position is greater than or equal to the number...
Declaration of the eda_3d_viewer class.
#define KICAD_DEFAULT_DRAWFRAME_STYLE
#define FOOTPRINT_WIZARD_FRAME_NAME
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Message panel definition file.
@ ID_FOOTPRINT_WIZARD_PREVIOUS
@ ID_FOOTPRINT_WIZARD_NEXT
@ ID_FOOTPRINT_WIZARD_DONE
@ ID_FOOTPRINT_WIZARD_SELECT_WIZARD
@ ID_FOOTPRINT_WIZARD_RESET_TO_DEFAULT
@ ID_FOOTPRINT_WIZARD_PARAMETER_LIST
@ ID_FOOTPRINT_WIZARD_PAGE_LIST
PGM_BASE & Pgm()
The global Program "get" accessor.
KIWAY Kiway(KFCTL_STANDALONE)
Stores the common settings that are saved and loaded for each window / frame.
Definition of file extensions used in Kicad.