KiCad PCB EDA Suite
class_DisplayFootprintsFrame.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) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2015-2016 Wayne Stambaugh <stambaughw@verizon.net>
6  * Copyright (C) 2007-2017 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 
30 #include <fctsys.h>
31 #include <common.h>
32 #include <class_drawpanel.h>
33 #include <class_draw_panel_gal.h>
34 #include <confirm.h>
35 #include <macros.h>
36 #include <bitmaps.h>
37 #include <msgpanel.h>
39 #include <lib_id.h>
40 #include <fp_lib_table.h>
41 
42 #include <io_mgr.h>
43 #include <class_module.h>
44 #include <class_board.h>
45 
46 #include <cvpcb_mainframe.h>
48 #include <cvpcb_id.h>
49 #include <listview_classes.h>
50 
52 
53 // Colors for layers and items
55 
56 
57 BEGIN_EVENT_TABLE( DISPLAY_FOOTPRINTS_FRAME, PCB_BASE_FRAME )
58  EVT_CLOSE( DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow )
59  EVT_SIZE( DISPLAY_FOOTPRINTS_FRAME::OnSize )
60  EVT_TOOL( ID_OPTIONS_SETUP, DISPLAY_FOOTPRINTS_FRAME::InstallOptionsDisplay )
62 
64  DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar)
66  DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar)
67 
68  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH,
69  DISPLAY_FOOTPRINTS_FRAME::OnUpdateTextDrawMode )
70  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH,
71  DISPLAY_FOOTPRINTS_FRAME::OnUpdateLineDrawMode )
72 END_EVENT_TABLE()
73 
74 
76  PCB_BASE_FRAME( aKiway, aParent, FRAME_CVPCB_DISPLAY, _( "Footprint Viewer" ),
77  wxDefaultPosition, wxDefaultSize,
79 {
80  m_showAxis = true; // true to draw axis.
81 
82  // Give an icon
83  wxIcon icon;
84  icon.CopyFromBitmap( KiBitmap( icon_cvpcb_xpm ) );
85  SetIcon( icon );
86 
87  SetBoard( new BOARD() );
88  SetScreen( new PCB_SCREEN( GetPageSizeIU() ) );
89 
90  LoadSettings( config() );
91 
92  // Initialize grid id to a default value if not found in config or incorrect:
93  if( !( GetScreen()->GridExists( m_LastGridSizeId + ID_POPUP_GRID_LEVEL_1000 ) ) )
95 
96  GetScreen()->SetGrid( m_LastGridSizeId + ID_POPUP_GRID_LEVEL_1000 );
97 
98  // Initialize some display options
99  DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
100  displ_opts->m_DisplayPadIsol = false; // Pad clearance has no meaning here
101 
102  // Track and via clearance has no meaning here.
104 
105  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
106  ReCreateHToolbar();
107  ReCreateVToolbar();
108  ReCreateOptToolbar();
109 
110  m_auimgr.SetManagedWindow( this );
111 
112  EDA_PANEINFO horiz;
113  horiz.HorizontalToolbarPane();
114 
115  EDA_PANEINFO vert;
116  vert.VerticalToolbarPane();
117 
118  EDA_PANEINFO mesg;
119  mesg.MessageToolbarPane();
120 
121  m_auimgr.AddPane( m_mainToolBar,
122  wxAuiPaneInfo( horiz ).Name( wxT( "m_mainToolBar" ) ).Top(). Row( 0 ) );
123 
124  if( m_drawToolBar ) // Currently, no vertical right toolbar.
125  m_auimgr.AddPane( m_drawToolBar,
126  wxAuiPaneInfo( vert ).Name( wxT( "m_drawToolBar" ) ).Right() );
127 
128  m_auimgr.AddPane( m_canvas,
129  wxAuiPaneInfo().Name( wxT( "DisplayFrame" ) ).CentrePane() );
130 
131  m_auimgr.AddPane( m_messagePanel,
132  wxAuiPaneInfo( mesg ).Name( wxT( "MsgPanel" ) ).Bottom().Layer(10) );
133 
134  m_auimgr.AddPane( m_optionsToolBar,
135  wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() );
136 
137  m_auimgr.Update();
138 
139  Show( true );
140 }
141 
142 
144 {
145  delete GetScreen();
146  SetScreen( NULL ); // Be sure there is no double deletion
147 }
148 
149 
150 void DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow( wxCloseEvent& event )
151 {
152  EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
153 
154  if( draw3DFrame )
155  draw3DFrame->Close( true );
156 
157  Destroy();
158 }
159 
160 
162 {
163  // Currently, no vertical right toolbar.
164  // So do nothing
165 }
166 
167 
169 {
170  if( m_optionsToolBar )
171  return;
172 
173  // Create options tool bar.
174  m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
175  wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
176 
177  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
178  _( "Hide grid" ), wxITEM_CHECK );
179 
180  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
181  KiBitmap( polar_coord_xpm ),
182  _( "Display polar coordinates" ), wxITEM_CHECK );
183 
184  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
185  KiBitmap( unit_inch_xpm ),
186  _( "Set units to inches" ), wxITEM_CHECK );
187 
188  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
189  KiBitmap( unit_mm_xpm ),
190  _( "Set units to millimeters" ), wxITEM_CHECK );
191 
192 #ifndef __APPLE__
193  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
194  KiBitmap( cursor_shape_xpm ),
195  _( "Change cursor shape" ), wxITEM_CHECK );
196 #endif // !__APPLE__
197 
198  m_optionsToolBar->AddSeparator();
199  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString,
200  KiBitmap( pad_sketch_xpm ),
201  _( "Show pads in outline mode" ), wxITEM_CHECK );
202 
204  KiBitmap( text_sketch_xpm ),
205  _( "Show texts in line mode" ), wxITEM_CHECK );
206 
208  KiBitmap( show_mod_edge_xpm ),
209  _( "Show outlines in line mode" ), wxITEM_CHECK );
210 
211  m_optionsToolBar->Realize();
212 }
213 
214 
216 {
217  if( m_mainToolBar != NULL )
218  return;
219 
220  m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
221  wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
222 
223  m_mainToolBar->AddTool( ID_OPTIONS_SETUP, wxEmptyString, KiBitmap( display_options_xpm ),
224  _( "Display options" ) );
225 
226  m_mainToolBar->AddSeparator();
227 
228  m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ),
229  _( "Zoom in (F1)" ) );
230 
231  m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ),
232  _( "Zoom out (F2)" ) );
233 
234  m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ),
235  _( "Redraw view (F3)" ) );
236 
237  m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ),
238  _( "Zoom auto (Home)" ) );
239 
240  m_mainToolBar->AddSeparator();
241  m_mainToolBar->AddTool( ID_CVPCB_SHOW3D_FRAME, wxEmptyString, KiBitmap( three_d_xpm ),
242  _( "3D Display (Alt+3)" ) );
243 
244  // after adding the buttons to the toolbar, must call Realize() to reflect
245  // the changes
246  m_mainToolBar->Realize();
247 }
248 
249 
250 void DISPLAY_FOOTPRINTS_FRAME::OnUpdateTextDrawMode( wxUpdateUIEvent& aEvent )
251 {
253 
254  wxString msgTextsFill[2] = { _( "Show texts in filled mode" ),
255  _( "Show texts in sketch mode" ) };
256 
257  unsigned i = displ_opts->m_DisplayModTextFill == SKETCH ? 0 : 1;
258 
259  aEvent.Check( displ_opts->m_DisplayModTextFill == SKETCH );
260  m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, msgTextsFill[i] );
261 
262 }
263 
264 
265 void DISPLAY_FOOTPRINTS_FRAME::OnUpdateLineDrawMode( wxUpdateUIEvent& aEvent )
266 {
268 
269  wxString msgEdgesFill[2] = { _( "Show outlines in filled mode" ),
270  _( "Show outlines in sketch mode" ) };
271 
272  int i = displ_opts->m_DisplayModEdgeFill == SKETCH ? 0 : 1;
273 
274  aEvent.Check( displ_opts->m_DisplayModEdgeFill == SKETCH );
275  m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, msgEdgesFill[i] );
276 }
277 
278 
279 void DISPLAY_FOOTPRINTS_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
280 {
281 }
282 
283 
284 void DISPLAY_FOOTPRINTS_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
285 {
286 }
287 
288 
289 bool DISPLAY_FOOTPRINTS_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
290 {
291  return true;
292 }
293 
294 
296 {
297  int id = event.GetId();
299 
300  switch( id )
301  {
303  displ_opts->m_DisplayModTextFill = displ_opts->m_DisplayModTextFill == FILLED ? SKETCH : FILLED;
304  m_canvas->Refresh( );
305  break;
306 
308  displ_opts->m_DisplayModEdgeFill = displ_opts->m_DisplayModEdgeFill == FILLED ? SKETCH : FILLED;
309  m_canvas->Refresh();
310  break;
311 
312  default:
313  DisplayError( this,
314  wxT( "DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar error" ) );
315  break;
316  }
317 }
318 
319 
320 bool DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition,
321  EDA_KEY aHotKey )
322 {
323  bool eventHandled = true;
324 
325  // Filter out the 'fake' mouse motion after a keyboard movement
326  if( !aHotKey && m_movingCursorWithKeyboard )
327  {
329  return false;
330  }
331 
332  wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
333  cmd.SetEventObject( this );
334 
335  wxPoint pos = aPosition;
336  wxPoint oldpos = GetCrossHairPosition();
337  GeneralControlKeyMovement( aHotKey, &pos, true );
338 
339  switch( aHotKey )
340  {
341  case WXK_F1:
342  cmd.SetId( ID_POPUP_ZOOM_IN );
343  GetEventHandler()->ProcessEvent( cmd );
344  break;
345 
346  case WXK_F2:
347  cmd.SetId( ID_POPUP_ZOOM_OUT );
348  GetEventHandler()->ProcessEvent( cmd );
349  break;
350 
351  case WXK_F3:
352  cmd.SetId( ID_ZOOM_REDRAW );
353  GetEventHandler()->ProcessEvent( cmd );
354  break;
355 
356  case WXK_F4:
357  cmd.SetId( ID_POPUP_ZOOM_CENTER );
358  GetEventHandler()->ProcessEvent( cmd );
359  break;
360 
361  case WXK_HOME:
362  cmd.SetId( ID_ZOOM_PAGE );
363  GetEventHandler()->ProcessEvent( cmd );
364  break;
365 
366  case ' ':
368  break;
369 
370  case GR_KB_ALT + '3':
371  cmd.SetId( ID_CVPCB_SHOW3D_FRAME );
372  GetEventHandler()->ProcessEvent( cmd );
373  break;
374 
375  default:
376  eventHandled = false;
377  }
378 
379  SetCrossHairPosition( pos );
380  RefreshCrossHair( oldpos, aPosition, aDC );
381 
382  UpdateStatusBar(); /* Display new cursor coordinates */
383 
384  return eventHandled;
385 }
386 
387 
388 void DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame( wxCommandEvent& event )
389 {
390  EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
391 
392  if( draw3DFrame )
393  {
394  // Raising the window does not show the window on Windows if iconized.
395  // This should work on any platform.
396  if( draw3DFrame->IsIconized() )
397  draw3DFrame->Iconize( false );
398 
399  draw3DFrame->Raise();
400 
401  // Raising the window does not set the focus on Linux. This should work on any platform.
402  if( wxWindow::FindFocus() != draw3DFrame )
403  draw3DFrame->SetFocus();
404 
405  return;
406  }
407 
408  draw3DFrame = new EDA_3D_VIEWER( &Kiway(), this, _( "3D Viewer" ) );
409  draw3DFrame->Raise(); // Needed with some Window Managers
410  draw3DFrame->Show( true );
411 }
412 
413 
421 {
422 }
423 
424 
426 {
427  return m_drawGrid;
428 }
429 
430 
432 {
433  m_drawGrid = aVisible;
434 }
435 
436 
438 {
439  return COLOR4D( DARKGRAY );
440 }
441 
442 
443 MODULE* DISPLAY_FOOTPRINTS_FRAME::Get_Module( const wxString& aFootprintName )
444 {
445  MODULE* footprint = NULL;
446 
447  try
448  {
449  LIB_ID fpid;
450 
451  if( fpid.Parse( aFootprintName ) >= 0 )
452  {
453  DisplayInfoMessage( this, wxString::Format( wxT( "Footprint ID <%s> is not valid." ),
454  GetChars( aFootprintName ) ) );
455  return NULL;
456  }
457 
458  std::string nickname = fpid.GetLibNickname();
459  std::string fpname = fpid.GetLibItemName();
460 
461  wxLogDebug( wxT( "Load footprint <%s> from library <%s>." ),
462  fpname.c_str(), nickname.c_str() );
463 
464  footprint = Prj().PcbFootprintLibs( Kiway() )->FootprintLoad(
465  FROM_UTF8( nickname.c_str() ), FROM_UTF8( fpname.c_str() ) );
466  }
467  catch( const IO_ERROR& ioe )
468  {
469  DisplayError( this, ioe.What() );
470  return NULL;
471  }
472 
473  if( footprint )
474  {
475  footprint->SetParent( (EDA_ITEM*) GetBoard() );
476  footprint->SetPosition( wxPoint( 0, 0 ) );
477  return footprint;
478  }
479 
480  wxString msg = wxString::Format( _( "Footprint '%s' not found" ), aFootprintName.GetData() );
481  DisplayError( this, msg );
482  return NULL;
483 }
484 
485 
487 {
488  wxString msg;
489 
490  CVPCB_MAINFRAME* parentframe = (CVPCB_MAINFRAME *) GetParent();
491 
492  wxString footprintName = parentframe->GetSelectedFootprint();
493 
494  if( !footprintName.IsEmpty() )
495  {
496  msg.Printf( _( "Footprint: %s" ), GetChars( footprintName ) );
497 
498  SetTitle( msg );
499  const FOOTPRINT_INFO* module_info =
500  parentframe->m_FootprintsList->GetModuleInfo( footprintName );
501 
502  const wxChar* libname;
503 
504  if( module_info )
505  libname = GetChars( module_info->GetNickname() );
506  else
507  libname = GetChars( wxT( "???" ) );
508 
509  msg.Printf( _( "Lib: %s" ), libname );
510 
511  SetStatusText( msg, 0 );
512 
513  if( GetBoard()->m_Modules.GetCount() )
514  {
515  // there is only one module in the list
517  }
518 
519  MODULE* module = Get_Module( footprintName );
520 
521  if( module )
522  GetBoard()->m_Modules.PushBack( module );
523 
524  Zoom_Automatique( false );
525  }
526  else // No footprint to display. Erase old footprint, if any
527  {
528  if( GetBoard()->m_Modules.GetCount() )
529  {
531  Zoom_Automatique( false );
532  SetStatusText( wxEmptyString, 0 );
533  }
534  }
535 
536  // Display new cursor coordinates and zoom value:
537  UpdateStatusBar();
538 
539  GetCanvas()->Refresh();
540 
541  EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
542 
543  if( draw3DFrame )
544  draw3DFrame->NewDisplay( true );
545 }
546 
547 
548 void DISPLAY_FOOTPRINTS_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
549 {
550  if( !GetBoard() )
551  return;
552 
553  m_canvas->DrawBackGround( DC );
554  GetBoard()->Draw( m_canvas, DC, GR_COPY );
555 
556  MODULE* Module = GetBoard()->m_Modules;
557 
558  if ( Module )
559  {
560  MSG_PANEL_ITEMS items;
561  Module->GetMsgPanelInfo( items );
562  SetMsgPanel( items );
563  }
564 
565  m_canvas->DrawCrossHair( DC );
566 }
567 
568 
569 /*
570  * Redraw the BOARD items but not cursors, axis or grid.
571  */
572 void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
573  GR_DRAWMODE aDrawMode, const wxPoint& aOffset )
574 {
575  if( m_Modules )
576  {
577  m_Modules->Draw( aPanel, aDC, GR_COPY );
578  }
579 }
EDA_PANEINFO & HorizontalToolbarPane()
Function HorizontalToolbarPane Change *this to a horizontal toolbar for KiCad.
Definition: wxstruct.h:479
#define KICAD_DEFAULT_DRAWFRAME_STYLE
Definition: wxstruct.h:55
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
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:53
void OnUpdateTextDrawMode(wxUpdateUIEvent &aEvent)
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Update the board display after modifying it bu a python script (note: it is automatically called by a...
Definition: draw_panel.cpp:325
virtual COLOR4D GetGridColor() override
Function GetGridColor() , virtual.
This file is part of the common library.
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:324
#define FOOTPRINTVIEWER_FRAME_NAME
void SetScreen(BASE_SCREEN *aScreen)
Definition: draw_frame.h:141
void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset=ZeroOffset) override
Function Draw draws the footprint to the aDC.
Class BOARD to handle a board.
MODULE * FootprintLoad(const wxString &aNickname, const wxString &aFootprintName)
Function FootprintLoad.
void DrawCrossHair(wxDC *aDC, COLOR4D aColor=COLOR4D::WHITE)
Function DrawCrossHair draws the user cross hair.
Definition: draw_panel.cpp:215
bool OnRightClick(const wxPoint &MousePos, wxMenu *PopMenu) override
Definition: id.h:232
BOARD * GetBoard() const
bool m_DisplayModEdgeFill
Definition: pcbstruct.h:69
DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar EVT_UPDATE_UI(ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, DISPLAY_FOOTPRINTS_FRAME::OnUpdateTextDrawMode) EVT_UPDATE_UI(ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH
int Parse(const UTF8 &aId)
Function Parse.
Definition: lib_id.cpp:122
MODULE * Get_Module(const wxString &CmpName)
void DeleteAll()
Function DeleteAll deletes all items on the list and leaves the list empty.
Definition: dlist.cpp:41
Class LIB_ID.
Definition: lib_id.h:56
wxPoint m_O_Curseur
Relative Screen cursor coordinate (on grid) in user units.
#define GR_KB_ALT
Definition: common.h:65
Specialization of the wxAuiPaneInfo class for KiCad panels.
Definition: wxstruct.h:470
Class DISPLAY_FOOTPRINTS_FRAME is used to display footprints.
void OnCloseWindow(wxCloseEvent &Event) override
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
void OnLeftClick(wxDC *DC, const wxPoint &MousePos) override
EDA_DRAW_FRAME::OnSelectGrid ID_TB_OPTIONS_SELECT_UNIT_INCH
Definition: draw_frame.cpp:122
EVT_TOOL(ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar) EVT_TOOL(ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH
This file contains miscellaneous commonly used macros and functions.
void PushBack(T *aNewElement)
Function PushBack puts aNewElement at the end of the list sequence.
Definition: dlist.h:250
void GetMsgPanelInfo(std::vector< MSG_PANEL_ITEM > &aList) override
>
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
void Zoom_Automatique(bool aWarpPointer)
Function Zoom_Automatique redraws the screen with best zoom level and the best centering that shows a...
Definition: zoom.cpp:77
EDA_PANEINFO & VerticalToolbarPane()
Function VerticalToolbarPane Change *this to a vertical toolbar for KiCad.
Definition: wxstruct.h:497
Class UNDO_REDO_CONTAINER is a holder to handle alist of undo (or redo) command.
wxAuiToolBar * m_optionsToolBar
The options tool bar typcially located on the left edge of the main window.
Definition: draw_frame.h:126
void RefreshCrossHair(const wxPoint &aOldPos, const wxPoint &aEvtPos, wxDC *aDC)
Move and refresh the crosshair after movement and call the mouse capture function.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Function SetMsgPanel clears the message panel and populates it with the contents of aList...
Definition: draw_frame.cpp:774
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:227
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:41
const UTF8 & GetLibItemName() const
Function GetLibItemName.
Definition: lib_id.h:129
virtual bool IsGridVisible() const override
Function IsGridVisible() , virtual.
The common library.
Class KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within...
Definition: kiway.h:257
void RedrawActiveWindow(wxDC *DC, bool EraseBg) override
uint32_t EDA_KEY
Definition: common.h:52
COLORS_DESIGN_SETTINGS g_ColorsSettings(FRAME_CVPCB_DISPLAY)
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString aExtraInfo)
Function DisplayInfoMessage displays an informational message box with aMessage.
Definition: confirm.cpp:102
const wxString GetSelectedFootprint()
void SetPosition(const wxPoint &aPos) override
void OnLeftDClick(wxDC *DC, const wxPoint &MousePos) override
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
Definition: wxstruct.h:140
Class DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
Definition: pcbstruct.h:62
VTBL_ENTRY FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
TRACE_CLEARANCE_DISPLAY_MODE_T m_ShowTrackClearanceMode
How trace clearances are displayed.
Definition: pcbstruct.h:74
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:93
void InitDisplay()
Function InitDisplay Refresh the full display for this frame: Set the title, the status line and redr...
virtual void UpdateStatusBar() override
Function UpdateStatusBar updates the status bar information.
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
EDA_PANEINFO & MessageToolbarPane()
Function MessageToolbarPane Change *this to a message pane for KiCad.
Definition: wxstruct.h:516
bool m_DisplayPadIsol
Definition: pcbstruct.h:68
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:92
Declaration of the eda_3d_viewer class.
void GeneralControlKeyMovement(int aHotKey, wxPoint *aPos, bool aSnapToGrid)
Function GeneralControlKeyMovement Handle the common part of GeneralControl dedicated to global curso...
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
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
DLIST< MODULE > m_Modules
Definition: class_board.h:245
void OnUpdateLineDrawMode(wxUpdateUIEvent &aEvent)
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:165
The common library.
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:102
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.
virtual void SetGridVisibility(bool aVisible) override
Function SetGridVisibility() , virtual It may be overloaded by derived classes if you want to store/r...
void DrawBackGround(wxDC *DC)
Function DrawBackGround.
Definition: draw_panel.cpp:665
const wxString & GetNickname() const
void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset=ZeroOffset) override
Function Draw.
Definition: tracepcb.cpp:135
Class EDA_3D_VIEWER Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard...
Definition: eda_3d_viewer.h:50
Module description (excepted pads)
const UTF8 & GetLibNickname() const
Function GetLibNickname.
Definition: lib_id.h:108
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Function SetCrossHairPosition sets the screen cross hair position to aPosition in logical (drawing) u...
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:634
Message panel definition file.
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
void Show3D_Frame(wxCommandEvent &event) override
Display 3D frame of current footprint selection.
EDA_3D_VIEWER * Get3DViewerFrame()
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:71
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:47
bool m_movingCursorWithKeyboard
One-shot to avoid a recursive mouse event during hotkey movement.
Definition: draw_frame.h:139
bool m_DisplayModTextFill
Definition: pcbstruct.h:70
void OnSelectOptionToolbar(wxCommandEvent &event)
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
The CvPcb application main window.
std::unique_ptr< FOOTPRINT_LIST > m_FootprintsList
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
bool GeneralControl(wxDC *DC, const wxPoint &aPosition, EDA_KEY aHotKey=0) override
Function GeneralControl performs application specific control using aDC at aPosition in logical units...