KiCad PCB EDA Suite
pl_editor_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) 2013 CERN
5  * Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
6  * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
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 <kiface_base.h>
27 #include <pgm_base.h>
28 #include <bitmaps.h>
29 #include <core/arraydim.h>
30 #include <eda_item.h>
33 #include <widgets/paged_dialog.h>
35 #include <panel_hotkeys_editor.h>
36 #include <confirm.h>
37 #include <kiplatform/app.h>
38 #include <painter.h>
39 #include <tool/selection.h>
40 #include <tool/action_toolbar.h>
41 #include <tool/editor_conditions.h>
42 #include <tool/tool_dispatcher.h>
43 #include <tool/tool_manager.h>
44 #include <tool/common_control.h>
45 #include <tool/common_tools.h>
46 #include <tool/picker_tool.h>
47 #include <tool/zoom_tool.h>
48 #include <widgets/infobar.h>
50 
52 #include "pl_editor_frame.h"
53 #include "pl_editor_id.h"
54 #include "pl_editor_settings.h"
55 #include "properties_frame.h"
56 #include "tools/pl_actions.h"
58 #include "tools/pl_drawing_tools.h"
59 #include "tools/pl_edit_tool.h"
60 #include "tools/pl_point_editor.h"
63 #include <zoom_defines.h>
64 
65 #include <wx/filedlg.h>
66 #include <wx/print.h>
67 #include <wx/treebook.h>
68 
69 
70 BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME )
71  EVT_MENU( wxID_CLOSE, PL_EDITOR_FRAME::OnExit )
72  EVT_MENU( wxID_EXIT, PL_EDITOR_FRAME::OnExit )
73 
74  EVT_MENU( wxID_FILE, PL_EDITOR_FRAME::Files_io )
75 
78 
81 END_EVENT_TABLE()
82 
83 
84 PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
85  EDA_DRAW_FRAME( aKiway, aParent, FRAME_PL_EDITOR, wxT( "PlEditorFrame" ),
86  wxDefaultPosition, wxDefaultSize,
88  m_propertiesPagelayout( nullptr ),
89  m_propertiesFrameWidth( 200 ),
90  m_originSelectBox( nullptr ),
91  m_originSelectChoice( 0 ),
92  m_pageSelectBox( nullptr )
93 {
94  m_maximizeByDefault = true;
95  m_userUnits = EDA_UNITS::MILLIMETRES;
96 
97  m_showBorderAndTitleBlock = true; // true for reference drawings.
99  SetShowPageLimits( true );
100  m_aboutTitle = _( "KiCad Drawing Sheet Editor" );
101 
102  // Give an icon
103  wxIcon icon;
104  wxIconBundle icon_bundle;
105 
106  icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pagelayout_editor ) );
107  icon_bundle.AddIcon( icon );
108  icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pagelayout_editor_32 ) );
109  icon_bundle.AddIcon( icon );
110  icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pagelayout_editor_16 ) );
111  icon_bundle.AddIcon( icon );
112 
113  SetIcons( icon_bundle );
114 
115  // Create GAL canvas
116  auto* drawPanel = new PL_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_frameSize,
117  GetGalDisplayOptions(),
119  SetCanvas( drawPanel );
120 
121  LoadSettings( config() );
122 
123  wxSize pageSizeIU = GetPageLayout().GetPageSettings().GetSizeIU();
124  SetScreen( new BASE_SCREEN( pageSizeIU ) );
125 
126  setupTools();
127  setupUIConditions();
128  ReCreateMenuBar();
129  ReCreateHToolbar();
130  ReCreateVToolbar();
131  ReCreateOptToolbar();
132 
133  wxWindow* stsbar = GetStatusBar();
134  int spacer = KIUI::GetTextSize( wxT( "M" ), stsbar ).x * 2;
135 
136  int dims[] = {
137 
138  // balance of status bar on far left is set to a default or whatever is left over.
139  -1,
140 
141  // When using GetTextSize() remember the width of '1' is not the same
142  // as the width of '0' unless the font is fixed width, and it usually won't be.
143 
144  // zoom:
145  KIUI::GetTextSize( wxT( "Z 762000" ), stsbar ).x + spacer,
146 
147  // cursor coords
148  KIUI::GetTextSize( wxT( "X 0234.567 Y 0234.567" ), stsbar ).x + spacer,
149 
150  // delta distances
151  KIUI::GetTextSize( wxT( "dx 0234.567 dx 0234.567" ), stsbar ).x + spacer,
152 
153  // grid size
154  KIUI::GetTextSize( wxT( "grid 0234.567" ), stsbar ).x + spacer,
155 
156  // Coord origin (use the bigger message)
157  KIUI::GetTextSize( _( "coord origin: Right Bottom page corner" ), stsbar ).x + spacer,
158 
159  // units display, Inches is bigger than mm
160  KIUI::GetTextSize( _( "Inches" ), stsbar ).x + spacer,
161 
162  // constraint mode
163  KIUI::GetTextSize( _( "Constrain to H, V, 45" ), stsbar ).x + spacer
164  };
165 
166  SetStatusWidths( arrayDim( dims ), dims );
167 
168  m_auimgr.SetManagedWindow( this );
169 
170  CreateInfoBar();
171  m_propertiesPagelayout = new PROPERTIES_FRAME( this );
172 
173  // Rows; layers 4 - 6
174  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" )
175  .Top().Layer( 6 ) );
176  m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
177  .Left().Layer( 3 ) );
178  m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" )
179  .Bottom().Layer( 6 ) );
180 
181  // Columns; layers 1 - 3
182  m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" )
183  .Right().Layer( 2 ) );
184 
185  m_auimgr.AddPane( m_propertiesPagelayout, EDA_PANE().Palette().Name( "Props" )
186  .Right().Layer( 3 )
187  .Caption( _( "Properties" ) )
188  .MinSize( m_propertiesPagelayout->GetMinSize() )
189  .BestSize( m_propertiesFrameWidth, -1 ) );
190 
191  // Center
192  m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" )
193  .Center() );
194 
195  FinishAUIInitialization();
196 
197  resolveCanvasType();
198  SwitchCanvas( m_canvasType );
199 
200  // Add the exit key handler
201  setupUnits( config() );
202 
203  wxPoint originCoord = ReturnCoordOriginCorner();
204  SetGridOrigin( originCoord );
205 
206  // Initialize the current drawing sheet
207 #if 0 //start with empty layout
210 #else // start with the default KiCad layout
212 #endif
213  OnNewDrawingSheet();
214 
215  // Ensure the window is on top
216  Raise();
217 
218  // Register a call to update the toolbar sizes. It can't be done immediately because
219  // it seems to require some sizes calculated that aren't yet (at least on GTK).
220  CallAfter( [&]()
221  {
222  // Ensure the controls on the toolbars all are correctly sized
223  UpdateToolbarControlSizes();
224  } );
225 }
226 
227 
229 {
230  // Ensure m_canvasType is up to date, to save it in config
232 
233  // Shutdown all running tools
234  if( m_toolManager )
236 }
237 
238 
240 {
241  // Create the manager and dispatcher & route draw panel events to the dispatcher
243  m_toolManager->SetEnvironment( nullptr, GetCanvas()->GetView(),
244  GetCanvas()->GetViewControls(), config(), this );
245  m_actions = new PL_ACTIONS();
247 
249 
250  // Register tools
261 
262  // Run the selection tool, it is supposed to be always active
263  m_toolManager->InvokeTool( "plEditor.InteractiveSelection" );
264 }
265 
266 
268 {
270 
272  EDITOR_CONDITIONS cond( this );
273 
274  wxASSERT( mgr );
275 
276 #define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
277 #define CHECK( x ) ACTION_CONDITIONS().Check( x )
278 
280  mgr->SetConditions( ACTIONS::undo, ENABLE( cond.UndoAvailable() ) );
281  mgr->SetConditions( ACTIONS::redo, ENABLE( cond.RedoAvailable() ) );
282 
288 
293 
295  CHECK( cond.CurrentTool( ACTIONS::zoomTool ) ) );
300 
309 
310  // Not a tool, just a way to activate the action
313 
314  auto titleBlockNormalMode =
315  [] ( const SELECTION& )
316  {
317  return DS_DATA_MODEL::GetTheInstance().m_EditMode == false;
318  };
319 
320  auto titleBlockEditMode =
321  [] ( const SELECTION& )
322  {
323  return DS_DATA_MODEL::GetTheInstance().m_EditMode == true;
324  };
325 
326  mgr->SetConditions( PL_ACTIONS::layoutNormalMode, CHECK( titleBlockNormalMode ) );
327  mgr->SetConditions( PL_ACTIONS::layoutEditMode, CHECK( titleBlockEditMode ) );
328 
329 #undef CHECK
330 #undef ENABLE
331 }
332 
333 
334 bool PL_EDITOR_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl )
335 {
336  wxString fn = aFileSet[0];
337 
338  if( !LoadDrawingSheetFile( fn ) )
339  {
340  wxMessageBox( wxString::Format( _( "Error loading drawing sheet '%s'." ), fn ) );
341  return false;
342  }
343  else
344  {
346  return true;
347  }
348 }
349 
350 
352 {
353  return GetScreen() && GetScreen()->IsContentModified();
354 }
355 
356 
357 void PL_EDITOR_FRAME::OnExit( wxCommandEvent& aEvent )
358 {
359  if( aEvent.GetId() == wxID_EXIT )
360  Kiway().OnKiCadExit();
361 
362  if( aEvent.GetId() == wxID_CLOSE || Kiface().IsSingle() )
363  Close( false );
364 }
365 
366 
367 bool PL_EDITOR_FRAME::canCloseWindow( wxCloseEvent& aEvent )
368 {
369  // Shutdown blocks must be determined and vetoed as early as possible
371  && aEvent.GetId() == wxEVT_QUERY_END_SESSION
372  && IsContentModified() )
373  {
374  return false;
375  }
376 
377  if( IsContentModified() )
378  {
379  wxFileName filename = GetCurrentFileName();
380  wxString msg = _( "Save changes to '%s' before closing?" );
381 
382  if( !HandleUnsavedChanges( this, wxString::Format( msg, filename.GetFullName() ),
383  [&]() -> bool
384  {
385  return saveCurrentPageLayout();
386  } ) )
387  {
388  return false;
389  }
390  }
391 
392  return true;
393 }
394 
395 
397 {
398  // do not show the window because we do not want any paint event
399  Show( false );
400 
401  // clean up the data before the view is destroyed
403 
404  // On Linux, m_propertiesPagelayout must be destroyed
405  // before deleting the main frame to avoid a crash when closing
406  m_propertiesPagelayout->Destroy();
407  Destroy();
408 }
409 
410 
411 void PL_EDITOR_FRAME::OnSelectPage( wxCommandEvent& event )
412 {
413  KIGFX::VIEW* view = GetCanvas()->GetView();
414  view->SetLayerVisible( LAYER_DRAWINGSHEET_PAGE1, m_pageSelectBox->GetSelection() == 0 );
415  view->SetLayerVisible( LAYER_DRAWINGSHEET_PAGEn, m_pageSelectBox->GetSelection() == 1 );
416  GetCanvas()->Refresh();
417 }
418 
419 
420 void PL_EDITOR_FRAME::OnSelectCoordOriginCorner( wxCommandEvent& event )
421 {
422  m_originSelectChoice = m_originSelectBox->GetSelection();
423  UpdateStatusBar(); // Update grid origin
425  GetCanvas()->Refresh();
426 }
427 
428 
429 void PL_EDITOR_FRAME::ToPrinter( bool doPreview )
430 {
431  // static print data and page setup data, to remember settings during the session
432  static wxPrintData* s_PrintData;
433  static wxPageSetupDialogData* s_pageSetupData = nullptr;
434 
435  const PAGE_INFO& pageInfo = GetPageSettings();
436 
437  if( s_PrintData == nullptr ) // First print
438  {
439  s_PrintData = new wxPrintData();
440  s_PrintData->SetQuality( wxPRINT_QUALITY_HIGH ); // Default resolution = HIGH;
441  }
442 
443  if( !s_PrintData->Ok() )
444  {
445  wxMessageBox( _( "Error Init Printer info" ) );
446  return;
447  }
448 
449  if( s_pageSetupData == nullptr )
450  s_pageSetupData = new wxPageSetupDialogData( *s_PrintData );
451 
452  s_pageSetupData->SetPaperId( pageInfo.GetPaperId() );
453  s_pageSetupData->GetPrintData().SetOrientation( pageInfo.GetWxOrientation() );
454 
455  if( pageInfo.IsCustom() )
456  {
457  if( pageInfo.IsPortrait() )
458  s_pageSetupData->SetPaperSize( wxSize( Mils2mm( pageInfo.GetWidthMils() ),
459  Mils2mm( pageInfo.GetHeightMils() ) ) );
460  else
461  s_pageSetupData->SetPaperSize( wxSize( Mils2mm( pageInfo.GetHeightMils() ),
462  Mils2mm( pageInfo.GetWidthMils() ) ) );
463  }
464 
465  *s_PrintData = s_pageSetupData->GetPrintData();
466 
467  if( doPreview )
468  InvokeDialogPrintPreview( this, s_PrintData );
469  else
470  InvokeDialogPrint( this, s_PrintData, s_pageSetupData );
471 }
472 
473 
474 const BOX2I PL_EDITOR_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
475 {
476  BOX2I rv( VECTOR2I( 0, 0 ), GetPageLayout().GetPageSettings().GetSizeIU() );
477  return rv;
478 }
479 
480 
482  PANEL_HOTKEYS_EDITOR* aHotkeysPanel )
483 {
484  wxTreebook* book = aParent->GetTreebook();
485 
486  book->AddPage( new wxPanel( book ), _( "Drawing Sheet Editor" ) );
487  book->AddSubPage( new PANEL_GAL_DISPLAY_OPTIONS( this, aParent ), _( "Display Options" ) );
488  book->AddSubPage( new PANEL_PL_EDITOR_COLOR_SETTINGS( this, aParent->GetTreebook() ),
489  _( "Colors" ) );
490 
491  aHotkeysPanel->AddHotKeys( GetToolManager() );
492 }
493 
494 
496 {
498 
499  if( aCfg->m_Window.grid.sizes.empty() )
500  {
501  aCfg->m_Window.grid.sizes = { "5.00 mm",
502  "2.50 mm",
503  "2.00 mm",
504  "1.00 mm",
505  "0.50 mm",
506  "0.25 mm",
507  "0.20 mm",
508  "0.10 mm" };
509  }
510 
511  // Currently values read from config file are not used because the user cannot
512  // change this config
513  // if( aCfg->m_Window.zoom_factors.empty() )
514  {
516  }
517 
518  PL_EDITOR_SETTINGS* cfg = dynamic_cast<PL_EDITOR_SETTINGS*>( aCfg );
519  wxCHECK( cfg, /*void*/ );
520 
523 
525 
528 
529  PAGE_INFO pageInfo = GetPageSettings();
530  pageInfo.SetType( cfg->m_LastPaperSize, cfg->m_LastWasPortrait );
531  SetPageSettings( pageInfo );
532 }
533 
534 
536 {
538 
539  auto cfg = static_cast<PL_EDITOR_SETTINGS*>( aCfg );
540 
542 
543  cfg->m_PropertiesFrameWidth = m_propertiesFrameWidth;
544  cfg->m_CornerOrigin = m_originSelectChoice;
545  cfg->m_BlackBackground = GetDrawBgColor() == BLACK;
546  cfg->m_LastPaperSize = GetPageSettings().GetType();
547  cfg->m_LastWasPortrait = GetPageSettings().IsPortrait();
548  cfg->m_LastCustomWidth = PAGE_INFO::GetCustomWidthMils();
549  cfg->m_LastCustomHeight = PAGE_INFO::GetCustomHeightMils();
550 }
551 
552 
554 {
555  wxString title;
556  wxFileName file( GetCurrentFileName() );
557 
558  if( file.IsOk() )
559  title = file.GetName();
560  else
561  title = _( "[no drawing sheet loaded]" );
562 
563  title += wxT( " \u2014 " ) + _( "Drawing Sheet Editor" ),
564 
565  SetTitle( title );
566 }
567 
568 
570 {
572 }
573 
574 
575 void PL_EDITOR_FRAME::SetCurrentFileName( const wxString& aName )
576 {
578 }
579 
580 
581 void PL_EDITOR_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
582 {
583  m_pageLayout.SetPageSettings( aPageSettings );
584 
585  if( GetScreen() )
586  GetScreen()->InitDataPoints( aPageSettings.GetSizeIU() );
587 }
588 
589 
591 {
592  return m_pageLayout.GetPageSettings();
593 }
594 
595 
596 const wxSize PL_EDITOR_FRAME::GetPageSizeIU() const
597 {
598  // this function is only needed because EDA_DRAW_FRAME is not compiled
599  // with either -DPCBNEW or -DEESCHEMA, so the virtual is used to route
600  // into an application specific source file.
601  return m_pageLayout.GetPageSettings().GetSizeIU();
602 }
603 
604 
606 {
607  return GetPageLayout().GetTitleBlock();
608 }
609 
610 
611 void PL_EDITOR_FRAME::SetTitleBlock( const TITLE_BLOCK& aTitleBlock )
612 {
613  m_pageLayout.SetTitleBlock( aTitleBlock );
614 }
615 
616 
617 void PL_EDITOR_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
618 {
619  EDA_DRAW_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
620 
621  SETTINGS_MANAGER& settingsManager = Pgm().GetSettingsManager();
622  PL_EDITOR_SETTINGS* cfg = settingsManager.GetAppSettings<PL_EDITOR_SETTINGS>();
623  COLOR_SETTINGS* colors = settingsManager.GetColorSettings( cfg->m_ColorTheme );
624 
625  GetCanvas()->GetView()->GetPainter()->GetSettings()->LoadColors( colors );
626 
628  GetCanvas()->Refresh();
629 
631  Layout();
632  SendSizeEvent();
633 }
634 
635 
637 {
638  // calculate the position (in page, in iu) of the corner used as coordinate origin
639  // coordinate origin can be the paper Top Left corner, or each of 4 page corners
640  wxPoint originCoord;
641 
642  // To avoid duplicate code, we use a dummy segment starting at 0,0 in relative coord
644 
645  switch( m_originSelectChoice )
646  {
647  default:
648  case 0: // Origin = paper Left Top corner
649  break;
650 
651  case 1: // Origin = page Right Bottom corner
652  dummy.SetStart( 0, 0, RB_CORNER );
653  originCoord = dummy.GetStartPosUi();
654  break;
655 
656  case 2: // Origin = page Left Bottom corner
657  dummy.SetStart( 0, 0, LB_CORNER );
658  originCoord = dummy.GetStartPosUi();
659  break;
660 
661  case 3: // Origin = page Right Top corner
662  dummy.SetStart( 0, 0, RT_CORNER );
663  originCoord = dummy.GetStartPosUi();
664  break;
665 
666  case 4: // Origin = page Left Top corner
667  dummy.SetStart( 0, 0, LT_CORNER );
668  originCoord = dummy.GetStartPosUi();
669  break;
670  }
671 
672  return originCoord;
673 }
674 
675 
677 {
678  wxString line;
679  wxString gridformatter;
680 
681  switch( m_userUnits )
682  {
683  case EDA_UNITS::INCHES: gridformatter = "grid %.3f"; break;
684  case EDA_UNITS::MILLIMETRES: gridformatter = "grid %.4f"; break;
685  default: gridformatter = "grid %f"; break;
686  }
687 
688  double grid = To_User_Unit( m_userUnits, GetCanvas()->GetGAL()->GetGridSize().x );
689  line.Printf( gridformatter, grid );
690 
691  SetStatusText( line, 4 );
692 }
693 
694 
696 {
697  // Display Zoom level:
698  SetStatusText( GetZoomLevelIndicator(), 1 );
699 
700  // coordinate origin can be the paper Top Left corner, or each of 4 page corners
701  wxPoint originCoord = ReturnCoordOriginCorner();
702  SetGridOrigin( originCoord );
703 
704  // We need the orientation of axis (sign of coordinates)
705  int Xsign = 1;
706  int Ysign = 1;
707 
708  switch( m_originSelectChoice )
709  {
710  default:
711  case 0: // Origin = paper Left Top corner
712  break;
713 
714  case 1: // Origin = page Right Bottom corner
715  Xsign = -1;
716  Ysign = -1;
717  break;
718 
719  case 2: // Origin = page Left Bottom corner
720  Ysign = -1;
721  break;
722 
723  case 3: // Origin = page Right Top corner
724  Xsign = -1;
725  break;
726 
727  case 4: // Origin = page Left Top corner
728  break;
729  }
730 
731  // Display absolute coordinates:
733  VECTOR2D coord = cursorPos - originCoord;
734  double dXpos = To_User_Unit( GetUserUnits(), coord.x * Xsign );
735  double dYpos = To_User_Unit( GetUserUnits(), coord.y * Ysign );
736 
737  wxString absformatter = wxT( "X %.4g Y %.4g" );
738  wxString locformatter = wxT( "dx %.4g dy %.4g" );
739 
740  switch( GetUserUnits() )
741  {
742  case EDA_UNITS::INCHES: SetStatusText( _( "inches" ), 6 ); break;
743  case EDA_UNITS::MILS: SetStatusText( _( "mils" ), 6 ); break;
744  case EDA_UNITS::MILLIMETRES: SetStatusText( _( "mm" ), 6 ); break;
745  case EDA_UNITS::UNSCALED: SetStatusText( wxEmptyString, 6 ); break;
746  default: wxASSERT( false ); break;
747  }
748 
749  wxString line;
750 
751  // Display abs coordinates
752  line.Printf( absformatter, dXpos, dYpos );
753  SetStatusText( line, 2 );
754 
755  // Display relative coordinates:
756  if( GetScreen() )
757  {
758  double dx = cursorPos.x - GetScreen()->m_LocalOrigin.x;
759  double dy = cursorPos.y - GetScreen()->m_LocalOrigin.y;
760  dXpos = To_User_Unit( GetUserUnits(), dx * Xsign );
761  dYpos = To_User_Unit( GetUserUnits(), dy * Ysign );
762  line.Printf( locformatter, dXpos, dYpos );
763  SetStatusText( line, 3 );
764  }
765 
766  DisplayGridMsg();
767 
768  // Display corner reference for coord origin
769  line.Printf( _("coord origin: %s"),
770  m_originSelectBox->GetString( m_originSelectChoice ).GetData() );
771  SetStatusText( line, 5 );
772 
773  // Display units
774 }
775 
776 
778 {
781 
782  for( DS_DATA_ITEM* dataItem : model.GetItems() )
783  {
784  // Ensure the scaling factor (used only in printing) of bitmaps is up to date
785  if( dataItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
786  {
787  BITMAP_BASE* bitmap = static_cast<DS_DATA_ITEM_BITMAP*>( dataItem )->m_ImageBitmap;
788  bitmap->SetPixelSizeIu( IU_PER_MILS * 1000 / bitmap->GetPPI() );
789  }
790  }
791 
792  PrintDrawingSheet( aSettings, GetScreen(), IU_PER_MILS, wxEmptyString );
793 
795  GetCanvas()->Refresh();
796 }
797 
798 
800 {
801  return static_cast<PL_DRAW_PANEL_GAL*>( EDA_DRAW_FRAME::GetCanvas() );
802 }
803 
804 
806 {
807  return m_toolManager->GetTool<PL_SELECTION_TOOL>()->GetSelection();
808 }
809 
810 
812 {
814 
816  PL_SELECTION& selection = selTool->GetSelection();
817  DS_DATA_ITEM* item = nullptr;
818 
819  if( selection.GetSize() == 1 )
820  item = static_cast<DS_DRAW_ITEM_BASE*>( selection.Front() )->GetPeer();
821 
824  GetCanvas()->Refresh();
825 }
826 
827 
829 {
830  DS_DATA_ITEM * item = nullptr;
831 
832  switch( aType )
833  {
835  item = new DS_DATA_ITEM_TEXT( wxT( "Text") );
836  break;
837 
840  break;
841 
843  item = new DS_DATA_ITEM( DS_DATA_ITEM::DS_RECT );
844  break;
845 
847  item = new DS_DATA_ITEM_POLYGONS();
848  break;
849 
851  {
852  wxFileDialog fileDlg( this, _( "Choose Image" ), wxEmptyString, wxEmptyString,
853  _( "Image Files" ) + wxS( " " ) + wxImage::GetImageExtWildcard(),
854  wxFD_OPEN );
855 
856  if( fileDlg.ShowModal() != wxID_OK )
857  return nullptr;
858 
859  wxString fullFilename = fileDlg.GetPath();
860 
861  if( !wxFileExists( fullFilename ) )
862  {
863  wxMessageBox( _( "Could not load image from '%s'." ), fullFilename );
864  break;
865  }
866 
867  BITMAP_BASE* image = new BITMAP_BASE();
868 
869  if( !image->ReadImageFile( fullFilename ) )
870  {
871  wxMessageBox( _( "Could not load image from '%s'." ), fullFilename );
872  delete image;
873  break;
874  }
875 
876  // Set the scale factor for pl_editor (it is set for Eeschema by default)
877  image->SetPixelSizeIu( IU_PER_MILS * 1000.0 / image->GetPPI() );
878  item = new DS_DATA_ITEM_BITMAP( image );
879  }
880  break;
881  }
882 
883  if( item == nullptr )
884  return nullptr;
885 
887  item->SyncDrawItems( nullptr, GetCanvas()->GetView() );
888 
889  return item;
890 }
891 
892 
894 {
896  GetScreen()->SetContentModified( false );
898 
901 
903 
905 
906  if( GetCurrentFileName().IsEmpty() )
907  {
908  // Default shutdown reason until a file is loaded
909  KIPLATFORM::APP::SetShutdownBlockReason( this, _( "New drawing sheet file is unsaved" ) );
910  }
911  else
912  {
913  KIPLATFORM::APP::SetShutdownBlockReason( this, _( "Drawing sheet changes are unsaved" ) );
914  }
915 }
916 
917 
918 void PL_EDITOR_FRAME::ClearUndoORRedoList( UNDO_REDO_LIST whichList, int aItemCount )
919 {
920  if( aItemCount == 0 )
921  return;
922 
923  UNDO_REDO_CONTAINER& list = whichList == UNDO_LIST ? m_undoList : m_redoList;
924  unsigned icnt = list.m_CommandsList.size();
925 
926  if( aItemCount > 0 )
927  icnt = aItemCount;
928 
929  for( unsigned ii = 0; ii < icnt; ii++ )
930  {
931  if( list.m_CommandsList.size() == 0 )
932  break;
933 
934  PICKED_ITEMS_LIST* curr_cmd = list.m_CommandsList[0];
935  list.m_CommandsList.erase( list.m_CommandsList.begin() );
936 
937  curr_cmd->ClearListAndDeleteItems();
938  delete curr_cmd; // Delete command
939  }
940 }
941 
942 
944 {
945  return m_pageSelectBox->GetSelection() == 0;
946 }
void ShutdownAllTools()
Shutdown all tools with a currently registered event loop in this tool manager by waking them up with...
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
void OnFileHistory(wxCommandEvent &event)
void ToPrinter(bool doPreview)
Open a dialog frame to print layers.
void ClearList()
Erase the list of items.
virtual void PrintPage(const RENDER_SETTINGS *aSettings) override
Print a page.
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.
Definition: confirm.cpp:239
Handle the graphic items list to draw/plot the frame and title block.
Definition: ds_data_model.h:38
void OnKiCadExit()
Definition: kiway.cpp:626
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
void HardRedraw() override
Refresh the library tree and redraw the window.
bool IsContentModified() const
Definition: base_screen.h:60
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the #VIEW_CONTROLS instance used in the panel.
wxPrintOrientation GetWxOrientation() const
Definition: page_info.h:122
void SetVirtualPageNumber(int aPageNumber)
Definition: base_screen.h:76
PL_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
const PAGE_INFO & GetPageSettings() const override
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
static int GetCustomHeightMils()
Definition: page_info.h:165
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
void ClearUndoORRedoList(UNDO_REDO_LIST whichList, int aItemCount=-1) override
Remove the aItemCount of old commands from aList and delete commands, pickers and picked items if nee...
static TOOL_ACTION layoutEditMode
Definition: pl_actions.h:68
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock) override
This file is part of the common library.
static TOOL_ACTION doDelete
Definition: actions.h:72
SELECTION_CONDITION FullscreenCursor()
Create a functor testing if the cursor is full screen in a frame.
#define CHECK(x)
for drawingsheetEditor previewing
Definition: layer_ids.h:238
static TOOL_ACTION drawLine
Definition: pl_actions.h:61
Definition: id.h:87
int GetHeightMils() const
Definition: page_info.h:133
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
UNDO_REDO_CONTAINER m_undoList
static TOOL_ACTION zoomTool
Definition: actions.h:99
static TOOL_ACTION placeImage
Definition: pl_actions.h:59
static bool Idle(const SELECTION &aSelection)
Test if there no items selected or being edited.
wxPoint ReturnCoordOriginCorner() const
Calculate the position (in page, in iu) of the corner used as coordinate origin of items.
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType
PROPERTIES_FRAME display properties of the current item.
The main window used in the drawing sheet editor.
void UpdateStatusBar() override
Update the status bar information.
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition: view.cpp:1482
SELECTION_CONDITION CurrentTool(const TOOL_ACTION &aTool)
Create a functor testing if the specified tool is the current active tool in the frame.
bool canCloseWindow(wxCloseEvent &aCloseEvent) override
int InvokeDialogPrint(PL_EDITOR_FRAME *aCaller, wxPrintData *aPrintData, wxPageSetupDialogData *aPageSetupData)
Create and show a print dialog returns 1 if OK, 0 , there is a problem.
void OnClearFileHistory(wxCommandEvent &aEvent)
static void SetCustomWidthMils(int aWidthInMils)
Set the width of Custom page in mils for any custom page constructed or made via SetType() after maki...
Definition: page_info.cpp:231
bool SetType(const wxString &aStandardPageDescriptionName, bool aIsPortrait=false)
Set the name of the page type and also the sizes and margins commonly associated with that type name.
Definition: page_info.cpp:119
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
static TOOL_ACTION zoomFitScreen
Definition: actions.h:96
static TOOL_ACTION millimetersUnits
Definition: actions.h:146
void RecreateToolbars()
Rebuild all toolbars, and update the checked state of check tools.
int InvokeDialogPrintPreview(PL_EDITOR_FRAME *aCaller, wxPrintData *aPrintData)
Create and show a print preview dialog returns 1 if OK, 0 , there is a problem.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
std::vector< DS_DATA_ITEM * > & GetItems()
#define PL_EDITOR_FRAME_NAME
void AddHotKeys(TOOL_MANAGER *aToolMgr)
const wxString & GetType() const
Definition: page_info.h:94
SELECTION_CONDITION RedoAvailable()
Create a functor that tests if there are any items in the redo queue.
static TOOL_ACTION placeText
Definition: pl_actions.h:58
Manage TOOL_ACTION objects.
Definition: color4d.h:44
Gather all the actions that are shared by tools.
Definition: pl_actions.h:35
void DisplayDrawingSheet()
Build and update the list of WS_DRAW_ITEM_xxx showing the frame layout.
bool IsCustom() const
Definition: page_info.cpp:180
Color has changed.
Definition: view_item.h:48
The base class for create windows for drawing purpose.
VECTOR2< int > VECTOR2I
Definition: vector2d.h:622
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:40
const wxSize GetPageSizeIU() const override
Works off of GetPageSettings() to return the size of the paper page in the internal units of this par...
static bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
Class that groups generic conditions for editor states.
std::vector< double > zoom_factors
Definition: app_settings.h:86
PAGE_INFO & GetPageSettings()
bool InvokeTool(TOOL_ID aToolId)
Call a tool by sending a tool activation event to tool of given ID.
PL_SELECTION & GetSelection()
Return the set of currently selected items.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:208
wxPaperSize GetPaperId() const
Definition: page_info.h:127
virtual void SyncDrawItems(DS_DRAW_ITEM_LIST *aCollector, KIGFX::VIEW *aView)
This class handle bitmap images in KiCad.
Definition: bitmap_base.h:51
wxTreebook * GetTreebook()
Definition: paged_dialog.h:37
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
Definition: sch_symbol.cpp:72
void SetShutdownBlockReason(wxWindow *aWindow, const wxString &aReason)
Sets the block reason why the window/application is preventing OS shutdown.
Definition: gtk/app.cpp:83
void InitDataPoints(const wxSize &aPageSizeInternalUnits)
Definition: base_screen.cpp:46
Master controller class:
Definition: tool_manager.h:54
EVT_MENU_RANGE(ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILEMAX, GERBVIEW_FRAME::OnDrlFileHistory) EVT_MENU_RANGE(ID_GERBVIEW_ZIP_FILE1
A holder to handle a list of undo (or redo) commands.
for drawingsheetEditor previewing
Definition: layer_ids.h:239
static TOOL_ACTION copy
Definition: actions.h:67
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
static DS_DATA_MODEL & GetTheInstance()
static function: returns the instance of DS_DATA_MODEL used in the application
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
wxString GetCurrentFileName() const override
void SetPageSettings(const PAGE_INFO &) override
std::vector< wxString > sizes
Definition: app_settings.h:52
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:99
SELECTION_CONDITION GridVisible()
Create a functor testing if the grid is visible in a frame.
void AllowVoidList(bool Allow)
In KiCad applications, a drawing sheet is needed So if the list is empty, a default drawing sheet is ...
Definition: ds_data_model.h:83
wxSize GetTextSize(const wxString &aSingleLine, wxWindow *aWindow)
Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currentl...
Definition: ui_common.cpp:70
SELECTION_CONDITION Units(EDA_UNITS aUnit)
Create a functor that tests if the frame has the specified units.
std::vector< PICKED_ITEMS_LIST * > m_CommandsList
TITLE_BLOCK & GetTitleBlock()
bool OpenProjectFiles(const std::vector< wxString > &aFileSet, int aCtl) override
Open a project or set of files given by aFileList.
GRID_SETTINGS grid
Definition: app_settings.h:89
static TOOL_ACTION toggleGrid
Definition: actions.h:140
GAL not used (the legacy wxDC engine is used)
void OnExit(wxCommandEvent &aEvent)
Event handler for the wxID_EXIT and wxID_CLOSE events.
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
static TOOL_ACTION inchesUnits
Definition: actions.h:144
Handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:40
void OnSelectCoordOriginCorner(wxCommandEvent &event)
Called when the user select one of the 4 page corner as corner reference (or the left top paper corne...
static TOOL_ACTION save
Definition: actions.h:51
bool IsContentModified() const override
Get if the drawing sheet has been modified but not saved.
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
ACTIONS * m_actions
Definition: tools_holder.h:159
static TOOL_ACTION cut
Definition: actions.h:66
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:260
const TITLE_BLOCK & GetTitleBlock() const override
#define _(s)
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
Definition: arraydim.h:31
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
Definition: view.h:388
bool SupportsShutdownBlockReason()
Whether or not the window supports setting a shutdown block reason.
Definition: gtk/app.cpp:72
#define KICAD_DEFAULT_DRAWFRAME_STYLE
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
static TOOL_ACTION drawRectangle
Definition: pl_actions.h:60
void doCloseWindow() override
A holder to handle information on schematic or board items.
void PrintDrawingSheet(const RENDER_SETTINGS *aSettings, BASE_SCREEN *aScreen, double aMils2Iu, const wxString &aFilename, const wxString &aSheetLayer=wxEmptyString)
Prints the drawing-sheet (frame and title block).
PL_EDITOR_LAYOUT m_pageLayout
bool GetPageNumberOption() const
Drawing sheet editor can show the title block using a page number 1 or another number.
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:105
Handle actions that are shared between different applications.
Specialization of the wxAuiPaneInfo class for KiCad panels.
void OnSelectPage(wxCommandEvent &event)
void SetConditions(const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
Set the conditions the UI elements for activating a specific tool action should use for determining t...
UNDO_REDO_CONTAINER m_redoList
static TOOL_ACTION milsUnits
Definition: actions.h:145
TOOL_DISPATCHER * m_toolDispatcher
Definition: tools_holder.h:160
void SetPixelSizeIu(double aPixSize)
Definition: bitmap_base.h:68
Handles action that are shared between different applications.
Definition: common_tools.h:37
void InstallPreferences(PAGED_DIALOG *aParent, PANEL_HOTKEYS_EDITOR *aHotkeysPanel) override
Allow a frame to load its preference panels (if any) into the preferences dialog.
wxChoice * m_pageSelectBox
const wxString GetZoomLevelIndicator() const
Return a human readable value for display in dialogs.
UNDO_REDO_LIST
Specifies whether we are interacting with the undo or redo stacks.
Definition: color4d.h:48
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
void SetContentModified(bool aModified=true)
Definition: base_screen.h:59
#define ENABLE(x)
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
void SetPageSettings(const PAGE_INFO &aPageSettings)
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
static TOOL_ACTION redo
Definition: actions.h:65
WINDOW_SETTINGS m_Window
Definition: app_settings.h:181
void SetCurrentFileName(const wxString &aName)
Store the current layout description file filename.
double To_User_Unit(EDA_UNITS aUnit, double aValue)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
Definition: base_units.cpp:68
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void UpdateTitleAndInfo()
Display the short filename (if exists) loaded file on the caption of the main window.
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:158
see class PGM_BASE
Drawing sheet structure type definitions.
Definition: ds_data_item.h:95
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, APP_SETTINGS_BASE *aSettings, TOOLS_HOLDER *aFrame)
Set the work environment (model, view, view controls and the parent window).
bool IsPortrait() const
Definition: page_info.h:117
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Set a dispatcher that processes events and forwards them to tools.
static TOOL_ACTION appendImportedDrawingSheet
Definition: pl_actions.h:62
SELECTION_CONDITION UndoAvailable()
Create a functor that tests if there are any items in the undo queue.
static wxString m_DrawingSheetFileName
the name of the drawing sheet file, or empty to use the default drawing sheet
Definition: base_screen.h:85
PROPERTIES_FRAME * m_propertiesPagelayout
The last filename chosen to be proposed to the user.
void DisplayGridMsg() override
Display current grid size in the status bar.
void SetGridOrigin(const wxPoint &aPoint) override
int Mils2mm(double x)
Convert mils to mm.
Definition: base_units.cpp:62
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Tool responsible for drawing/placing items (lines, rectangles, text, etc.)
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...
EDA_UNITS m_userUnits
Map containing the UI update handlers registered with wx for each action.
#define IU_PER_MILS
Definition: plotter.cpp:136
bool LoadDrawingSheet(const wxString &aFullFileName=wxEmptyString, bool Append=false)
Populates the list with a custom layout or the default layout if no custom layout is available.
static bool ShowNever(const SELECTION &aSelection)
Always returns false.
Handle actions specific to the drawing sheet editor.
static int GetCustomWidthMils()
Definition: page_info.h:160
ACTION_MANAGER * GetActionManager() const
Definition: tool_manager.h:199
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
void OnNewDrawingSheet()
Must be called to initialize parameters when a new drawing sheet is loaded.
Color settings are a bit different than most of the settings objects in that there can be more than o...
const BOX2I GetDocumentExtents(bool aIncludeAllVisible=true) const override
Returns bbox of document with option to not include some items.
static TOOL_ACTION deleteTool
Definition: actions.h:73
void CopyPrmsFromItemToPanel(DS_DATA_ITEM *aItem)
Definition: id.h:86
virtual COLOR4D GetDrawBgColor() const
static TOOL_ACTION undo
Definition: actions.h:64
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:54
GAL_TYPE GetBackend() const
Return the type of backend currently used by GAL canvas.
static TOOL_ACTION layoutNormalMode
Definition: pl_actions.h:67
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
static TOOL_ACTION toggleCursorStyle
Definition: actions.h:102
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::OnSelectDisplayMode EVT_CHOICE(ID_GBR_AUX_TOOLBAR_PCB_APERATTRIBUTES_CHOICE, GERBVIEW_FRAME::OnSelectHighlightChoice) EVT_UPDATE_UI(ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER
void InitTools()
Initializes all registered tools.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
const PL_EDITOR_LAYOUT & GetPageLayout() const
void Append(DS_DATA_ITEM *aItem)
DS_DATA_ITEM * AddDrawingSheetItem(int aType)
Add a new item to the drawing sheet item list.
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual void ClearUndoRedoList()
Clear the undo and redo list using ClearUndoORRedoList()
static TOOL_ACTION paste
Definition: actions.h:68
wxChoice * m_originSelectBox
bool IsSingle() const
Is this KIFACE running under single_top?
Definition: kiface_base.h:104
bool LoadDrawingSheetFile(const wxString &aFullFileName)
Load a .kicad_wks drawing sheet file.
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
virtual void SetDrawBgColor(const COLOR4D &aColor)
static void SetCustomHeightMils(int aHeightInMils)
Set the height of Custom page in mils for any custom page constructed or made via SetType() after mak...
Definition: page_info.cpp:237
void ClearListAndDeleteItems()
Delete the list of pickers AND the data pointed by #m_PickedItem or #m_PickedItemLink according to th...
static TOOL_ACTION selectionTool
Definition: actions.h:153
int GetPPI() const
Definition: bitmap_base.h:135
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
int GetWidthMils() const
Definition: page_info.h:130
VECTOR2D m_LocalOrigin
Relative Screen cursor coordinate (on grid) in user units.
Definition: base_screen.h:90
#define ZOOM_LIST_PL_EDITOR
Definition: zoom_defines.h:35
void RegisterTool(TOOL_BASE *aTool)
Add a tool to the manager set and sets it up.
Tool that displays edit points allowing to modify items by dragging the points.
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:184
void Files_io(wxCommandEvent &event)