KiCad PCB EDA Suite
display_footprints_frame.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2015 Wayne Stambaugh <stambaughw@gmail.com>
6  * Copyright (C) 2007-2019 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #include <bitmaps.h>
27 #include <class_board.h>
28 #include <class_module.h>
29 #include <common.h>
30 #include <confirm.h>
31 #include <fp_lib_table.h>
32 #include <id.h>
33 #include <lib_id.h>
34 #include <macros.h>
35 #include <msgpanel.h>
36 #include <pcb_draw_panel_gal.h>
37 #include <pcb_painter.h>
38 #include <tool/action_toolbar.h>
39 #include <tool/common_tools.h>
40 #include <tool/tool_dispatcher.h>
41 #include <tool/tool_manager.h>
42 #include <tool/zoom_tool.h>
43 #include <cvpcb_mainframe.h>
45 #include <tools/cvpcb_actions.h>
48 
49 // Colors for layers and items
51 
52 
53 BEGIN_EVENT_TABLE( DISPLAY_FOOTPRINTS_FRAME, PCB_BASE_FRAME )
58 END_EVENT_TABLE()
59 
60 
62  PCB_BASE_FRAME( aKiway, aParent, FRAME_CVPCB_DISPLAY, _( "Footprint Viewer" ),
63  wxDefaultPosition, wxDefaultSize,
65 {
66  // Give an icon
67  wxIcon icon;
68  icon.CopyFromBitmap( KiBitmap( icon_cvpcb_xpm ) );
69  SetIcon( icon );
70 
71  SetBoard( new BOARD() );
72  SetScreen( new PCB_SCREEN( GetPageSizeIU() ) );
73 
74  // Don't show the default board solder mask clearance. Only the
75  // footprint or pad clearance setting should be shown if it is not 0.
77 
78  LoadSettings( config() );
79 
80  // Initialize grid id to a default value if not found in config or incorrect:
81  if( !( GetScreen()->GridExists( m_LastGridSizeId + ID_POPUP_GRID_LEVEL_1000 ) ) )
83 
84  GetScreen()->SetGrid( m_LastGridSizeId + ID_POPUP_GRID_LEVEL_1000 );
85 
86  // Initialize some display options
87  auto displ_opts = GetDisplayOptions();
88  displ_opts.m_DisplayPadIsol = false; // Pad clearance has no meaning here
89 
90  // Track and via clearance has no meaning here.
91  displ_opts.m_ShowTrackClearanceMode = PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE;
92  SetDisplayOptions( displ_opts );
93 
94  // Create GAL canvas
95 #ifdef __WXMAC__
96  // Cairo renderer doesn't handle Retina displays
98 #else
100 #endif
101  auto* gal_drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize,
102  GetGalDisplayOptions(), backend );
103  SetCanvas( gal_drawPanel );
104 
105  // Now all panels are created, set the window size to the latest saved in config:
106  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
107 
108  // Create the manager and dispatcher & route draw panel events to the dispatcher
109  m_toolManager = new TOOL_MANAGER;
110  m_toolManager->SetEnvironment( GetBoard(), gal_drawPanel->GetView(),
111  gal_drawPanel->GetViewControls(), this );
112  m_actions = new CVPCB_ACTIONS();
113  m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
114  gal_drawPanel->SetEventDispatcher( m_toolDispatcher );
115 
116  m_toolManager->RegisterTool( new COMMON_TOOLS );
117  m_toolManager->RegisterTool( new ZOOM_TOOL );
118  m_toolManager->RegisterTool( new CVPCB_FOOTPRINT_VIEWER_CONTROL );
119  m_toolManager->RegisterTool( new CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL );
120  m_toolManager->InitTools();
121 
122  // Run the control tool, it is supposed to be always active
123  m_toolManager->InvokeTool( "cvpcb.InteractiveSelection" );
124 
125  ReCreateHToolbar();
126  ReCreateVToolbar();
127  ReCreateOptToolbar();
128 
129  m_auimgr.SetManagedWindow( this );
130 
131  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
132  m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
133  m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
134  m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
135  m_auimgr.Update();
136 
137  auto& galOpts = GetGalDisplayOptions();
138  galOpts.m_axesEnabled = true;
139 
140  GetCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
141 
142  ActivateGalCanvas();
143 
144  // Restore last zoom. (If auto-zooming we'll adjust when we load the footprint.)
145  GetCanvas()->GetView()->SetScale( m_lastZoom );
146 
147  updateView();
148 
149  Show( true );
150 }
151 
152 
154 {
156  GetCanvas()->StopDrawing();
157  GetCanvas()->GetView()->Clear();
158  // Be sure any event cannot be fired after frame deletion:
159  GetCanvas()->SetEvtHandlerEnabled( false );
160 
161  // Be sure a active tool (if exists) is deactivated:
162  if( m_toolManager )
164 
165  delete GetScreen();
166  SetScreen( NULL ); // Be sure there is no double deletion
167 }
168 
169 
170 void DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow( wxCloseEvent& event )
171 {
172  Destroy();
173 }
174 
175 
177 {
178  // Currently, no vertical right toolbar.
179  // So do nothing
180 }
181 
182 
184 {
185  if( m_optionsToolBar )
186  return;
187 
188  // Create options tool bar.
189  m_optionsToolBar = new ACTION_TOOLBAR( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
190  KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
191 
192  // TODO: these can be moved to the 'proper' right vertical toolbar if and when there are
193  // actual tools to put there. That, or I'll get around to implementing configurable
194  // toolbars.
197 
198  m_optionsToolBar->AddSeparator();
204 
205  m_optionsToolBar->AddSeparator();
206  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString,
207  KiScaledBitmap( pad_sketch_xpm, this ),
208  _( "Show pads in outline mode" ), wxITEM_CHECK );
209 
211  KiScaledBitmap( text_sketch_xpm, this ),
212  _( "Show texts in line mode" ), wxITEM_CHECK );
213 
215  KiScaledBitmap( show_mod_edge_xpm, this ),
216  _( "Show outlines in line mode" ), wxITEM_CHECK );
217 
218  m_optionsToolBar->Realize();
219 }
220 
221 
223 {
224  if( m_mainToolBar != NULL )
225  return;
226 
227  m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
228  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
229 
230  m_mainToolBar->AddTool( ID_OPTIONS_SETUP, wxEmptyString, KiScaledBitmap( config_xpm, this ),
231  _( "Display options" ) );
232 
233  m_mainToolBar->AddSeparator();
239 
240  m_mainToolBar->AddSeparator();
242 
244 
245  // Grid selection choice box.
247  wxDefaultPosition, wxDefaultSize, 0, NULL );
249  m_mainToolBar->AddControl( m_gridSelectBox );
250 
252 
253  // Zoom selection choice box.
255  wxDefaultPosition, wxDefaultSize, 0, NULL );
257  m_mainToolBar->AddControl( m_zoomSelectBox );
258 
259  // after adding the buttons to the toolbar, must call Realize() to reflect
260  // the changes
261  m_mainToolBar->Realize();
262 }
263 
264 
265 void DISPLAY_FOOTPRINTS_FRAME::LoadSettings( wxConfigBase* aCfg )
266 {
268 
269  m_configSettings.Load( aCfg ); // mainly, load the color config
270 
271  aCfg->Read( ConfigBaseName() + AUTO_ZOOM_KEY, &m_autoZoom, true );
272  aCfg->Read( ConfigBaseName() + ZOOM_KEY, &m_lastZoom, 10.0 );
273 }
274 
275 
276 void DISPLAY_FOOTPRINTS_FRAME::SaveSettings( wxConfigBase* aCfg )
277 {
279 
280  aCfg->Write( ConfigBaseName() + AUTO_ZOOM_KEY, m_autoZoom );
281  aCfg->Write( ConfigBaseName() + ZOOM_KEY, GetCanvas()->GetView()->GetScale() );
282 }
283 
284 
286 {
287  auto painter = static_cast<KIGFX::PCB_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
288 
289  painter->GetSettings()->LoadDisplayOptions( GetDisplayOptions(), false );
290 
292  GetCanvas()->Refresh();
293 }
294 
295 
303 {
304 }
305 
306 
308 {
309  return COLOR4D( DARKGRAY );
310 }
311 
312 
313 MODULE* DISPLAY_FOOTPRINTS_FRAME::Get_Module( const wxString& aFootprintName )
314 {
315  MODULE* footprint = NULL;
316 
317  try
318  {
319  LIB_ID fpid;
320 
321  if( fpid.Parse( aFootprintName, LIB_ID::ID_PCB ) >= 0 )
322  {
323  DisplayInfoMessage( this, wxString::Format( _( "Footprint ID \"%s\" is not valid." ),
324  GetChars( aFootprintName ) ) );
325  return NULL;
326  }
327 
328  std::string nickname = fpid.GetLibNickname();
329  std::string fpname = fpid.GetLibItemName();
330 
331  wxLogDebug( wxT( "Load footprint \"%s\" from library \"%s\"." ),
332  fpname.c_str(), nickname.c_str() );
333 
334  footprint = Prj().PcbFootprintLibs( Kiway() )->FootprintLoad(
335  FROM_UTF8( nickname.c_str() ), FROM_UTF8( fpname.c_str() ) );
336  }
337  catch( const IO_ERROR& ioe )
338  {
339  DisplayError( this, ioe.What() );
340  return NULL;
341  }
342 
343  if( footprint )
344  {
345  footprint->SetParent( (EDA_ITEM*) GetBoard() );
346  footprint->SetPosition( wxPoint( 0, 0 ) );
347  return footprint;
348  }
349 
350  wxString msg = wxString::Format( _( "Footprint \"%s\" not found" ), aFootprintName.GetData() );
351  DisplayError( this, msg );
352  return NULL;
353 }
354 
355 
357 {
358  CVPCB_MAINFRAME* parentframe = (CVPCB_MAINFRAME *) GetParent();
359  MODULE* module = nullptr;
360  const FOOTPRINT_INFO* module_info = nullptr;
361 
363  GetCanvas()->GetView()->Clear();
364 
365  wxString footprintName = parentframe->GetSelectedFootprint();
366 
367  if( footprintName.IsEmpty() )
368  {
369  COMPONENT* comp = parentframe->GetSelectedComponent();
370 
371  if( comp )
372  footprintName = comp->GetFPID().GetUniStringLibId();
373  }
374 
375  if( !footprintName.IsEmpty() )
376  {
377  SetTitle( wxString::Format( _( "Footprint: %s" ), footprintName ) );
378 
379  module = Get_Module( footprintName );
380 
381  module_info = parentframe->m_FootprintsList->GetModuleInfo( footprintName );
382  }
383 
384  if( module )
385  GetBoard()->Add( module );
386 
387  if( module_info )
388  SetStatusText( wxString::Format( _( "Lib: %s" ), module_info->GetLibNickname() ), 0 );
389  else
390  SetStatusText( wxEmptyString, 0 );
391 
392  updateView();
393 
394  UpdateStatusBar();
395 
396  GetCanvas()->Refresh();
397  Update3DView( true );
398 }
399 
400 
402 {
403  PCB_DRAW_PANEL_GAL* dp = static_cast<PCB_DRAW_PANEL_GAL*>( GetCanvas() );
404  dp->UseColorScheme( &Settings().Colors() );
405  dp->DisplayBoard( GetBoard() );
406 
408 
409  if( m_autoZoom )
411  else
413 
414  UpdateMsgPanel();
415 }
416 
417 
419 {
420  MODULE* footprint = GetBoard()->GetFirstModule();
421  MSG_PANEL_ITEMS items;
422 
423  if( footprint )
424  footprint->GetMsgPanelInfo( m_userUnits, items );
425 
426  SetMsgPanel( items );
427 }
428 
429 
431 {
433  m_mainToolBar->Refresh();
434 
440  m_optionsToolBar->Refresh();
441 }
442 
443 
444 /*
445  * Redraw the BOARD items but not cursors, axis or grid.
446  */
447 void BOARD::Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset )
448 {
449  if( !m_modules.empty() )
450  GetFirstModule()->Print( aFrame, aDC );
451 }
452 
MODULES m_modules
MODULES for components on the board, owned by pointer.
Definition: class_board.h:176
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:236
int m_SolderMaskMargin
Solder mask margin.
static TOOL_ACTION show3DViewer
Definition: actions.h:148
Class ACTION_TOOLBAR.
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
FOOTPRINT_LIST * m_FootprintsList
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:62
static TOOL_ACTION zoomInCenter
Definition: actions.h:90
FOOTPRINT_INFO * GetModuleInfo(const wxString &aFootprintId)
Get info for a module by id.
virtual bool IsGridVisible() const override
Function IsGridVisible()
Model changes (required full reload)
Definition: tool_base.h:82
COLOR4D GetGridColor() override
Function GetGridColor() , virtual.
This file is part of the common library.
wxString GetLibNickname() const override
void Load(wxConfigBase *aCfg) override
ACTION_TOOLBAR * m_optionsToolBar
virtual void SetScreen(BASE_SCREEN *aScreen)
static TOOL_ACTION zoomTool
Definition: actions.h:95
static const bool TOGGLE
void InstallOptionsDisplay(wxCommandEvent &event)
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
MODULE * FootprintLoad(const wxString &aNickname, const wxString &aFootprintName)
Function FootprintLoad.
void UpdateAllItems(int aUpdateFlags)
Updates all items in the view according to the given flags.
Definition: view.cpp:1444
void Add(const TOOL_ACTION &aAction, bool aIsToggleEntry=false)
Function Add() Adds a TOOL_ACTION-based button to the toolbar.
static TOOL_ACTION zoomFitScreen
Definition: actions.h:93
void ApplyDisplaySettingsToGAL()
Updates the GAL with display settings changes.
wxString ConfigBaseName()
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:531
MODULE * Get_Module(const wxString &CmpName)
#define FOOTPRINTVIEWER_FRAME_NAME
ACTION_TOOLBAR * m_mainToolBar
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
wxBitmap KiScaledBitmap(BITMAP_DEF aBitmap, EDA_BASE_FRAME *aWindow)
Construct a wxBitmap from a memory record, scaling it if device DPI demands it.
Definition: bitmap.cpp:116
Item needs to be redrawn.
Definition: view_item.h:61
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Function GetDisplayOptions returns the display options current in use Display options are relative to...
static TOOL_ACTION imperialUnits
Definition: actions.h:136
wxChoice * m_gridSelectBox
void DeactivateTool()
Function DeactivateTool() Deactivates the currently active tool.
void updateView()
update the gal canvas (view, colors ...)
static TOOL_ACTION zoomOutCenter
Definition: actions.h:91
Class DISPLAY_FOOTPRINTS_FRAME is used to display footprints.
static const wxChar AUTO_ZOOM_KEY[]
Key in KifaceSettings to store the canvas type.
void OnCloseWindow(wxCloseEvent &Event) override
This file contains miscellaneous commonly used macros and functions.
Class CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL.
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:169
Class TOOL_MANAGER.
Definition: tool_manager.h:50
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
static TOOL_ACTION measureTool
Definition: actions.h:144
Class UNDO_REDO_CONTAINER is a holder to handle alist of undo (or redo) command.
static TOOL_ACTION centerContents
Definition: actions.h:96
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
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)
Function DisplayBoard adds all items from the current board to the VIEW, so they can be displayed by ...
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:225
void Clear()
Function Clear() Removes all items from the view.
Definition: view.cpp:1111
static TOOL_ACTION toggleGrid
Definition: actions.h:132
PCB_GENERAL_SETTINGS & Settings()
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
Definition: common.h:134
wxChoice * m_zoomSelectBox
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_INSERT) override
Adds an item to the container.
static TOOL_ACTION togglePolarCoords
Definition: actions.h:139
void LoadSettings(wxConfigBase *aCfg) override
Load common frame parameters from a configuration file.
MODULE * GetFirstModule() const
Gets the first module in the list (used in footprint viewer/editor) or NULL if none.
Definition: class_board.h:276
void ResetTools(TOOL_BASE::RESET_REASON aReason)
Function ResetTools() Resets all tools (i.e.
Class KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within...
Definition: kiway.h:274
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
#define KICAD_DEFAULT_DRAWFRAME_STYLE
PCB_GENERAL_SETTINGS m_configSettings
Class CVPCB_ACTIONS.
Definition: cvpcb_actions.h:40
void SyncToolbars() override
Update the toolbars (mostly settings/check buttons/checkboxes) with the current controller state.
void SetPosition(const wxPoint &aPos) override
void SaveSettings(wxConfigBase *aCfg) override
Saves common frame parameters to a configuration data file.
#define _(s)
virtual KIGFX::PCB_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
Specialization of the wxAuiPaneInfo class for KiCad panels.
void Print(PCB_BASE_FRAME *aFrame, wxDC *aDC, const wxPoint &aOffset=ZeroOffset) override
Function Print.
void SaveSettings(wxConfigBase *aCfg) override
Saves common frame parameters to a configuration data file.
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 UseColorScheme(const COLORS_DESIGN_SETTINGS *aSettings)
Function UseColorScheme Applies layer color settings.
Class COMMON_TOOLS.
Definition: common_tools.h:38
Class TOOL_DISPATCHER.
void UpdateGridSelectBox()
Class COMPONENT is used to store components and all of their related information found in a netlist.
Definition: pcb_netlist.h:85
BOARD * GetBoard()
VTBL_ENTRY FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
static TOOL_ACTION metricUnits
Definition: actions.h:137
wxString GetSelectedFootprint()
void InitDisplay()
Function InitDisplay Refresh the full display for this frame: Set the title, the status line and redr...
virtual void UpdateStatusBar() override
Update the status bar information.
void GetMsgPanelInfo(EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:101
EDA_UNITS_T m_userUnits
virtual void OnSelectGrid(wxCommandEvent &event)
Command event handler for selecting grid sizes.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
EDA_UNITS_T GetUserUnits() const
Return the user units currently in use.
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:161
COLORS_DESIGN_SETTINGS g_ColorsSettings(FRAME_CVPCB_DISPLAY)
void LoadSettings(wxConfigBase *aCfg) override
Load common frame parameters from a configuration file.
static TOOL_ACTION zoomRedraw
Definition: actions.h:87
COMPONENT * GetSelectedComponent()
Get the selected component from the component listbox.
void Toggle(const TOOL_ACTION &aAction, bool aState)
Applies the default toggle action.
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, EDA_BASE_FRAME *aFrame)
Sets the work environment (model, view, view controls and the parent window).
The common library.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:102
void KiScaledSeparator(wxAuiToolBar *aToolbar, EDA_BASE_FRAME *aWindow)
Add a separator to the given toolbar scaled the same way as KiScaledBitmap.
Definition: bitmap.cpp:167
static constexpr int KICAD_AUI_TB_STYLE
Default style flags used for wxAUI toolbars
Class COLORS_DESIGN_SETTINGS is a list of color settings for designs in Pcbnew.
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
void DeleteAllModules()
Removes all modules from the deque and frees the memory associated with them.
Definition: class_board.h:284
Class CVPCB_FOOTPRINT_VIEWER_CONTROL.
wxString GetUniStringLibId() const
Definition: lib_id.h:148
static TOOL_ACTION toggleCursorStyle
Definition: actions.h:98
TOOL_MANAGER * m_toolManager
Module description (excepted pads)
BOARD * GetBoard() const
void updateZoomSelectBox()
void Print(PCB_BASE_FRAME *aFrame, wxDC *aDC, const wxPoint &aOffset=ZeroOffset) override
Function Print Prints the footprint to the aDC.
virtual void Update3DView(bool aForceReload, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
int Parse(const UTF8 &aId, LIB_ID_TYPE aType, bool aFix=false)
Parse LIB_ID with the information from aId.
Definition: lib_id.cpp:122
void ClearUndoORRedoList(UNDO_REDO_CONTAINER &aList, int aItemCount=-1) override
Function ClearUndoORRedoList free the undo or redo list from List element Wrappers are deleted.
Definition: undo_redo.cpp:582
Message panel definition file.
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:264
bool IsCurrentTool(const TOOL_ACTION &aAction) const
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
void StopDrawing()
Function StopDrawing() Prevents the GAL canvas from further drawing till it is recreated or StartDraw...
static const wxChar ZOOM_KEY[]
static TOOL_ACTION selectionTool
Definition: actions.h:143
The CvPcb application main window.
virtual void OnSelectZoom(wxCommandEvent &event)
Set the zoom factor when selected by the zoom list box in the main tool bar.
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39