KiCad PCB EDA Suite
draw_frame.h
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) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
5  * Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
6  * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #ifndef DRAW_FRAME_H_
27 #define DRAW_FRAME_H_
28 
29 #include <eda_base_frame.h>
30 #include <kiway_player.h>
31 #include <climits>
33 #include <gal/color4d.h>
34 #include <class_draw_panel_gal.h>
35 #include "hotkeys_basic.h"
36 
37 class wxSingleInstanceChecker;
38 class EDA_HOTKEY;
39 
40 using KIGFX::COLOR4D;
41 
42 namespace KIGFX
43 {
44  class GAL_DISPLAY_OPTIONS;
45 }
46 
47 #define DEFAULT_MAX_UNDO_ITEMS 0
48 #define ABS_MAX_UNDO_ITEMS (INT_MAX / 2)
49 #define LIB_EDIT_FRAME_NAME wxT( "LibeditFrame" )
50 #define SCH_EDIT_FRAME_NAME wxT( "SchematicFrame" )
51 #define PL_EDITOR_FRAME_NAME wxT( "PlEditorFrame" )
52 #define FOOTPRINT_WIZARD_FRAME_NAME wxT( "FootprintWizard" )
53 #define FOOTPRINT_EDIT_FRAME_NAME wxT( "ModEditFrame" )
54 #define FOOTPRINT_VIEWER_FRAME_NAME wxT( "ModViewFrame" )
55 #define FOOTPRINT_VIEWER_FRAME_NAME_MODAL wxT( "ModViewFrameModal" )
56 #define PCB_EDIT_FRAME_NAME wxT( "PcbFrame" )
57 
58 
61 
63 static const wxString UserUnitsEntryKeyword( wxT( "Units" ) );
65 static const wxString ShowGridEntryKeyword( wxT( "ShowGrid" ) );
67 static const wxString GridColorEntryKeyword( wxT( "GridColor" ) );
69 static const wxString LastGridSizeIdKeyword( wxT( "_LastGridSize" ) );
70 
72 
73 
79 {
82  friend class EDA_DRAW_PANEL;
83 
85  int m_toolId;
86 
88 
89  bool m_snapToGrid;
90 
92 
95 
96 protected:
99 
100  wxSocketServer* m_socketServer;
101  std::vector<wxSocketBase*> m_sockets;
102 
103  std::unique_ptr<wxSingleInstanceChecker> m_file_checker;
104 
106 
107  int m_LastGridSizeId; // the command id offset (>= 0) of the last selected grid
108  // 0 is for the grid corresponding to
109  // a wxCommand ID = ID_POPUP_GRID_LEVEL_1000.
110  bool m_drawGrid; // hide/Show grid
114  double m_zoomLevelCoeff;
116  // to a zoom level value which rougly gives 1.0 when the board/schematic
117  // is at scale = 1
119  // to screens
121 
124 
128 
131 
134 
137 
141 
144 
147 
148  wxComboBox* m_gridSelectBox;
149  wxComboBox* m_zoomSelectBox;
150 
153  wxAuiToolBar* m_auxiliaryToolBar;
154 
157  wxAuiToolBar* m_drawToolBar;
158 
160  wxAuiToolBar* m_optionsToolBar;
161 
164 
166 
167 #ifdef USE_WX_OVERLAY
168  // MAC Uses overlay to workaround the wxINVERT and wxXOR miss
169  wxOverlay m_overlay;
170 #endif
171 
174 
177 
178  virtual void SetScreen( BASE_SCREEN* aScreen ) { m_currentScreen = aScreen; }
179 
180  double bestZoom( double sizeX, double sizeY, double scaleFactor, wxPoint centre );
181 
188  virtual void unitsChangeRefresh();
189 
190  void CommonSettingsChanged() override;
191 
201  bool LibraryFileBrowser( bool doOpen, wxFileName& aFilename,
202  const wxString& wildcard, const wxString& ext, bool isDirectory );
203 
213  bool GeneralControlKeyMovement( int aHotKey, wxPoint *aPos, bool aSnapToGrid );
214 
218  void RefreshCrossHair( const wxPoint &aOldPos, const wxPoint &aEvtPos, wxDC* aDC );
219 
223  bool isBusy() const;
224 
228  bool saveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType );
229 
230  bool saveCanvasImageToFile( const wxString& aFileName,
231  wxBitmapType aBitmapType = wxBITMAP_TYPE_PNG );
232 
234  static const wxChar CANVAS_TYPE_KEY[];
235 
236 public:
237  EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent,
238  FRAME_T aFrameType,
239  const wxString& aTitle,
240  const wxPoint& aPos, const wxSize& aSize,
241  long aStyle,
242  const wxString& aFrameName );
243 
244  ~EDA_DRAW_FRAME();
245 
254  virtual void OnCharHook( wxKeyEvent& event );
255 
262  bool LockFile( const wxString& aFileName );
263 
267  void ReleaseFile();
268 
269  virtual void SetPageSettings( const PAGE_INFO& aPageSettings ) = 0;
270  virtual const PAGE_INFO& GetPageSettings() const = 0;
271 
276  virtual const wxSize GetPageSizeIU() const = 0;
277 
281  EDA_UNITS_T GetUserUnits() const override { return m_UserUnits; }
282  void SetUserUnits( EDA_UNITS_T aUnits ) { m_UserUnits = aUnits; }
283 
287  virtual const wxPoint& GetAuxOrigin() const = 0;
288  virtual void SetAuxOrigin( const wxPoint& aPosition ) = 0;
289 
295  virtual const wxPoint& GetGridOrigin() const = 0;
296  virtual void SetGridOrigin( const wxPoint& aPosition ) = 0;
297 
298  int GetLastGridSizeId() const { return m_LastGridSizeId; }
299  void SetLastGridSizeId( int aId ) { m_LastGridSizeId = aId; }
300 
301  //-----<BASE_SCREEN API moved here>------------------------------------------
308  wxPoint GetCrossHairPosition( bool aInvertY = false ) const;
309 
317  void SetCrossHairPosition( const wxPoint& aPosition, bool aSnapToGrid = true );
318 
327  wxPoint GetCursorPosition( bool aOnGrid, wxRealPoint* aGridSize = NULL ) const;
328 
337  wxPoint GetNearestGridPosition( const wxPoint& aPosition, wxRealPoint* aGridSize = NULL ) const;
338 
344  wxPoint GetCrossHairScreenPosition() const;
345 
346  void SetMousePosition( const wxPoint& aPosition );
347 
357  wxPoint RefPos( bool useMouse ) const;
358 
359  const wxPoint& GetScrollCenterPosition() const;
360  void SetScrollCenterPosition( const wxPoint& aPoint );
361 
362  //-----</BASE_SCREEN API moved here>-----------------------------------------
363 
364  virtual const TITLE_BLOCK& GetTitleBlock() const = 0;
365  virtual void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) = 0;
366 
367  // the background color of the draw canvas:
368  // Virtual because some frames can have a specific way to get/set the bg color
372  virtual COLOR4D GetDrawBgColor() const { return m_drawBgColor; }
373 
377  virtual void SetDrawBgColor( COLOR4D aColor) { m_drawBgColor= aColor ; }
378 
379  bool GetShowBorderAndTitleBlock() const { return m_showBorderAndTitleBlock; }
380 
381  void SetShowBorderAndTitleBlock( bool aShow ) { m_showBorderAndTitleBlock = aShow; }
382  bool ShowPageLimits() const { return m_showPageLimits; }
383  void SetShowPageLimits( bool aShow ) { m_showPageLimits = aShow; }
384 
385  virtual EDA_DRAW_PANEL* GetCanvas() const { return m_canvas; }
386 
387  virtual wxString GetScreenDesc() const;
388 
394  virtual BASE_SCREEN* GetScreen() const { return m_currentScreen; }
395 
405  virtual void ExecuteRemoteCommand( const char* cmdline ){}
406 
407  void OnMenuOpen( wxMenuEvent& event );
408  void OnMouseEvent( wxMouseEvent& event );
409 
420  void SkipNextLeftButtonReleaseEvent();
421 
423  int WriteHotkeyConfig( struct EDA_HOTKEY_CONFIG* aDescList, wxString* aFullFileName = NULL ) override;
424 
428  EDA_HOTKEY_CONFIG* GetHotkeyConfig() const { return m_hotkeysDescrList; }
429 
436  virtual EDA_HOTKEY* GetHotKeyDescription( int aCommand ) const = 0;
437 
438  virtual bool OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
439  EDA_ITEM* aItem = NULL );
440 
446  virtual void AddMenuZoomAndGrid( wxMenu* aMasterMenu );
447 
456  virtual const wxString GetZoomLevelIndicator() const;
457 
461  inline double GetZoomLevelCoeff() const { return m_zoomLevelCoeff; }
462 
463  void EraseMsgBox();
464  void Process_PageSettings( wxCommandEvent& event );
465 
466  virtual void ReCreateHToolbar() = 0;
467  virtual void ReCreateVToolbar() = 0;
468  virtual void ReCreateMenuBar() override;
469  virtual void ReCreateAuxiliaryToolbar();
470 
471  // Toolbar accessors
472  wxAuiToolBar* GetMainToolBar() const { return m_mainToolBar; }
473  wxAuiToolBar* GetOptionsToolBar() const { return m_optionsToolBar; }
474  wxAuiToolBar* GetDrawToolBar() const { return m_drawToolBar; }
475  wxAuiToolBar* GetAuxiliaryToolBar() const { return m_auxiliaryToolBar; }
476 
483  bool GetToolToggled( int aToolId );
484 
489  wxAuiToolBarItem* GetToolbarTool( int aToolId );
490 
504  virtual void SetToolID( int aId, int aCursor, const wxString& aToolMsg );
505 
509  virtual void SetNoToolSelected();
510 
516  int GetToolId() const { return m_toolId; }
517 
518  /* These 4 functions provide a basic way to show/hide grid
519  * and /get/set grid color.
520  * These parameters are saved in KiCad config for each main frame
521  */
525  virtual bool IsGridVisible() const
526  {
527  return m_drawGrid;
528  }
529 
534  virtual void SetGridVisibility( bool aVisible )
535  {
536  m_drawGrid = aVisible;
537  }
538 
543  {
544  return m_gridColor;
545  }
546 
550  virtual void SetGridColor( COLOR4D aColor )
551  {
552  m_gridColor = aColor;
553  }
554 
563  wxPoint GetGridPosition( const wxPoint& aPosition ) const;
564 
568  virtual void SetNextGrid();
569 
573  virtual void SetPrevGrid();
574 
580  void SetPresetGrid( int aIndex );
581 
592  virtual void OnSelectGrid( wxCommandEvent& event );
593 
594  virtual void OnGridSettings( wxCommandEvent& event ) { };
595 
603  virtual void OnSelectZoom( wxCommandEvent& event );
604 
605  // Command event handlers shared by all applications derived from EDA_DRAW_FRAME.
606  void OnToggleGridState( wxCommandEvent& aEvent );
607  void OnSelectUnits( wxCommandEvent& aEvent );
608  void OnToggleCrossHairStyle( wxCommandEvent& aEvent );
609 
610  // Update user interface event handlers shared by all applications derived from
611  // EDA_DRAW_FRAME.
612  void OnUpdateUndo( wxUpdateUIEvent& aEvent );
613  void OnUpdateRedo( wxUpdateUIEvent& aEvent );
614  void OnUpdateGrid( wxUpdateUIEvent& aEvent );
615  void OnUpdateSelectGrid( wxUpdateUIEvent& aEvent );
616  void OnUpdateUnits( wxUpdateUIEvent& aEvent );
617  void OnUpdateCrossHairStyle( wxUpdateUIEvent& aEvent );
618 
630  virtual bool GeneralControl( wxDC* aDC, const wxPoint& aPosition, EDA_KEY aHotKey = 0 )
631  {
632  return false;
633  }
634 
638  virtual void OnSize( wxSizeEvent& event );
639 
640  void OnEraseBackground( wxEraseEvent& SizeEvent );
641 
642  virtual void OnZoom( wxCommandEvent& event );
643 
647  void SetNextZoom();
648 
656  void SetNextZoomAndRedraw( const wxPoint& aCenterPoint, bool aWarpPointer );
657 
661  void SetPrevZoom();
662 
670  void SetPreviousZoomAndRedraw( const wxPoint& aCenterPoint, bool aWarpPointer );
671 
677  void SetPresetZoom( int aIndex );
678 
686  virtual void RedrawScreen( const wxPoint& aCenterPoint, bool aWarpPointer );
687 
693  virtual void RedrawScreen2( const wxPoint& posBefore );
694 
698  virtual void HardRedraw();
699 
704  virtual void Zoom_Automatique( bool aWarpPointer );
705 
706  /* Set the zoom level to show the area Rect */
707  virtual void Window_Zoom( EDA_RECT& Rect );
708 
710  virtual double BestZoom() = 0;
711 
720  void FocusOnLocation( const wxPoint& aPos, bool aWarpCursor = true, bool aCenterView = false );
721 
725  double GetZoom();
726 
737  void DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth,
738  double aScale, const wxString &aFilename,
739  const wxString &aSheetLayer = wxEmptyString );
740 
741  void DisplayToolMsg( const wxString& msg );
742  virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0;
743  virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
744  virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
745  virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
746  virtual void ToolOnRightClick( wxCommandEvent& event );
747  void AdjustScrollBars( const wxPoint& aCenterPosition );
748 
754  virtual void OnPageSettingsChange() {};
755 
762  virtual void OnActivate( wxActivateEvent& event );
763 
776  virtual void UpdateStatusBar();
777 
781  void DisplayUnitsMsg();
782 
783  /* Handlers for block commands */
784  virtual void InitBlockPasteInfos();
785 
795  virtual bool HandleBlockBegin( wxDC* aDC, EDA_KEY aKey, const wxPoint& aPosition,
796  int aExplicitCommand = 0 );
797 
806  virtual int BlockCommand( EDA_KEY aKey );
807 
814  virtual void HandleBlockPlace( wxDC* DC );
815 
825  virtual bool HandleBlockEnd( wxDC* DC );
826 
830  void CopyToClipboard( wxCommandEvent& event );
831 
832  /* interprocess communication */
833  void CreateServer( int service, bool local = true );
834  void OnSockRequest( wxSocketEvent& evt );
835  void OnSockRequestServer( wxSocketEvent& evt );
836 
837  void LoadSettings( wxConfigBase* aCfg ) override;
838 
839  void SaveSettings( wxConfigBase* aCfg ) override;
840 
853  void AppendMsgPanel( const wxString& textUpper, const wxString& textLower,
854  COLOR4D color, int pad = 6 );
855 
859  void ClearMsgPanel( void );
860 
866  void SetMsgPanel( const std::vector< MSG_PANEL_ITEM >& aList );
867 
868  void SetMsgPanel( EDA_ITEM* aItem );
869 
873  virtual void UpdateMsgPanel();
874 
881  void PushPreferences( const EDA_DRAW_PANEL* aParentCanvas );
882 
891  virtual void PrintPage( wxDC* aDC, LSET aPrintMask, bool aPrintMirrorMode, void* aData = NULL );
892 
896  static EDA_DRAW_PANEL_GAL::GAL_TYPE LoadCanvasTypeSetting();
897 
903  virtual void UseGalCanvas( bool aEnable );
904 
910  virtual bool SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType );
911 
918  bool IsGalCanvasActive() const { return m_galCanvasActive; }
919 
925  EDA_DRAW_PANEL_GAL* GetGalCanvas() const { return m_galCanvas; }
926  void SetGalCanvas( EDA_DRAW_PANEL_GAL* aPanel ) { m_galCanvas = aPanel; }
927 
931  TOOL_MANAGER* GetToolManager() const { return m_toolManager; }
932 
938  virtual void* GetDisplayOptions() { return NULL; }
939 
943  KIGFX::GAL_DISPLAY_OPTIONS& GetGalDisplayOptions() { return m_galDisplayOptions; }
944 
949  virtual void SyncMenusAndToolbars( wxEvent& aEvent ) {};
950 
951  bool GetShowAxis() const { return m_showAxis; }
952  bool GetShowGridAxis() const { return m_showGridAxis; }
953  bool GetShowOriginAxis() const { return m_showOriginAxis; }
954 
955  virtual const BOX2I GetDocumentExtents() const;
956 
957  DECLARE_EVENT_TABLE()
958 };
959 
960 #endif // DRAW_FRAME_H_
bool ShowPageLimits() const
Definition: draw_frame.h:382
TOOL_MANAGER * m_toolManager
Definition: draw_frame.h:125
wxAuiToolBar * GetDrawToolBar() const
Definition: draw_frame.h:474
Class KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a porti...
Definition: kiway_player.h:120
Structure EDA_HOTKEY_CONFIG contains the information required to save hot key information to a config...
Definition: hotkeys_basic.h:94
bool m_galCanvasActive
whether to use new GAL engine
Definition: draw_frame.h:97
wxAuiToolBar * GetMainToolBar() const
Definition: draw_frame.h:472
virtual EDA_DRAW_PANEL * GetCanvas() const
Definition: draw_frame.h:385
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
Definition: draw_frame.h:943
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:57
bool m_showAxis
True shows the X and Y axis indicators.
Definition: draw_frame.h:133
TOOL_DISPATCHER * m_toolDispatcher
Definition: draw_frame.h:126
virtual void SetScreen(BASE_SCREEN *aScreen)
Definition: draw_frame.h:178
FRAME_T
Enum FRAME_T is the set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:34
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType
The current canvas type.
Definition: draw_frame.h:176
virtual void OnGridSettings(wxCommandEvent &event)
Definition: draw_frame.h:594
int color
Definition: DXF_plotter.cpp:62
virtual void SyncMenusAndToolbars(wxEvent &aEvent)
Update the toolbars and menus (mostly settings/check buttons/checkboxes) with the current controller ...
Definition: draw_frame.h:949
std::vector< wxSocketBase * > m_sockets
interprocess communication
Definition: draw_frame.h:101
virtual void SetDrawBgColor(COLOR4D aColor)
Definition: draw_frame.h:377
EDA_HOTKEY_CONFIG * GetHotkeyConfig() const
Return a structure containing currently used hotkey mapping.
Definition: draw_frame.h:428
int GetLastGridSizeId() const
Definition: draw_frame.h:298
bool GetShowBorderAndTitleBlock() const
Definition: draw_frame.h:379
void SetGalCanvas(EDA_DRAW_PANEL_GAL *aPanel)
Definition: draw_frame.h:926
virtual void SetGridColor(COLOR4D aColor)
Definition: draw_frame.h:550
class EDA_MSG_PANEL is a panel to display various information messages.
Definition: msgpanel.h:111
The base class for create windows for drawing purpose.
Definition: draw_frame.h:78
bool m_useSingleCanvasPane
Definition: draw_frame.h:98
COLOR4D m_drawBgColor
the background color of the draw canvas BLACK for Pcbnew, BLACK or WHITE for eeschema ...
Definition: draw_frame.h:113
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:40
wxComboBox * m_zoomSelectBox
Definition: draw_frame.h:149
COLOR4D m_gridColor
Grid color.
Definition: draw_frame.h:112
std::unique_ptr< wxSingleInstanceChecker > m_file_checker
prevents opening same file multiple times.
Definition: draw_frame.h:103
double GetZoomLevelCoeff() const
Return the coefficient to convert internal display scale factor to zoom level.
Definition: draw_frame.h:461
void OnMouseEvent(wxMouseEvent &event)
virtual bool IsGridVisible() const
Definition: draw_frame.h:525
virtual void ExecuteRemoteCommand(const char *cmdline)
Execute a remote command send via a socket to the application, port KICAD_PCB_PORT_SERVICE_NUMBER (cu...
Definition: draw_frame.h:405
wxAuiToolBar * GetOptionsToolBar() const
Definition: draw_frame.h:473
Class TOOL_MANAGER.
Definition: tool_manager.h:49
bool m_showOriginAxis
True shows the origin axis used to indicate the coordinate offset for drill, gerber, and component position files.
Definition: draw_frame.h:140
wxAuiToolBar * m_auxiliaryToolBar
Auxiliary tool bar typically shown below the main tool bar at the top of the main window...
Definition: draw_frame.h:153
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:394
Class LSET is a set of PCB_LAYER_IDs.
wxAuiToolBar * m_optionsToolBar
The options tool bar typcially located on the left edge of the main window.
Definition: draw_frame.h:160
BASE_SCREEN * m_currentScreen
current used SCREEN
Definition: draw_frame.h:87
virtual COLOR4D GetDrawBgColor() const
Definition: draw_frame.h:372
EDA_HOTKEY_CONFIG * m_hotkeysDescrList
Definition: draw_frame.h:105
void OnEraseBackground(wxEraseEvent &event)
wxComboBox * m_gridSelectBox
Definition: draw_frame.h:148
EDA_MSG_PANEL * m_messagePanel
Panel used to display information at the bottom of the main window.
Definition: draw_frame.h:163
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:54
bool m_showBorderAndTitleBlock
True shows the drawing border and title block.
Definition: draw_frame.h:143
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
EDA_UNITS_T GetUserUnits() const override
Return the user units currently in use.
Definition: draw_frame.h:281
std::unique_ptr< wxSingleInstanceChecker > LockFile(const wxString &aFileName)
Function LockFile tests to see if aFileName can be locked (is not already locked) and only then retur...
Definition: lockfile.cpp:32
static const wxString ShowGridEntryKeyword(wxT("ShowGrid"))
Nonzero to show grid (suffix)
Base window classes and related definitions.
bool GetShowAxis() const
Definition: draw_frame.h:951
bool m_showGridAxis
True shows the grid axis indicators.
Definition: draw_frame.h:136
Class KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within...
Definition: kiway.h:258
uint32_t EDA_KEY
Definition: common.h:74
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:918
static const wxString UserUnitsEntryKeyword(wxT("Units"))
User units.
wxAuiToolBar * GetAuxiliaryToolBar() const
Definition: draw_frame.h:475
int m_UndoRedoCountMax
default Undo/Redo command Max depth, to be handed
Definition: draw_frame.h:118
int m_LastGridSizeId
Definition: draw_frame.h:107
virtual COLOR4D GetGridColor()
Definition: draw_frame.h:542
wxAuiToolBar * m_drawToolBar
The tool bar that contains the buttons for quick access to the application draw tools.
Definition: draw_frame.h:157
Class TOOL_DISPATCHER.
EDA_DRAW_PANEL_GAL * m_galCanvas
GAL display options - this is the frame&#39;s interface to setting GAL display options.
Definition: draw_frame.h:91
wxSocketServer * m_socketServer
Definition: draw_frame.h:100
static const wxString LastGridSizeIdKeyword(wxT("_LastGridSize"))
Most recently used grid size (suffix)
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:123
TOOL_MANAGER * GetToolManager() const
Return the tool manager instance, if any.
Definition: draw_frame.h:931
virtual void OnPageSettingsChange()
Called when modifying the page settings.
Definition: draw_frame.h:754
bool GetShowGridAxis() const
Definition: draw_frame.h:952
bool GetShowOriginAxis() const
Definition: draw_frame.h:953
class EDA_HOTKEY is a class to handle hot key commands.
Definition: hotkeys_basic.h:59
void OnCharHook(wxKeyEvent &event)
int m_MsgFrameHeight
Definition: draw_frame.h:165
void OnActivate(wxActivateEvent &event)
Function OnActivate handles window activation events.
KIGFX::GAL_DISPLAY_OPTIONS m_galDisplayOptions
Definition: draw_frame.h:94
int GetToolId() const
Definition: draw_frame.h:516
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
void SetLastGridSizeId(int aId)
Definition: draw_frame.h:299
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
bool m_showPageLimits
true to display the page limits
Definition: draw_frame.h:111
bool OnRightClick(wxMouseEvent &event)
Function OnRightClick builds and displays a context menu on a right mouse button click.
Class ACTIONS.
Definition: actions.h:41
virtual bool GeneralControl(wxDC *aDC, const wxPoint &aPosition, EDA_KEY aHotKey=0)
Perform application specific control using aDC at aPosition in logical units.
Definition: draw_frame.h:630
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:925
virtual void SetGridVisibility(bool aVisible)
It may be overloaded by derived classes.
Definition: draw_frame.h:534
Some functions to handle hotkeys in KiCad.
static const wxString GridColorEntryKeyword(wxT("GridColor"))
Grid color ID (suffix)
void SetShowPageLimits(bool aShow)
Definition: draw_frame.h:383
EDA_UNITS_T m_UserUnits
Definition: draw_frame.h:120
ACTIONS * m_actions
Definition: draw_frame.h:127
bool m_movingCursorWithKeyboard
One-shot to avoid a recursive mouse event during hotkey movement.
Definition: draw_frame.h:173
int m_lastDrawToolId
Tool ID of previously active draw tool bar button.
Definition: draw_frame.h:130
void SetShowBorderAndTitleBlock(bool aShow)
Definition: draw_frame.h:381
EDA_UNITS_T
Definition: common.h:160
virtual void * GetDisplayOptions()
A way to pass info to draw functions.
Definition: draw_frame.h:938
long m_firstRunDialogSetting
Key to control whether first run dialog is shown on startup.
Definition: draw_frame.h:146
void SetUserUnits(EDA_UNITS_T aUnits)
Definition: draw_frame.h:282
bool m_snapToGrid
Indicates if cursor should be snapped to grid.
Definition: draw_frame.h:89
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39