KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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-2023 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>
33#include <confirm.h>
34#include <kiplatform/app.h>
36#include <gal/painter.h>
38#include <tool/selection.h>
39#include <tool/action_toolbar.h>
42#include <tool/tool_manager.h>
43#include <tool/common_control.h>
44#include <tool/common_tools.h>
45#include <tool/picker_tool.h>
46#include <tool/zoom_tool.h>
48#include "pl_editor_frame.h"
49#include "pl_editor_id.h"
50#include "pl_editor_settings.h"
51#include "properties_frame.h"
52#include "tools/pl_actions.h"
55#include "tools/pl_edit_tool.h"
59#include <view/view_controls.h>
60#include <zoom_defines.h>
61
62#include <wx/filedlg.h>
63#include <wx/print.h>
64#include <wx/treebook.h>
65#include <wx/msgdlg.h>
66#include <wx/log.h>
67
69
70
71BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME )
72 EVT_MENU( wxID_CLOSE, PL_EDITOR_FRAME::OnExit )
73 EVT_MENU( wxID_EXIT, PL_EDITOR_FRAME::OnExit )
74
75 EVT_MENU( wxID_FILE, PL_EDITOR_FRAME::Files_io )
76
79
82
83 // Drop files event
84 EVT_DROP_FILES( PL_EDITOR_FRAME::OnDropFiles )
85END_EVENT_TABLE()
86
87
88PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
89 EDA_DRAW_FRAME( aKiway, aParent, FRAME_PL_EDITOR, wxT( "PlEditorFrame" ), wxDefaultPosition,
92 m_propertiesPagelayout( nullptr ), m_propertiesFrameWidth( 200 ),
93 m_originSelectBox( nullptr ), m_originSelectChoice( 0 ), m_pageSelectBox( nullptr ),
94 m_mruImagePath( wxEmptyString )
95{
96 m_maximizeByDefault = true;
97 SetUserUnits( EDA_UNITS::MILLIMETRES );
98
99 m_showBorderAndTitleBlock = true; // true for reference drawings.
101 m_aboutTitle = _HKI( "KiCad Drawing Sheet Editor" );
102
103 // Give an icon
104 wxIcon icon;
105 wxIconBundle icon_bundle;
106
107 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pagelayout_editor, 48 ) );
108 icon_bundle.AddIcon( icon );
109 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pagelayout_editor, 128 ) );
110 icon_bundle.AddIcon( icon );
111 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pagelayout_editor, 256 ) );
112 icon_bundle.AddIcon( icon );
113 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pagelayout_editor_32 ) );
114 icon_bundle.AddIcon( icon );
115 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pagelayout_editor_16 ) );
116 icon_bundle.AddIcon( icon );
117
118 SetIcons( icon_bundle );
119
120 // Create GAL canvas
121 auto* drawPanel = new PL_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_frameSize,
122 GetGalDisplayOptions(),
124 SetCanvas( drawPanel );
125
126 LoadSettings( config() );
127
128 m_acceptedExts.emplace( FILEEXT::DrawingSheetFileExtension, nullptr );
129 DragAcceptFiles( true );
130
131 VECTOR2I pageSizeIU = GetPageLayout().GetPageSettings().GetSizeIU( drawSheetIUScale.IU_PER_MILS );
132 SetScreen( new BASE_SCREEN( pageSizeIU ) );
133
134 setupTools();
135 setupUIConditions();
136 ReCreateMenuBar();
137 ReCreateHToolbar();
138 ReCreateVToolbar();
139 ReCreateOptToolbar();
140
141 wxWindow* stsbar = GetStatusBar();
142 int spacer = KIUI::GetTextSize( wxT( "M" ), stsbar ).x * 2;
143
144 int dims[] = {
145
146 // balance of status bar on far left is set to a default or whatever is left over.
147 -1,
148
149 // When using GetTextSize() remember the width of '1' is not the same
150 // as the width of '0' unless the font is fixed width, and it usually won't be.
151
152 // zoom:
153 KIUI::GetTextSize( wxT( "Z 762000" ), stsbar ).x + spacer,
154
155 // cursor coords
156 KIUI::GetTextSize( wxT( "X 0234.567 Y 0234.567" ), stsbar ).x + spacer,
157
158 // delta distances
159 KIUI::GetTextSize( wxT( "dx 0234.567 dx 0234.567" ), stsbar ).x + spacer,
160
161 // grid size
162 KIUI::GetTextSize( wxT( "grid 0234.567" ), stsbar ).x + spacer,
163
164 // Coord origin (use the bigger message)
165 KIUI::GetTextSize( _( "coord origin: Right Bottom page corner" ), stsbar ).x + spacer,
166
167 // units display, Inches is bigger than mm
168 KIUI::GetTextSize( _( "Inches" ), stsbar ).x + spacer,
169
170 // constraint mode
171 KIUI::GetTextSize( _( "Constrain to H, V, 45" ), stsbar ).x + spacer
172 };
173
174 SetStatusWidths( arrayDim( dims ), dims );
175
176 m_auimgr.SetManagedWindow( this );
177
178 CreateInfoBar();
179 m_propertiesPagelayout = new PROPERTIES_FRAME( this );
180
181 // Rows; layers 4 - 6
182 m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" )
183 .Top().Layer( 6 ) );
184 m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
185 .Left().Layer( 3 ) );
186 m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" )
187 .Bottom().Layer( 6 ) );
188
189 // Columns; layers 1 - 3
190 m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" )
191 .Right().Layer( 2 ) );
192
193 m_auimgr.AddPane( m_propertiesPagelayout, EDA_PANE().Palette().Name( "Props" )
194 .Right().Layer( 3 )
195 .Caption( _( "Properties" ) )
196 .MinSize( m_propertiesPagelayout->GetMinSize() )
197 .BestSize( m_propertiesFrameWidth, -1 ) );
198
199 // Center
200 m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" )
201 .Center() );
202
203 FinishAUIInitialization();
204
205 resolveCanvasType();
206 SwitchCanvas( m_canvasType );
207
208 // Add the exit key handler
209 setupUnits( config() );
210
211 VECTOR2I originCoord = ReturnCoordOriginCorner();
212 SetGridOrigin( originCoord );
213
214 // Initialize the current drawing sheet
215#if 0 //start with empty layout
218#else // start with the default KiCad layout
219 DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( wxEmptyString, nullptr );
220#endif
221 OnNewDrawingSheet();
222
223 // Ensure the window is on top
224 Raise();
225
226 // Register a call to update the toolbar sizes. It can't be done immediately because
227 // it seems to require some sizes calculated that aren't yet (at least on GTK).
228 CallAfter( [this]()
229 {
230 // Ensure the controls on the toolbars all are correctly sized
231 UpdateToolbarControlSizes();
232 } );
233
234 try
235 {
236 if( !m_spaceMouse )
237 m_spaceMouse = std::make_unique<NL_PL_EDITOR_PLUGIN>();
238 m_spaceMouse->SetCanvas( GetCanvas() );
239 }
240 catch( const std::system_error& e )
241 {
242 wxLogTrace( wxT( "KI_TRACE_NAVLIB" ), e.what() );
243 }
244}
245
246
248{
249 // Ensure m_canvasType is up to date, to save it in config
251
252 // Shutdown all running tools
253 if( m_toolManager )
255}
256
257
259{
260 // Create the manager and dispatcher & route draw panel events to the dispatcher
262 m_toolManager->SetEnvironment( nullptr, GetCanvas()->GetView(),
263 GetCanvas()->GetViewControls(), config(), this );
264 m_actions = new PL_ACTIONS();
266
268
269 // Register tools
280
281 // Run the selection tool, it is supposed to be always active
282 m_toolManager->InvokeTool( "plEditor.InteractiveSelection" );
283}
284
285
287{
289
291 EDITOR_CONDITIONS cond( this );
292
293 wxASSERT( mgr );
294
295#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
296#define CHECK( x ) ACTION_CONDITIONS().Check( x )
297
301
304 mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MILLIMETRES ) ) );
305 mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCHES ) ) );
306 mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) );
307
312
319
328
329 // Not a tool, just a way to activate the action
332
333 auto titleBlockNormalMode =
334 [] ( const SELECTION& )
335 {
337 };
338
339 auto titleBlockEditMode =
340 [] ( const SELECTION& )
341 {
343 };
344
345 mgr->SetConditions( PL_ACTIONS::layoutNormalMode, CHECK( titleBlockNormalMode ) );
346 mgr->SetConditions( PL_ACTIONS::layoutEditMode, CHECK( titleBlockEditMode ) );
347
348#undef CHECK
349#undef ENABLE
350}
351
352
353bool PL_EDITOR_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl )
354{
355 wxString fn = aFileSet[0];
356
357 if( !LoadDrawingSheetFile( fn ) )
358 {
359 wxMessageBox( wxString::Format( _( "Error loading drawing sheet '%s'." ), fn ) );
360 return false;
361 }
362 else
363 {
365 return true;
366 }
367}
368
369
371{
372 // Must be called after a change in order to set the "modify" flag and update
373 // the frame title.
375
377
379}
380
381
383{
384 return GetScreen() && GetScreen()->IsContentModified();
385}
386
387
388void PL_EDITOR_FRAME::OnExit( wxCommandEvent& aEvent )
389{
390 if( aEvent.GetId() == wxID_EXIT )
391 Kiway().OnKiCadExit();
392
393 if( aEvent.GetId() == wxID_CLOSE || Kiface().IsSingle() )
394 Close( false );
395}
396
397
398bool PL_EDITOR_FRAME::canCloseWindow( wxCloseEvent& aEvent )
399{
400 // Shutdown blocks must be determined and vetoed as early as possible
402 && aEvent.GetId() == wxEVT_QUERY_END_SESSION
403 && IsContentModified() )
404 {
405 return false;
406 }
407
408 if( IsContentModified() )
409 {
410 wxFileName filename = GetCurrentFileName();
411 wxString msg = _( "Save changes to '%s' before closing?" );
412
413 if( !HandleUnsavedChanges( this, wxString::Format( msg, filename.GetFullName() ),
414 [&]() -> bool
415 {
416 return saveCurrentPageLayout();
417 } ) )
418 {
419 return false;
420 }
421 }
422
423 return true;
424}
425
426
428{
429 // do not show the window because we do not want any paint event
430 Show( false );
431
432 // clean up the data before the view is destroyed
434
435 // On Linux, m_propertiesPagelayout must be destroyed
436 // before deleting the main frame to avoid a crash when closing
437 m_propertiesPagelayout->Destroy();
438 Destroy();
439}
440
441
442void PL_EDITOR_FRAME::OnSelectPage( wxCommandEvent& event )
443{
444 KIGFX::VIEW* view = GetCanvas()->GetView();
445 view->SetLayerVisible( LAYER_DRAWINGSHEET_PAGE1, m_pageSelectBox->GetSelection() == 0 );
446 view->SetLayerVisible( LAYER_DRAWINGSHEET_PAGEn, m_pageSelectBox->GetSelection() == 1 );
447 GetCanvas()->Refresh();
448}
449
450
452{
453 m_originSelectChoice = m_originSelectBox->GetSelection();
454 UpdateStatusBar(); // Update grid origin
456 GetCanvas()->Refresh();
457}
458
459
460void PL_EDITOR_FRAME::ToPrinter( bool doPreview )
461{
462 // static print data and page setup data, to remember settings during the session
463 static wxPrintData* s_PrintData;
464 static wxPageSetupDialogData* s_pageSetupData = nullptr;
465
466 const PAGE_INFO& pageInfo = GetPageSettings();
467
468 if( s_PrintData == nullptr ) // First print
469 {
470 s_PrintData = new wxPrintData();
471 s_PrintData->SetQuality( wxPRINT_QUALITY_HIGH ); // Default resolution = HIGH;
472 }
473
474 if( !s_PrintData->Ok() )
475 {
476 wxMessageBox( _( "Error Init Printer info" ) );
477 return;
478 }
479
480 if( s_pageSetupData == nullptr )
481 s_pageSetupData = new wxPageSetupDialogData( *s_PrintData );
482
483 s_pageSetupData->SetPaperId( pageInfo.GetPaperId() );
484 s_pageSetupData->GetPrintData().SetOrientation( pageInfo.GetWxOrientation() );
485
486 if( pageInfo.IsCustom() )
487 {
488 if( pageInfo.IsPortrait() )
489 s_pageSetupData->SetPaperSize( wxSize( EDA_UNIT_UTILS::Mils2mm( pageInfo.GetWidthMils() ),
490 EDA_UNIT_UTILS::Mils2mm( pageInfo.GetHeightMils() ) ) );
491 else
492 s_pageSetupData->SetPaperSize( wxSize( EDA_UNIT_UTILS::Mils2mm( pageInfo.GetHeightMils() ),
493 EDA_UNIT_UTILS::Mils2mm( pageInfo.GetWidthMils() ) ) );
494 }
495
496 *s_PrintData = s_pageSetupData->GetPrintData();
497
498 if( doPreview )
499 InvokeDialogPrintPreview( this, s_PrintData );
500 else
501 InvokeDialogPrint( this, s_PrintData, s_pageSetupData );
502}
503
504
505const BOX2I PL_EDITOR_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
506{
508 return rv;
509}
510
511
513{
515
516 if( aCfg->m_Window.grid.grids.empty() )
517 {
518 aCfg->m_Window.grid.grids = { GRID{ wxEmptyString, wxS( "5.00 mm" ), wxS( "5.00 mm" ) },
519 GRID{ wxEmptyString, wxS( "2.50 mm" ), wxS( "2.50 mm" ) },
520 GRID{ wxEmptyString, wxS( "2.00 mm" ), wxS( "2.00 mm" ) },
521 GRID{ wxEmptyString, wxS( "1.00 mm" ), wxS( "1.00 mm" ) },
522 GRID{ wxEmptyString, wxS( "0.50 mm" ), wxS( "0.50 mm" ) },
523 GRID{ wxEmptyString, wxS( "0.25 mm" ), wxS( "0.25 mm" ) },
524 GRID{ wxEmptyString, wxS( "0.20 mm" ), wxS( "0.20 mm" ) },
525 GRID{ wxEmptyString, wxS( "0.10 mm" ), wxS( "0.10 mm" ) } };
526 }
527
528 // Currently values read from config file are not used because the user cannot
529 // change this config
530 // if( aCfg->m_Window.zoom_factors.empty() )
531 {
533 }
534
535 PL_EDITOR_SETTINGS* cfg = dynamic_cast<PL_EDITOR_SETTINGS*>( aCfg );
536 wxCHECK( cfg, /*void*/ );
537
540
542
545
546 PAGE_INFO pageInfo = GetPageSettings();
547 pageInfo.SetType( cfg->m_LastPaperSize, cfg->m_LastWasPortrait );
548 SetPageSettings( pageInfo );
549}
550
551
553{
555
556 auto cfg = static_cast<PL_EDITOR_SETTINGS*>( aCfg );
557
559
560 cfg->m_PropertiesFrameWidth = m_propertiesFrameWidth;
561 cfg->m_CornerOrigin = m_originSelectChoice;
562 cfg->m_BlackBackground = GetDrawBgColor() == BLACK;
563 cfg->m_LastPaperSize = GetPageSettings().GetType();
564 cfg->m_LastWasPortrait = GetPageSettings().IsPortrait();
565 cfg->m_LastCustomWidth = PAGE_INFO::GetCustomWidthMils();
566 cfg->m_LastCustomHeight = PAGE_INFO::GetCustomHeightMils();
567}
568
569
571{
572 wxString title;
573 wxFileName file( GetCurrentFileName() );
574
575 if( IsContentModified() )
576 title = wxT( "*" );
577
578 if( file.IsOk() )
579 title += file.GetName();
580 else
581 title += _( "[no drawing sheet loaded]" );
582
583 title += wxT( " \u2014 " ) + _( "Drawing Sheet Editor" ),
584
585 SetTitle( title );
586}
587
588
590{
592}
593
594
595void PL_EDITOR_FRAME::SetCurrentFileName( const wxString& aName )
596{
598}
599
600
601void PL_EDITOR_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
602{
603 m_pageLayout.SetPageSettings( aPageSettings );
604
605 if( GetScreen() )
607}
608
609
611{
613}
614
615
617{
618 // this function is only needed because EDA_DRAW_FRAME is not compiled
619 // with either -DPCBNEW or -DEESCHEMA, so the virtual is used to route
620 // into an application specific source file.
622}
623
624
626{
627 return GetPageLayout().GetTitleBlock();
628}
629
630
632{
633 m_pageLayout.SetTitleBlock( aTitleBlock );
634}
635
636
637void PL_EDITOR_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
638{
639 EDA_DRAW_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
640
642 PL_EDITOR_SETTINGS* cfg = mgr.GetAppSettings<PL_EDITOR_SETTINGS>( "pl_editor" );
643 COLOR_SETTINGS* colors = mgr.GetColorSettings( cfg->m_ColorTheme );
644
645 // Update gal display options like cursor shape, grid options:
647
648 GetCanvas()->GetView()->GetPainter()->GetSettings()->LoadColors( colors );
649
652
654 Layout();
655 SendSizeEvent();
656}
657
658
660{
661 // calculate the position (in page, in iu) of the corner used as coordinate origin
662 // coordinate origin can be the paper Top Left corner, or each of 4 page corners
663 VECTOR2I originCoord;
664
665 // To avoid duplicate code, we use a dummy segment starting at 0,0 in relative coord
667
668 switch( m_originSelectChoice )
669 {
670 default:
671 case 0: // Origin = paper Left Top corner
672 break;
673
674 case 1: // Origin = page Right Bottom corner
675 dummy.SetStart( 0, 0, RB_CORNER );
676 originCoord = dummy.GetStartPosIU();
677 break;
678
679 case 2: // Origin = page Left Bottom corner
680 dummy.SetStart( 0, 0, LB_CORNER );
681 originCoord = dummy.GetStartPosIU();
682 break;
683
684 case 3: // Origin = page Right Top corner
685 dummy.SetStart( 0, 0, RT_CORNER );
686 originCoord = dummy.GetStartPosIU();
687 break;
688
689 case 4: // Origin = page Left Top corner
690 dummy.SetStart( 0, 0, LT_CORNER );
691 originCoord = dummy.GetStartPosIU();
692 break;
693 }
694
695 return originCoord;
696}
697
698
700{
701 wxString line;
702 wxString gridformatter;
703
704 switch( GetUserUnits() )
705 {
706 case EDA_UNITS::INCHES: gridformatter = wxS( "grid %.3f" ); break;
707 case EDA_UNITS::MILLIMETRES: gridformatter = wxS( "grid %.4f" ); break;
708 default: gridformatter = wxS( "grid %f" ); break;
709 }
710
712 GetCanvas()->GetGAL()->GetGridSize().x );
713 line.Printf( gridformatter, grid );
714
715 SetStatusText( line, 4 );
716}
717
718
720{
721 // Display Zoom level:
722 SetStatusText( GetZoomLevelIndicator(), 1 );
723
724 // coordinate origin can be the paper Top Left corner, or each of 4 page corners
725 VECTOR2I originCoord = ReturnCoordOriginCorner();
726 SetGridOrigin( originCoord );
727
728 // We need the orientation of axis (sign of coordinates)
729 int Xsign = 1;
730 int Ysign = 1;
731
732 switch( m_originSelectChoice )
733 {
734 default:
735 case 0: // Origin = paper Left Top corner
736 break;
737
738 case 1: // Origin = page Right Bottom corner
739 Xsign = -1;
740 Ysign = -1;
741 break;
742
743 case 2: // Origin = page Left Bottom corner
744 Ysign = -1;
745 break;
746
747 case 3: // Origin = page Right Top corner
748 Xsign = -1;
749 break;
750
751 case 4: // Origin = page Left Top corner
752 break;
753 }
754
755 // Display absolute coordinates:
757 VECTOR2D coord = cursorPos - originCoord;
758 double dXpos =
760 double dYpos =
762
763 wxString absformatter = wxT( "X %.4g Y %.4g" );
764 wxString locformatter = wxT( "dx %.4g dy %.4g" );
765
766 switch( GetUserUnits() )
767 {
768 case EDA_UNITS::INCHES: SetStatusText( _( "inches" ), 6 ); break;
769 case EDA_UNITS::MILS: SetStatusText( _( "mils" ), 6 ); break;
770 case EDA_UNITS::MILLIMETRES: SetStatusText( _( "mm" ), 6 ); break;
771 case EDA_UNITS::UNSCALED: SetStatusText( wxEmptyString, 6 ); break;
772 default: wxASSERT( false ); break;
773 }
774
775 wxString line;
776
777 // Display abs coordinates
778 line.Printf( absformatter, dXpos, dYpos );
779 SetStatusText( line, 2 );
780
781 // Display relative coordinates:
782 if( GetScreen() )
783 {
784 double dx = cursorPos.x - GetScreen()->m_LocalOrigin.x;
785 double dy = cursorPos.y - GetScreen()->m_LocalOrigin.y;
788 line.Printf( locformatter, dXpos, dYpos );
789 SetStatusText( line, 3 );
790 }
791
793
794 // Display corner reference for coord origin
795 line.Printf( _("coord origin: %s"),
796 m_originSelectBox->GetString( m_originSelectChoice ).GetData() );
797 SetStatusText( line, 5 );
798}
799
800
802{
805
806 for( DS_DATA_ITEM* dataItem : model.GetItems() )
807 {
808 // Ensure the scaling factor (used only in printing) of bitmaps is up to date
809 if( dataItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
810 {
811 BITMAP_BASE* bitmap = static_cast<DS_DATA_ITEM_BITMAP*>( dataItem )->m_ImageBitmap;
812 bitmap->SetPixelSizeIu( drawSheetIUScale.IU_PER_MILS * 1000 / bitmap->GetPPI() );
813 }
814 }
815
817 wxEmptyString );
818
820 GetCanvas()->Refresh();
821}
822
823
825{
826 return static_cast<PL_DRAW_PANEL_GAL*>( EDA_DRAW_FRAME::GetCanvas() );
827}
828
829
831{
832 return m_toolManager->GetTool<PL_SELECTION_TOOL>()->GetSelection();
833}
834
835
837{
839
841 PL_SELECTION& selection = selTool->GetSelection();
842 DS_DATA_ITEM* item = nullptr;
843
844 if( selection.GetSize() == 1 )
845 item = static_cast<DS_DRAW_ITEM_BASE*>( selection.Front() )->GetPeer();
846
850 GetCanvas()->Refresh();
851}
852
853
855{
856 DS_DATA_ITEM * item = nullptr;
857
858 switch( aType )
859 {
861 item = new DS_DATA_ITEM_TEXT( wxT( "Text") );
862 break;
863
866 break;
867
870 break;
871
873 item = new DS_DATA_ITEM_POLYGONS();
874 break;
875
877 {
878 wxFileDialog fileDlg( this, _( "Choose Image" ), m_mruImagePath, wxEmptyString,
879 _( "Image Files" ) + wxS( " " ) + wxImage::GetImageExtWildcard(),
880 wxFD_OPEN );
881
882 if( fileDlg.ShowModal() != wxID_OK )
883 return nullptr;
884
885 wxString fullFilename = fileDlg.GetPath();
886 m_mruImagePath = wxPathOnly( fullFilename );
887
888 if( !wxFileExists( fullFilename ) )
889 {
890 wxMessageBox( _( "Could not load image from '%s'." ), fullFilename );
891 break;
892 }
893
895
896 if( !image->ReadImageFile( fullFilename ) )
897 {
898 wxMessageBox( _( "Could not load image from '%s'." ), fullFilename );
899 delete image;
900 break;
901 }
902
903 // Set the scale factor for pl_editor (it is set for Eeschema by default)
904 image->SetPixelSizeIu( drawSheetIUScale.IU_PER_MILS * 1000.0 / image->GetPPI() );
905 item = new DS_DATA_ITEM_BITMAP( image );
906 }
907 break;
908 }
909
910 if( item == nullptr )
911 return nullptr;
912
914 item->SyncDrawItems( nullptr, GetCanvas()->GetView() );
915
916 return item;
917}
918
919
921{
923 GetScreen()->SetContentModified( false );
925
928
930
932
933 if( GetCurrentFileName().IsEmpty() )
934 {
935 // Default shutdown reason until a file is loaded
936 KIPLATFORM::APP::SetShutdownBlockReason( this, _( "New drawing sheet file is unsaved" ) );
937 }
938 else
939 {
940 KIPLATFORM::APP::SetShutdownBlockReason( this, _( "Drawing sheet changes are unsaved" ) );
941 }
942}
943
944
946{
947 if( aItemCount == 0 )
948 return;
949
950 UNDO_REDO_CONTAINER& list = ( whichList == UNDO_LIST ) ? m_undoList : m_redoList;
951
952 if( aItemCount < 0 )
953 {
954 list.ClearCommandList();
955 }
956 else
957 {
958 for( int ii = 0; ii < aItemCount; ii++ )
959 {
960 if( list.m_CommandsList.size() == 0 )
961 break;
962
963 PICKED_ITEMS_LIST* curr_cmd = list.m_CommandsList[0];
964 list.m_CommandsList.erase( list.m_CommandsList.begin() );
965
966 curr_cmd->ClearListAndDeleteItems( []( EDA_ITEM* aItem )
967 {
968 delete aItem;
969 } );
970 delete curr_cmd; // Delete command
971 }
972 }
973}
974
975
977{
978 return m_pageSelectBox->GetSelection() == 0;
979}
980
981#if 1
983{
985
986 std::vector<MSG_PANEL_ITEM> msgItems;
987 msgItems.emplace_back( _( "Page Width" ), MessageTextFromValue( size.x ) );
988 msgItems.emplace_back( _( "Page Height" ), MessageTextFromValue( size.y ) );
989
990 SetMsgPanel( msgItems );
991}
992#endif
993
994void PL_EDITOR_FRAME::handleActivateEvent( wxActivateEvent& aEvent )
995{
997
998 if( m_spaceMouse )
999 m_spaceMouse->SetFocus( aEvent.GetActive() );
1000}
1001
1002
1003void PL_EDITOR_FRAME::handleIconizeEvent( wxIconizeEvent& aEvent )
1004{
1006
1007 if( m_spaceMouse )
1008 m_spaceMouse->SetFocus( false );
1009}
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
Definition: arraydim.h:31
constexpr EDA_IU_SCALE drawSheetIUScale
Definition: base_units.h:109
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
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:104
@ icon_pagelayout_editor
@ icon_pagelayout_editor_16
@ icon_pagelayout_editor_32
static TOOL_ACTION toggleGrid
Definition: actions.h:187
static TOOL_ACTION paste
Definition: actions.h:73
static TOOL_ACTION millimetersUnits
Definition: actions.h:195
static TOOL_ACTION copy
Definition: actions.h:71
static TOOL_ACTION milsUnits
Definition: actions.h:194
static TOOL_ACTION undo
Definition: actions.h:68
static TOOL_ACTION inchesUnits
Definition: actions.h:193
static TOOL_ACTION toggleCursorStyle
Definition: actions.h:144
static TOOL_ACTION doDelete
Definition: actions.h:78
static TOOL_ACTION selectionTool
Definition: actions.h:202
static TOOL_ACTION save
Definition: actions.h:51
static TOOL_ACTION zoomFitScreen
Definition: actions.h:134
static TOOL_ACTION redo
Definition: actions.h:69
static TOOL_ACTION deleteTool
Definition: actions.h:79
static TOOL_ACTION zoomTool
Definition: actions.h:138
static TOOL_ACTION cut
Definition: actions.h:70
Manage TOOL_ACTION objects.
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...
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:92
WINDOW_SETTINGS m_Window
Definition: app_settings.h:194
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:197
Handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:41
bool IsContentModified() const
Definition: base_screen.h:60
void SetVirtualPageNumber(int aPageNumber)
Definition: base_screen.h:76
static wxString m_DrawingSheetFileName
the name of the drawing sheet file, or empty to use the default drawing sheet
Definition: base_screen.h:85
VECTOR2D m_LocalOrigin
Relative Screen cursor coordinate (on grid) in user units.
Definition: base_screen.h:90
void SetContentModified(bool aModified=true)
Definition: base_screen.h:59
void InitDataPoints(const VECTOR2I &aPageSizeInternalUnits)
Definition: base_screen.cpp:46
This class handle bitmap images in KiCad.
Definition: bitmap_base.h:49
void SetPixelSizeIu(double aPixSize)
Definition: bitmap_base.h:66
int GetPPI() const
Definition: bitmap_base.h:118
Color settings are a bit different than most of the settings objects in that there can be more than o...
Handle actions that are shared between different applications.
Handles action that are shared between different applications.
Definition: common_tools.h:38
Drawing sheet structure type definitions.
Definition: ds_data_item.h:96
virtual void SyncDrawItems(DS_DRAW_ITEM_LIST *aCollector, KIGFX::VIEW *aView)
Handle the graphic items list to draw/plot the frame and title block.
Definition: ds_data_model.h:39
bool LoadDrawingSheet(const wxString &aFullFileName, wxString *aMsg, bool aAppend=false)
Populates the list with a custom layout or the default layout if no custom layout is available.
static DS_DATA_MODEL & GetTheInstance()
static function: returns the instance of DS_DATA_MODEL used in the application
void Append(DS_DATA_ITEM *aItem)
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
void ClearList()
Erase the list of items.
std::vector< DS_DATA_ITEM * > & GetItems()
Base class to handle basic graphic items.
Definition: ds_draw_item.h:59
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
virtual void handleIconizeEvent(wxIconizeEvent &aEvent)
Handle a window iconize event.
UNDO_REDO_CONTAINER m_undoList
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
virtual void ClearUndoRedoList()
Clear the undo and redo list using ClearUndoORRedoList()
UNDO_REDO_LIST
Specifies whether we are interacting with the undo or redo stacks.
virtual void OnModify()
Must be called after a model change in order to set the "modify" flag and do other frame-specific pro...
UNDO_REDO_CONTAINER m_redoList
virtual void OnDropFiles(wxDropFilesEvent &aEvent)
Handles event fired when a file is dropped to the window.
The base class for create windows for drawing purpose.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
const wxString GetZoomLevelIndicator() const
Return a human readable value for display in dialogs.
GAL_DISPLAY_OPTIONS_IMPL & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
void RecreateToolbars()
Rebuild all toolbars, and update the checked state of check tools.
virtual void handleActivateEvent(wxActivateEvent &aEvent)
Handle a window activation event.
virtual void SetDrawBgColor(const COLOR4D &aColor)
void PrintDrawingSheet(const RENDER_SETTINGS *aSettings, BASE_SCREEN *aScreen, const std::map< wxString, wxString > *aProperties, double aMils2Iu, const wxString &aFilename, const wxString &aSheetLayer=wxEmptyString)
Prints the drawing-sheet (frame and title block).
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual COLOR4D GetDrawBgColor() const
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
GAL_TYPE GetBackend() const
Return the type of backend currently used by GAL canvas.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the #VIEW_CONTROLS instance used in the panel.
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
void ForceRefresh()
Force a redraw.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
@ GAL_TYPE_NONE
GAL not used (the legacy wxDC engine is used)
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Set a dispatcher that processes events and forwards them to tools.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:89
Specialization of the wxAuiPaneInfo class for KiCad panels.
Class that groups generic conditions for editor states.
SELECTION_CONDITION NoActiveTool()
Create a functor testing if there are no tools active in the frame.
SELECTION_CONDITION RedoAvailable()
Create a functor that tests if there are any items in the redo queue.
SELECTION_CONDITION CurrentTool(const TOOL_ACTION &aTool)
Create a functor testing if the specified tool is the current active tool in the frame.
virtual SELECTION_CONDITION UndoAvailable()
Create a functor that tests if there are any items in the undo queue.
SELECTION_CONDITION Units(EDA_UNITS aUnit)
Create a functor that tests if the frame has the specified units.
SELECTION_CONDITION GridVisible()
Create a functor testing if the grid is visible in a frame.
SELECTION_CONDITION FullscreenCursor()
Create a functor testing if the cursor is full screen in a frame.
void ReadWindowSettings(WINDOW_SETTINGS &aCfg)
Read GAL config options from application-level config.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
Definition: view.h:397
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition: view.cpp:1545
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:217
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:285
void OnKiCadExit()
Definition: kiway.cpp:725
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:59
static void SetCustomWidthMils(double aWidthInMils)
Set the width of Custom page in mils for any custom page constructed or made via SetType() after maki...
Definition: page_info.cpp:233
wxPrintOrientation GetWxOrientation() const
Definition: page_info.h:127
static double GetCustomHeightMils()
Definition: page_info.h:196
const VECTOR2D GetSizeIU(double aIUScale) const
Gets the page size in internal units.
Definition: page_info.h:171
double GetHeightMils() const
Definition: page_info.h:141
wxPaperSize GetPaperId() const
Definition: page_info.h:132
const wxString & GetType() const
Definition: page_info.h:99
double GetWidthMils() const
Definition: page_info.h:136
bool IsCustom() const
Definition: page_info.cpp:181
bool IsPortrait() const
Definition: page_info.h:122
static double GetCustomWidthMils()
Definition: page_info.h:191
static void SetCustomHeightMils(double aHeightInMils)
Set the height of Custom page in mils for any custom page constructed or made via SetType() after mak...
Definition: page_info.cpp:239
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:120
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:142
A holder to handle information on schematic or board items.
void ClearListAndDeleteItems(std::function< void(EDA_ITEM *)> aItemDeleter)
Delete the list of pickers AND the data pointed by #m_PickedItem or #m_PickedItemLink according to th...
Gather all the actions that are shared by tools.
Definition: pl_actions.h:36
static TOOL_ACTION placeImage
Definition: pl_actions.h:59
static TOOL_ACTION drawRectangle
Definition: pl_actions.h:60
static TOOL_ACTION layoutNormalMode
Definition: pl_actions.h:67
static TOOL_ACTION placeText
Definition: pl_actions.h:58
static TOOL_ACTION layoutEditMode
Definition: pl_actions.h:68
static TOOL_ACTION appendImportedDrawingSheet
Definition: pl_actions.h:62
static TOOL_ACTION drawLine
Definition: pl_actions.h:61
Tool responsible for drawing/placing items (lines, rectangles, text, etc.)
void DisplayDrawingSheet()
Build and update the list of WS_DRAW_ITEM_xxx showing the frame layout.
Handle actions specific to the drawing sheet editor.
The main window used in the drawing sheet editor.
bool OpenProjectFiles(const std::vector< wxString > &aFileSet, int aCtl) override
Open a project or set of files given by aFileList.
void OnNewDrawingSheet()
Must be called to initialize parameters when a new drawing sheet is loaded.
std::unique_ptr< NL_PL_EDITOR_PLUGIN > m_spaceMouse
void OnModify() override
Must be called after a change in order to set the "modify" flag.
void SetCurrentFileName(const wxString &aName)
Store the current layout description file filename.
bool IsContentModified() const override
Get if the drawing sheet has been modified but not saved.
void Files_io(wxCommandEvent &event)
void ToPrinter(bool doPreview)
Open a dialog frame to print layers.
void UpdateMsgPanelInfo()
Display the size of the sheet to the message panel.
const BOX2I GetDocumentExtents(bool aIncludeAllVisible=true) const override
Returns bbox of document with option to not include some items.
wxString m_mruImagePath
void doCloseWindow() override
VECTOR2I ReturnCoordOriginCorner() const
Calculate the position (in page, in iu) of the corner used as coordinate origin of items.
void OnClearFileHistory(wxCommandEvent &aEvent)
void SetPageSettings(const PAGE_INFO &) override
DS_DATA_ITEM * AddDrawingSheetItem(int aType)
Add a new item to the drawing sheet item list.
wxString GetCurrentFileName() const override
bool canCloseWindow(wxCloseEvent &aCloseEvent) override
void OnFileHistory(wxCommandEvent &event)
void UpdateStatusBar() override
Update the status bar information.
void SetGridOrigin(const VECTOR2I &aPoint) override
void OnSelectPage(wxCommandEvent &event)
const TITLE_BLOCK & GetTitleBlock() const override
void UpdateTitleAndInfo()
Display the short filename (if exists) loaded file on the caption of the main window.
const VECTOR2I GetPageSizeIU() const override
Works off of GetPageSettings() to return the size of the paper page in the internal units of this par...
virtual void PrintPage(const RENDER_SETTINGS *aSettings) override
Print a page.
void OnSelectCoordOriginCorner(wxCommandEvent &event)
Called when the user select one of the 4 page corner as corner reference (or the left top paper corne...
void handleActivateEvent(wxActivateEvent &aEvent) override
Handle a window activation event.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
PL_EDITOR_LAYOUT m_pageLayout
bool GetPageNumberOption() const
Drawing sheet editor can show the title block using a page number 1 or another number.
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
void handleIconizeEvent(wxIconizeEvent &aEvent) override
Handle a window iconize event.
void HardRedraw() override
Refresh the library tree and redraw the window.
void DisplayGridMsg() override
Display current grid size in the status bar.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
wxChoice * m_originSelectBox
const PAGE_INFO & GetPageSettings() const override
const PL_EDITOR_LAYOUT & GetPageLayout() const
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
PROPERTIES_FRAME * m_propertiesPagelayout
The last filename chosen to be proposed to the user.
wxChoice * m_pageSelectBox
PL_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw 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...
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock) override
void OnExit(wxCommandEvent &aEvent)
Event handler for the wxID_EXIT and wxID_CLOSE events.
bool LoadDrawingSheetFile(const wxString &aFullFileName)
Load a .kicad_wks drawing sheet file.
void SetPageSettings(const PAGE_INFO &aPageSettings)
TITLE_BLOCK & GetTitleBlock()
PAGE_INFO & GetPageSettings()
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Tool that displays edit points allowing to modify items by dragging the points.
PL_SELECTION & GetSelection()
Return the set of currently selected items.
PROPERTIES_FRAME display properties of the current item.
void CopyPrmsFromItemToPanel(DS_DATA_ITEM *aItem)
static bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
static bool Idle(const SELECTION &aSelection)
Test if there no items selected or being edited.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
static bool ShowNever(const SELECTION &aSelection)
Always returns false.
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
T * GetAppSettings(const wxString &aFilename)
Returns a handle to the a given settings by type If the settings have already been loaded,...
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:41
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:167
TOOL_DISPATCHER * m_toolDispatcher
Definition: tools_holder.h:169
ACTIONS * m_actions
Definition: tools_holder.h:168
Master controller class:
Definition: tool_manager.h:62
bool RunAction(const std::string &aActionName, T aParam)
Run the specified action immediately, pausing the current action to run the new one.
Definition: tool_manager.h:150
bool InvokeTool(TOOL_ID aToolId)
Call a tool by sending a tool activation event to tool of given ID.
ACTION_MANAGER * GetActionManager() const
Definition: tool_manager.h:302
void RegisterTool(TOOL_BASE *aTool)
Add a tool to the manager set and sets it up.
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).
void InitTools()
Initializes all registered tools.
void ShutdownAllTools()
Shutdown all tools with a currently registered event loop in this tool manager by waking them up with...
A holder to handle a list of undo (or redo) commands.
std::vector< PICKED_ITEMS_LIST * > m_CommandsList
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
EDA_UNITS GetUserUnits() const
@ WHITE
Definition: color4d.h:48
@ BLACK
Definition: color4d.h:44
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:130
This file is part of the common library.
#define CHECK(x)
#define ENABLE(x)
#define _HKI(x)
int InvokeDialogPrintPreview(PL_EDITOR_FRAME *aCaller, wxPrintData *aPrintData)
Create and show a print preview dialog returns 1 if OK, 0 , there is a problem.
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.
@ RB_CORNER
Definition: ds_data_item.h:49
@ RT_CORNER
Definition: ds_data_item.h:50
@ LT_CORNER
Definition: ds_data_item.h:52
@ LB_CORNER
Definition: ds_data_item.h:51
#define _(s)
#define KICAD_DEFAULT_DRAWFRAME_STYLE
#define PL_EDITOR_FRAME_NAME
EVT_MENU_RANGE(ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILEMAX, GERBVIEW_FRAME::OnDrlFileHistory) EVT_MENU_RANGE(ID_GERBVIEW_ZIP_FILE1
@ FRAME_PL_EDITOR
Definition: frame_type.h:59
static const std::string DrawingSheetFileExtension
@ ID_FILE_LIST_CLEAR
Definition: id.h:86
@ ID_FILEMAX
Definition: id.h:84
@ ID_FILE1
Definition: id.h:83
@ LAYER_DRAWINGSHEET_PAGEn
for drawingsheetEditor previewing
Definition: layer_ids.h:251
@ LAYER_DRAWINGSHEET_PAGE1
for drawingsheetEditor previewing
Definition: layer_ids.h:250
KICOMMON_API double ToUserUnit(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnit, double aValue)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
Definition: eda_units.cpp:259
KICOMMON_API int Mils2mm(double aVal)
Convert mils to mm.
Definition: eda_units.cpp:82
@ COLOR
Color has changed.
Definition: view_item.h:53
void SetShutdownBlockReason(wxWindow *aWindow, const wxString &aReason)
Sets the block reason why the window/application is preventing OS shutdown.
Definition: unix/app.cpp:90
bool SupportsShutdownBlockReason()
Whether or not the window supports setting a shutdown block reason.
Definition: unix/app.cpp:79
KICOMMON_API 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:77
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: pgm_base.cpp:1060
see class PGM_BASE
@ ID_SELECT_PAGE_NUMBER
Definition: pl_editor_id.h:39
@ ID_SELECT_COORDINATE_ORIGIN
Definition: pl_editor_id.h:38
KIWAY Kiway(KFCTL_STANDALONE)
std::vector< FAB_LAYER_COLOR > dummy
const double IU_PER_MILS
Definition: base_units.h:77
std::vector< GRID > grids
Definition: grid_settings.h:66
Common grid settings, available to every frame.
Definition: grid_settings.h:34
GRID_SETTINGS grid
Definition: app_settings.h:81
std::vector< double > zoom_factors
Definition: app_settings.h:78
VECTOR2< int32_t > VECTOR2I
Definition: vector2d.h:691
Definition of file extensions used in Kicad.
#define ZOOM_LIST_PL_EDITOR
Definition: zoom_defines.h:38