40 #include <wx/listbox.h> 41 #include <wx/tokenzr.h> 42 #include <wx/numformatter.h> 82 wxDefaultPosition, wxDefaultSize,
86 m_wizardListShown( false )
104 GetGalDisplayOptions(),
106 SetCanvas( gal_drawPanel );
108 SetBoard(
new BOARD() );
112 SetScreen(
new PCB_SCREEN( GetPageSizeIU() ) );
113 GetScreen()->m_Center =
true;
117 SetSize( m_framePos.x, m_framePos.y, m_frameSize.x, m_frameSize.y );
124 PCB_BASE_FRAME* caller = dynamic_cast<PCB_BASE_FRAME*>( aParent );
139 SetDisplayOptions( disp_opts );
152 m_toolManager->InitTools();
155 m_toolManager->InvokeTool(
"pcbnew.InteractiveSelection" );
162 m_parametersPanel =
new wxPanel(
this, wxID_ANY );
165 wxDefaultPosition, wxDefaultSize, 0,
nullptr,
166 wxLB_HSCROLL | wxNO_BORDER );
168 auto divider =
new wxStaticLine( m_parametersPanel, wxID_ANY,
169 wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
173 m_parameterGrid->PushEventHandler(
new GRID_TRICKS( m_parameterGrid ) );
177 wxBoxSizer* parametersSizer =
new wxBoxSizer( wxHORIZONTAL );
178 parametersSizer->Add( m_pageList, 0, wxEXPAND, 5 );
179 parametersSizer->Add( divider, 0, wxEXPAND, 5 );
180 parametersSizer->Add( m_parameterGrid, 1, wxEXPAND, 5 );
181 m_parametersPanel->SetSizer( parametersSizer );
182 m_parametersPanel->Layout();
185 m_buildMessageBox =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString,
186 wxDefaultPosition, wxDefaultSize,
187 wxTE_MULTILINE | wxTE_READONLY | wxNO_BORDER );
189 DisplayWizardInfos();
191 m_auimgr.SetManagedWindow(
this );
193 m_auimgr.AddPane( m_mainToolBar,
EDA_PANE().HToolbar().Name(
"MainToolbar" ).Top().Layer(6) );
194 m_auimgr.AddPane( m_messagePanel,
EDA_PANE().Messages().Name(
"MsgPanel" ).Bottom().Layer(6)
195 .BestSize( -1, m_msgFrameHeight ) );
197 m_auimgr.AddPane( m_parametersPanel,
EDA_PANE().Palette().Name(
"Params" ).
Left().Position(0)
198 .Caption(
_(
"Parameters" ) ).MinSize( 360, 180 ) );
199 m_auimgr.AddPane( m_buildMessageBox,
EDA_PANE().Palette().Name(
"Output" ).
Left().Position(1)
200 .CaptionVisible(
false ).MinSize( 360, -1 ) );
202 m_auimgr.AddPane( GetCanvas(), wxAuiPaneInfo().Name(
"DrawFrame" ).CentrePane() );
204 auto& galOpts = GetGalDisplayOptions();
205 galOpts.m_fullscreenCursor =
true;
206 galOpts.m_forceDisplayCursor =
true;
207 galOpts.m_axesEnabled =
true;
212 SetActiveLayer(
F_Cu );
231 GetCanvas()->SetEvtHandlerEnabled(
false );
289 return Pgm().GetSettingsManager().GetColorSettings( currentTheme );
309 std::vector<MSG_PANEL_ITEM> items;
356 if( !footprintWizard )
362 for(
int i = 0; i < max_page; i++ )
384 if( footprintWizard ==
nullptr )
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( wxT(
"," ) ) )
432 wxStringTokenizer tokenizer( units, wxT(
"," ) );
433 wxArrayString options;
435 while( tokenizer.HasMoreTokens() )
437 options.Add( tokenizer.GetNextToken() );
441 new wxGridCellChoiceEditor( options ) );
443 units = wxEmptyString;
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 )
571 frm3Dtitle.Printf(
_(
"ModView: 3D Viewer [%s]" ),
m_wizardName );
592 _(
"Select wizard script to run" ) );
597 _(
"Reset wizard parameters to default") );
602 _(
"Select previous parameters page" ) );
605 _(
"Select next parameters page" ) );
607 #if 0 // Currently: the 3D viewer is not useful 622 _(
"Export footprint to editor" ) );
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.
static TOOL_ACTION show3DViewer
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.
EDA_3D_VIEWER_FRAME * Get3DViewerFrame()
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...
FOOTPRINT_EDITOR_SETTINGS * GetFootprintEditorSettings() const
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
static TOOL_ACTION pluginsReload
Scripting Actions.
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
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.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
static TOOL_ACTION zoomOutCenter
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
Get 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.
Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard.
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.
Definition of file extensions used in Kicad.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
#define KICAD_DEFAULT_DRAWFRAME_STYLE
WINDOW_SETTINGS m_FootprintViewer
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
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...
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.
show a marker on pads with no nets
Gather all the actions that are shared by tools.
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
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
NETCLASS * GetDefault() const
static constexpr int KICAD_AUI_TB_STYLE
< Default style flags used for wxAUI toolbars.
void ClearRows()
wxWidgets recently added an ASSERT which fires if the position is greater than or equal to the number...
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...
Abstract interface for BOARD_ITEMs capable of storing other items inside.
Message panel definition file.
bool m_DisplayPadClearance
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.