40 #include <wx/tokenzr.h> 41 #include <wx/numformatter.h> 81 wxDefaultPosition, wxDefaultSize,
85 m_wizardListShown( false )
103 GetGalDisplayOptions(),
105 SetCanvas( gal_drawPanel );
107 SetBoard(
new BOARD() );
111 SetScreen(
new PCB_SCREEN( GetPageSizeIU() ) );
112 GetScreen()->m_Center =
true;
114 LoadSettings( config() );
116 SetSize( m_framePos.x, m_framePos.y, m_frameSize.x, m_frameSize.y );
123 PCB_BASE_FRAME* caller = dynamic_cast<PCB_BASE_FRAME*>( aParent );
138 SetDisplayOptions( disp_opts );
151 m_toolManager->InitTools();
154 m_toolManager->InvokeTool(
"pcbnew.InteractiveSelection" );
161 m_parametersPanel =
new wxPanel(
this, wxID_ANY );
164 wxDefaultPosition, wxDefaultSize, 0,
NULL,
165 wxLB_HSCROLL | wxNO_BORDER );
167 auto divider =
new wxStaticLine( m_parametersPanel, wxID_ANY,
168 wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
172 m_parameterGrid->PushEventHandler(
new GRID_TRICKS( m_parameterGrid ) );
176 wxBoxSizer* parametersSizer =
new wxBoxSizer( wxHORIZONTAL );
177 parametersSizer->Add( m_pageList, 0, wxEXPAND, 5 );
178 parametersSizer->Add( divider, 0, wxEXPAND, 5 );
179 parametersSizer->Add( m_parameterGrid, 1, wxEXPAND, 5 );
180 m_parametersPanel->SetSizer( parametersSizer );
181 m_parametersPanel->Layout();
184 m_buildMessageBox =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString,
185 wxDefaultPosition, wxDefaultSize,
186 wxTE_MULTILINE | wxTE_READONLY | wxNO_BORDER );
188 DisplayWizardInfos();
190 m_auimgr.SetManagedWindow(
this );
192 m_auimgr.AddPane( m_mainToolBar,
EDA_PANE().HToolbar().Name(
"MainToolbar" ).Top().Layer(6) );
193 m_auimgr.AddPane( m_messagePanel,
EDA_PANE().Messages().Name(
"MsgPanel" ).Bottom().Layer(6)
194 .BestSize( -1, m_msgFrameHeight ) );
196 m_auimgr.AddPane( m_parametersPanel,
EDA_PANE().Palette().Name(
"Params" ).
Left().Position(0)
197 .Caption(
_(
"Parameters" ) ).MinSize( 360, 180 ) );
198 m_auimgr.AddPane( m_buildMessageBox,
EDA_PANE().Palette().Name(
"Output" ).
Left().Position(1)
199 .CaptionVisible(
false ).MinSize( 360, -1 ) );
201 m_auimgr.AddPane( GetCanvas(), wxAuiPaneInfo().Name(
"DrawFrame" ).CentrePane() );
203 auto& galOpts = GetGalDisplayOptions();
204 galOpts.m_fullscreenCursor =
true;
205 galOpts.m_forceDisplayCursor =
true;
206 galOpts.m_axesEnabled =
true;
211 SetActiveLayer(
F_Cu );
230 GetCanvas()->SetEvtHandlerEnabled(
false );
289 return Pgm().GetSettingsManager().GetColorSettings( currentTheme );
354 if( !footprintWizard )
360 for(
int i = 0; i<max_page; i++ )
382 if( footprintWizard ==
NULL )
406 wxString designator,
name, value, units, hint;
408 for(
unsigned int i = 0; i< namesList.size(); i++ )
410 designator = designatorsList[i];
412 value = valuesList[i];
413 units = typesList[i];
430 else if( units.Contains(
"," ) )
432 wxStringTokenizer tokenizer( units,
"," );
433 wxArrayString options;
435 while( tokenizer.HasMoreTokens() )
437 options.Add( tokenizer.GetNextToken() );
460 value.Replace(
",", wxNumberFormatter::GetDecimalSeparator() );
461 value.Replace(
".", wxNumberFormatter::GetDecimalSeparator() );
534 auto cfg = dynamic_cast<PCBNEW_SETTINGS*>( aCfg );
537 return cfg ? &cfg->m_FootprintWizard :
nullptr;
544 if( !event.GetActive() )
556 bool footprintWizardsChanged =
false;
558 if( footprintWizardsChanged )
576 frm3Dtitle.Printf(
_(
"ModView: 3D Viewer [%s]" ),
m_wizardName );
597 _(
"Select wizard script to run" ) );
602 _(
"Reset wizard parameters to default") );
607 _(
"Select previous parameters page" ) );
610 _(
"Select next parameters page" ) );
612 #if 0 // Currently: the 3D viewer is not useful 627 _(
"Export footprint to editor" ) );
646 #if defined(KICAD_SCRIPTING) 656 brd_frame->PythonPluginsReload();
static TOOL_ACTION show3DViewer
show a marker on pads with no nets
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the #VIEW_CONTROLS instance used in the panel.
void SetElementVisibility(GAL_LAYER_ID aLayer, bool aNewState)
Change the visibility of an element category.
static TOOL_ACTION zoomInCenter
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
Implementation of conversion functions that require both schematic and board internal units.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
const BITMAP_OPAQUE module_wizard_xpm[1]
FOOTPRINT_EDITOR_SETTINGS * GetFootprintEditorSettings() const
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
virtual void Update3DView(bool aReloadRequest, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
static constexpr GAL_TYPE GAL_FALLBACK
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
static TOOL_ACTION zoomFitScreen
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
void SetVisibleAlls()
Change the bit-mask of visible element categories and layers.
#define FOOTPRINT_WIZARD_FRAME_NAME
ACTION_TOOLBAR * m_mainToolBar
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
The base class for create windows for drawing purpose.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
static TOOL_ACTION zoomOutCenter
const BITMAP_OPAQUE reload_xpm[1]
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Stores the common settings that are saved and loaded for each window / frame.
Container for display options like enable/disable some optional drawings.
FOOTPRINT * GetFirstFootprint() const
Gets the first footprint on the board or nullptr.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
void DisplayBoard(BOARD *aBoard)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
void SetClearance(int aClearance)
Handle actions that are shared between different frames in PcbNew.
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.
const BITMAP_OPAQUE lib_previous_xpm[1]
Definition of file extensions used in Kicad.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
const BITMAP_OPAQUE lib_next_xpm[1]
#define KICAD_DEFAULT_DRAWFRAME_STYLE
WINDOW_SETTINGS m_FootprintViewer
virtual void ClearMsgPanel()
Clear all messages from the message panel.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
Specialization of the wxAuiPaneInfo class for KiCad panels.
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...
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void UpdateColors()
Update the color settings in the painter and GAL.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
void PythonPluginsReloadBase()
Helper function PythonPluginsReloadBase Reload Python plugins if they are newer than the already load...
Gather all the actions that are shared by tools.
Declaration of the eda_3d_viewer class.
Common, abstract interface for edit frames.
void DismissModal(bool aRetVal, const wxString &aResult=wxEmptyString)
Information pertinent to a Pcbnew printed circuit board.
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Set a dispatcher that processes events and forwards them to tools.
static TOOL_ACTION zoomRedraw
NETCLASS * GetDefault() const
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
static constexpr int KICAD_AUI_TB_STYLE
< Default style flags used for wxAUI toolbars.
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
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.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
Message panel definition file.
EDA_3D_VIEWER * Get3DViewerFrame()
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
void StopDrawing()
Prevent the GAL canvas from further drawing until it is recreated or StartDrawing() is called.
void SetColLabelSize(int aHeight)
Hide wxGrid's SetColLabelSize() method with one which makes sure the size is tall enough for the syst...
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
wxString m_ColorTheme
Active color theme name.