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 
54 BEGIN_EVENT_TABLE( DISPLAY_FOOTPRINTS_FRAME, PCB_BASE_FRAME )
55  EVT_CLOSE( DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow )
56  EVT_SIZE( DISPLAY_FOOTPRINTS_FRAME::OnSize )
57  EVT_TOOL( ID_OPTIONS_SETUP, DISPLAY_FOOTPRINTS_FRAME::InstallOptionsDisplay )
59 
61  DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar)
63  DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar)
64 
65  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH,
66  DISPLAY_FOOTPRINTS_FRAME::OnUpdateTextDrawMode )
67  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH,
68  DISPLAY_FOOTPRINTS_FRAME::OnUpdateLineDrawMode )
69 END_EVENT_TABLE()
70 
71 
73  PCB_BASE_FRAME( aKiway, aParent, FRAME_CVPCB_DISPLAY, _( "Footprint Viewer" ),
74  wxDefaultPosition, wxDefaultSize,
76 {
77  m_showAxis = true; // true to draw axis.
78 
79  // Give an icon
80  wxIcon icon;
81 
82  icon.CopyFromBitmap( KiBitmap( icon_cvpcb_xpm ) );
83  SetIcon( icon );
84 
85  SetBoard( new BOARD() );
86  SetScreen( new PCB_SCREEN( GetPageSizeIU() ) );
87 
88  LoadSettings( config() );
89 
90  // Initialize grid id to a default value if not found in config or incorrect:
91  if( !( GetScreen()->GridExists( m_LastGridSizeId + ID_POPUP_GRID_LEVEL_1000 ) ) )
93 
94  GetScreen()->SetGrid( m_LastGridSizeId + ID_POPUP_GRID_LEVEL_1000 );
95 
96  // Initialize some display options
97  DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
98  displ_opts->m_DisplayPadIsol = false; // Pad clearance has no meaning here
99 
100  // Track and via clearance has no meaning here.
102 
103  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
104  ReCreateHToolbar();
105  ReCreateVToolbar();
106  ReCreateOptToolbar();
107 
108  m_auimgr.SetManagedWindow( this );
109 
110  EDA_PANEINFO horiz;
111  horiz.HorizontalToolbarPane();
112 
113  EDA_PANEINFO vert;
114  vert.VerticalToolbarPane();
115 
116  EDA_PANEINFO mesg;
117  mesg.MessageToolbarPane();
118 
119  m_auimgr.AddPane( m_mainToolBar,
120  wxAuiPaneInfo( horiz ).Name( wxT( "m_mainToolBar" ) ).Top(). Row( 0 ) );
121 
122  if( m_drawToolBar ) // Currently, no vertical right toolbar.
123  m_auimgr.AddPane( m_drawToolBar,
124  wxAuiPaneInfo( vert ).Name( wxT( "m_drawToolBar" ) ).Right() );
125 
126  m_auimgr.AddPane( m_canvas,
127  wxAuiPaneInfo().Name( wxT( "DisplayFrame" ) ).CentrePane() );
128 
129  m_auimgr.AddPane( m_messagePanel,
130  wxAuiPaneInfo( mesg ).Name( wxT( "MsgPanel" ) ).Bottom().Layer(10) );
131 
132  m_auimgr.AddPane( m_optionsToolBar,
133  wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() );
134 
135  m_auimgr.Update();
136 
137  Show( true );
138 }
139 
140 
142 {
143  delete GetScreen();
144  SetScreen( NULL ); // Be sure there is no double deletion
145 }
146 
147 
148 void DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow( wxCloseEvent& event )
149 {
150  EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
151 
152  if( draw3DFrame )
153  draw3DFrame->Close( true );
154 
155  Destroy();
156 }
157 
158 
160 {
161  // Currently, no vertical right toolbar.
162  // So do nothing
163 }
164 
165 
167 {
168  if( m_optionsToolBar )
169  return;
170 
171  // Create options tool bar.
172  m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
173  wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
174 
175  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
176  _( "Hide grid" ), wxITEM_CHECK );
177 
178  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
179  KiBitmap( polar_coord_xpm ),
180  _( "Display polar coordinates" ), wxITEM_CHECK );
181 
182  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
183  KiBitmap( unit_inch_xpm ),
184  _( "Set units to inches" ), wxITEM_CHECK );
185 
186  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
187  KiBitmap( unit_mm_xpm ),
188  _( "Set units to millimeters" ), wxITEM_CHECK );
189 
190 #ifndef __APPLE__
191  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
192  KiBitmap( cursor_shape_xpm ),
193  _( "Change cursor shape" ), wxITEM_CHECK );
194 #endif // !__APPLE__
195 
196  m_optionsToolBar->AddSeparator();
197  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString,
198  KiBitmap( pad_sketch_xpm ),
199  _( "Show pads in outline mode" ), wxITEM_CHECK );
200 
202  KiBitmap( text_sketch_xpm ),
203  _( "Show texts in line mode" ), wxITEM_CHECK );
204 
206  KiBitmap( show_mod_edge_xpm ),
207  _( "Show outlines in line mode" ), wxITEM_CHECK );
208 
209  m_optionsToolBar->Realize();
210 }
211 
212 
214 {
215  if( m_mainToolBar != NULL )
216  return;
217 
218  m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
219  wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
220 
221  m_mainToolBar->AddTool( ID_OPTIONS_SETUP, wxEmptyString, KiBitmap( display_options_xpm ),
222  _( "Display options" ) );
223 
224  m_mainToolBar->AddSeparator();
225 
226  m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ),
227  _( "Zoom in (F1)" ) );
228 
229  m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ),
230  _( "Zoom out (F2)" ) );
231 
232  m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ),
233  _( "Redraw view (F3)" ) );
234 
235  m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ),
236  _( "Zoom auto (Home)" ) );
237 
238  m_mainToolBar->AddSeparator();
239  m_mainToolBar->AddTool( ID_CVPCB_SHOW3D_FRAME, wxEmptyString, KiBitmap( three_d_xpm ),
240  _( "3D Display (Alt+3)" ) );
241 
242  // after adding the buttons to the toolbar, must call Realize() to reflect
243  // the changes
244  m_mainToolBar->Realize();
245 }
246 
247 
248 void DISPLAY_FOOTPRINTS_FRAME::OnUpdateTextDrawMode( wxUpdateUIEvent& aEvent )
249 {
251 
252  wxString msgTextsFill[2] = { _( "Show texts in filled mode" ),
253  _( "Show texts in sketch mode" ) };
254 
255  unsigned i = displ_opts->m_DisplayModTextFill == SKETCH ? 0 : 1;
256 
257  aEvent.Check( displ_opts->m_DisplayModTextFill == SKETCH );
258  m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, msgTextsFill[i] );
259 
260 }
261 
262 
263 void DISPLAY_FOOTPRINTS_FRAME::OnUpdateLineDrawMode( wxUpdateUIEvent& aEvent )
264 {
266 
267  wxString msgEdgesFill[2] = { _( "Show outlines in filled mode" ),
268  _( "Show outlines in sketch mode" ) };
269 
270  int i = displ_opts->m_DisplayModEdgeFill == SKETCH ? 0 : 1;
271 
272  aEvent.Check( displ_opts->m_DisplayModEdgeFill == SKETCH );
273  m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, msgEdgesFill[i] );
274 }
275 
276 
277 void DISPLAY_FOOTPRINTS_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
278 {
279 }
280 
281 
282 void DISPLAY_FOOTPRINTS_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
283 {
284 }
285 
286 
287 bool DISPLAY_FOOTPRINTS_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
288 {
289  return true;
290 }
291 
292 
294 {
295  int id = event.GetId();
297 
298  switch( id )
299  {
301  displ_opts->m_DisplayModTextFill = displ_opts->m_DisplayModTextFill == FILLED ? SKETCH : FILLED;
302  m_canvas->Refresh( );
303  break;
304 
306  displ_opts->m_DisplayModEdgeFill = displ_opts->m_DisplayModEdgeFill == FILLED ? SKETCH : FILLED;
307  m_canvas->Refresh();
308  break;
309 
310  default:
311  DisplayError( this,
312  wxT( "DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar error" ) );
313  break;
314  }
315 }
316 
317 
318 bool DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition,
319  EDA_KEY aHotKey )
320 {
321  bool eventHandled = true;
322 
323  // Filter out the 'fake' mouse motion after a keyboard movement
324  if( !aHotKey && m_movingCursorWithKeyboard )
325  {
327  return false;
328  }
329 
330  wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
331  cmd.SetEventObject( this );
332 
333  wxPoint pos = aPosition;
334  wxPoint oldpos = GetCrossHairPosition();
335  GeneralControlKeyMovement( aHotKey, &pos, true );
336 
337  switch( aHotKey )
338  {
339  case WXK_F1:
340  cmd.SetId( ID_POPUP_ZOOM_IN );
341  GetEventHandler()->ProcessEvent( cmd );
342  break;
343 
344  case WXK_F2:
345  cmd.SetId( ID_POPUP_ZOOM_OUT );
346  GetEventHandler()->ProcessEvent( cmd );
347  break;
348 
349  case WXK_F3:
350  cmd.SetId( ID_ZOOM_REDRAW );
351  GetEventHandler()->ProcessEvent( cmd );
352  break;
353 
354  case WXK_F4:
355  cmd.SetId( ID_POPUP_ZOOM_CENTER );
356  GetEventHandler()->ProcessEvent( cmd );
357  break;
358 
359  case WXK_HOME:
360  cmd.SetId( ID_ZOOM_PAGE );
361  GetEventHandler()->ProcessEvent( cmd );
362  break;
363 
364  case ' ':
366  break;
367 
368  case GR_KB_ALT + '3':
369  cmd.SetId( ID_CVPCB_SHOW3D_FRAME );
370  GetEventHandler()->ProcessEvent( cmd );
371  break;
372 
373  default:
374  eventHandled = false;
375  }
376 
377  SetCrossHairPosition( pos );
378  RefreshCrossHair( oldpos, aPosition, aDC );
379 
380  UpdateStatusBar(); /* Display new cursor coordinates */
381 
382  return eventHandled;
383 }
384 
385 
386 void DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame( wxCommandEvent& event )
387 {
388  EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
389 
390  if( draw3DFrame )
391  {
392  // Raising the window does not show the window on Windows if iconized.
393  // This should work on any platform.
394  if( draw3DFrame->IsIconized() )
395  draw3DFrame->Iconize( false );
396 
397  draw3DFrame->Raise();
398 
399  // Raising the window does not set the focus on Linux. This should work on any platform.
400  if( wxWindow::FindFocus() != draw3DFrame )
401  draw3DFrame->SetFocus();
402 
403  return;
404  }
405 
406  draw3DFrame = new EDA_3D_VIEWER( &Kiway(), this, _( "3D Viewer" ) );
407  draw3DFrame->Raise(); // Needed with some Window Managers
408  draw3DFrame->Show( true );
409 }
410 
411 
419 {
420 }
421 
422 
424 {
425  return m_drawGrid;
426 }
427 
428 
430 {
431  m_drawGrid = aVisible;
432 }
433 
434 
436 {
437  return COLOR4D( DARKGRAY );
438 }
439 
440 
441 MODULE* DISPLAY_FOOTPRINTS_FRAME::Get_Module( const wxString& aFootprintName )
442 {
443  MODULE* footprint = NULL;
444 
445  try
446  {
447  LIB_ID fpid;
448 
449  if( fpid.Parse( TO_UTF8( aFootprintName ) ) >= 0 )
450  {
451  DisplayInfoMessage( this, wxString::Format( wxT( "Footprint ID <%s> is not valid." ),
452  GetChars( aFootprintName ) ) );
453  return NULL;
454  }
455 
456  std::string nickname = fpid.GetLibNickname();
457  std::string fpname = fpid.GetLibItemName();
458 
459  wxLogDebug( wxT( "Load footprint <%s> from library <%s>." ),
460  fpname.c_str(), nickname.c_str() );
461 
462  footprint = Prj().PcbFootprintLibs( Kiway() )->FootprintLoad(
463  FROM_UTF8( nickname.c_str() ), FROM_UTF8( fpname.c_str() ) );
464  }
465  catch( const IO_ERROR& ioe )
466  {
467  DisplayError( this, ioe.What() );
468  return NULL;
469  }
470 
471  if( footprint )
472  {
473  footprint->SetParent( (EDA_ITEM*) GetBoard() );
474  footprint->SetPosition( wxPoint( 0, 0 ) );
475  return footprint;
476  }
477 
478  wxString msg = wxString::Format( _( "Footprint '%s' not found" ), aFootprintName.GetData() );
479  DisplayError( this, msg );
480  return NULL;
481 }
482 
483 
485 {
486  wxString msg;
487 
488  CVPCB_MAINFRAME* parentframe = (CVPCB_MAINFRAME *) GetParent();
489 
490  wxString footprintName = parentframe->GetSelectedFootprint();
491 
492  if( !footprintName.IsEmpty() )
493  {
494  msg.Printf( _( "Footprint: %s" ), GetChars( footprintName ) );
495 
496  SetTitle( msg );
497  const FOOTPRINT_INFO* module_info =
498  parentframe->m_FootprintsList->GetModuleInfo( footprintName );
499 
500  const wxChar* libname;
501 
502  if( module_info )
503  libname = GetChars( module_info->GetNickname() );
504  else
505  libname = GetChars( wxT( "???" ) );
506 
507  msg.Printf( _( "Lib: %s" ), libname );
508 
509  SetStatusText( msg, 0 );
510 
511  if( GetBoard()->m_Modules.GetCount() )
512  {
513  // there is only one module in the list
515  }
516 
517  MODULE* module = Get_Module( footprintName );
518 
519  if( module )
520  GetBoard()->m_Modules.PushBack( module );
521 
522  Zoom_Automatique( false );
523  }
524  else // No footprint to display. Erase old footprint, if any
525  {
526  if( GetBoard()->m_Modules.GetCount() )
527  {
529  Zoom_Automatique( false );
530  SetStatusText( wxEmptyString, 0 );
531  }
532  }
533 
534  // Display new cursor coordinates and zoom value:
535  UpdateStatusBar();
536 
537  GetCanvas()->Refresh();
538 
539  EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
540 
541  if( draw3DFrame )
542  draw3DFrame->NewDisplay( true );
543 }
544 
545 
546 void DISPLAY_FOOTPRINTS_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
547 {
548  if( !GetBoard() )
549  return;
550 
551  m_canvas->DrawBackGround( DC );
552  GetBoard()->Draw( m_canvas, DC, GR_COPY );
553 
554  MODULE* Module = GetBoard()->m_Modules;
555 
556  if ( Module )
557  {
558  MSG_PANEL_ITEMS items;
559  Module->GetMsgPanelInfo( items );
560  SetMsgPanel( items );
561  }
562 
563  m_canvas->DrawCrossHair( DC );
564 }
565 
566 
567 /*
568  * Redraw the BOARD items but not cursors, axis or grid.
569  */
570 void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
571  GR_DRAWMODE aDrawMode, const wxPoint& aOffset )
572 {
573  if( m_Modules )
574  {
575  m_Modules->Draw( aPanel, aDC, GR_COPY );
576  }
577 }
EDA_PANEINFO & HorizontalToolbarPane()
Function HorizontalToolbarPane Change *this to a horizontal toolbar for KiCad.
Definition: wxstruct.h:475
#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
Definition: draw_panel.cpp:326
This file is part of the common library.
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:299
#define FOOTPRINTVIEWER_FRAME_NAME
void SetScreen(BASE_SCREEN *aScreen)
Definition: draw_frame.h:140
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:216
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:466
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:121
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
virtual COLOR4D GetGridColor() const override
Function GetGridColor() , virtual.
void GetMsgPanelInfo(std::vector< MSG_PANEL_ITEM > &aList) override
>
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
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:493
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:125
void RefreshCrossHair(const wxPoint &aOldPos, const wxPoint &aEvtPos, wxDC *aDC)
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:773
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:213
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
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:136
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:92
void DisplayInfoMessage(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayInfoMessage displays an informational message box with aMessage.
Definition: confirm.cpp:89
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:512
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:151
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
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:666
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:69
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:138
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...