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  wxChoice* m_gridSelectBox;
149  wxChoice* 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 
180 
181  virtual void SetScreen( BASE_SCREEN* aScreen ) { m_currentScreen = aScreen; }
182 
183  double bestZoom( double sizeX, double sizeY, double scaleFactor, wxPoint centre );
184 
191  virtual void unitsChangeRefresh();
192 
193  void CommonSettingsChanged() override;
194 
204  bool LibraryFileBrowser( bool doOpen, wxFileName& aFilename,
205  const wxString& wildcard, const wxString& ext, bool isDirectory );
206 
216  bool GeneralControlKeyMovement( int aHotKey, wxPoint *aPos, bool aSnapToGrid );
217 
221  void RefreshCrossHair( const wxPoint &aOldPos, const wxPoint &aEvtPos, wxDC* aDC );
222 
226  bool isBusy() const;
227 
231  bool saveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType );
232 
233  bool saveCanvasImageToFile( const wxString& aFileName,
234  wxBitmapType aBitmapType = wxBITMAP_TYPE_PNG );
235 
237  static const wxChar CANVAS_TYPE_KEY[];
238 
239 public:
240  EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent,
241  FRAME_T aFrameType,
242  const wxString& aTitle,
243  const wxPoint& aPos, const wxSize& aSize,
244  long aStyle,
245  const wxString& aFrameName );
246 
247  ~EDA_DRAW_FRAME();
248 
257  virtual void OnCharHook( wxKeyEvent& event );
258 
265  bool LockFile( const wxString& aFileName );
266 
270  void ReleaseFile();
271 
272  virtual void SetPageSettings( const PAGE_INFO& aPageSettings ) = 0;
273  virtual const PAGE_INFO& GetPageSettings() const = 0;
274 
279  virtual const wxSize GetPageSizeIU() const = 0;
280 
284  EDA_UNITS_T GetUserUnits() const override { return m_UserUnits; }
285  void SetUserUnits( EDA_UNITS_T aUnits ) { m_UserUnits = aUnits; }
286 
290  virtual const wxPoint& GetAuxOrigin() const = 0;
291  virtual void SetAuxOrigin( const wxPoint& aPosition ) = 0;
292 
298  virtual const wxPoint& GetGridOrigin() const = 0;
299  virtual void SetGridOrigin( const wxPoint& aPosition ) = 0;
300 
301  int GetLastGridSizeId() const { return m_LastGridSizeId; }
302  void SetLastGridSizeId( int aId ) { m_LastGridSizeId = aId; }
303 
304  //-----<BASE_SCREEN API moved here>------------------------------------------
311  wxPoint GetCrossHairPosition( bool aInvertY = false ) const;
312 
320  void SetCrossHairPosition( const wxPoint& aPosition, bool aSnapToGrid = true );
321 
330  wxPoint GetCursorPosition( bool aOnGrid, wxRealPoint* aGridSize = NULL ) const;
331 
340  wxPoint GetNearestGridPosition( const wxPoint& aPosition, wxRealPoint* aGridSize = NULL ) const;
341 
347  wxPoint GetCrossHairScreenPosition() const;
348 
349  void SetMousePosition( const wxPoint& aPosition );
350 
360  wxPoint RefPos( bool useMouse ) const;
361 
362  const wxPoint& GetScrollCenterPosition() const;
363  void SetScrollCenterPosition( const wxPoint& aPoint );
364 
365  //-----</BASE_SCREEN API moved here>-----------------------------------------
366 
367  virtual const TITLE_BLOCK& GetTitleBlock() const = 0;
368  virtual void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) = 0;
369 
370  // the background color of the draw canvas:
371  // Virtual because some frames can have a specific way to get/set the bg color
375  virtual COLOR4D GetDrawBgColor() const { return m_drawBgColor; }
376 
380  virtual void SetDrawBgColor( COLOR4D aColor) { m_drawBgColor= aColor ; }
381 
382  bool GetShowBorderAndTitleBlock() const { return m_showBorderAndTitleBlock; }
383 
384  void SetShowBorderAndTitleBlock( bool aShow ) { m_showBorderAndTitleBlock = aShow; }
385  bool ShowPageLimits() const { return m_showPageLimits; }
386  void SetShowPageLimits( bool aShow ) { m_showPageLimits = aShow; }
387 
388  virtual EDA_DRAW_PANEL* GetCanvas() const { return m_canvas; }
389 
390  virtual wxString GetScreenDesc() const;
391 
397  virtual BASE_SCREEN* GetScreen() const { return m_currentScreen; }
398 
408  virtual void ExecuteRemoteCommand( const char* cmdline ){}
409 
410  void OnMenuOpen( wxMenuEvent& event );
411  void OnMouseEvent( wxMouseEvent& event );
412 
423  void SkipNextLeftButtonReleaseEvent();
424 
426  int WriteHotkeyConfig( struct EDA_HOTKEY_CONFIG* aDescList, wxString* aFullFileName = NULL ) override;
427 
431  EDA_HOTKEY_CONFIG* GetHotkeyConfig() const { return m_hotkeysDescrList; }
432 
439  virtual EDA_HOTKEY* GetHotKeyDescription( int aCommand ) const = 0;
440 
441  virtual bool OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
442  EDA_ITEM* aItem = NULL );
443 
449  virtual void AddMenuZoomAndGrid( wxMenu* aMasterMenu );
450 
459  virtual const wxString GetZoomLevelIndicator() const;
460 
464  inline double GetZoomLevelCoeff() const { return m_zoomLevelCoeff; }
465 
466  void EraseMsgBox();
467  void Process_PageSettings( wxCommandEvent& event );
468 
469  virtual void ReCreateHToolbar() = 0;
470  virtual void ReCreateVToolbar() = 0;
471  virtual void ReCreateMenuBar() override;
472  virtual void ReCreateAuxiliaryToolbar();
473 
474  // Toolbar accessors
475  wxAuiToolBar* GetMainToolBar() const { return m_mainToolBar; }
476  wxAuiToolBar* GetOptionsToolBar() const { return m_optionsToolBar; }
477  wxAuiToolBar* GetDrawToolBar() const { return m_drawToolBar; }
478  wxAuiToolBar* GetAuxiliaryToolBar() const { return m_auxiliaryToolBar; }
479 
486  bool GetToolToggled( int aToolId );
487 
492  wxAuiToolBarItem* GetToolbarTool( int aToolId );
493 
507  virtual void SetToolID( int aId, int aCursor, const wxString& aToolMsg );
508 
512  virtual void SetNoToolSelected();
513 
519  int GetToolId() const { return m_toolId; }
520 
521  /* These 4 functions provide a basic way to show/hide grid
522  * and /get/set grid color.
523  * These parameters are saved in KiCad config for each main frame
524  */
528  virtual bool IsGridVisible() const
529  {
530  return m_drawGrid;
531  }
532 
537  virtual void SetGridVisibility( bool aVisible )
538  {
539  m_drawGrid = aVisible;
540  }
541 
546  {
547  return m_gridColor;
548  }
549 
553  virtual void SetGridColor( COLOR4D aColor )
554  {
555  m_gridColor = aColor;
556  }
557 
566  wxPoint GetGridPosition( const wxPoint& aPosition ) const;
567 
571  virtual void SetNextGrid();
572 
576  virtual void SetPrevGrid();
577 
583  void SetPresetGrid( int aIndex );
584 
595  virtual void OnSelectGrid( wxCommandEvent& event );
596 
604  virtual void OnSelectZoom( wxCommandEvent& event );
605 
606  // Command event handlers shared by all applications derived from EDA_DRAW_FRAME.
607  void OnToggleGridState( wxCommandEvent& aEvent );
608  void OnSelectUnits( wxCommandEvent& aEvent );
609  void OnToggleCrossHairStyle( wxCommandEvent& aEvent );
610 
611  // Update user interface event handlers shared by all applications derived from
612  // EDA_DRAW_FRAME.
613  void OnUpdateUndo( wxUpdateUIEvent& aEvent );
614  void OnUpdateRedo( wxUpdateUIEvent& aEvent );
615  void OnUpdateGrid( 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 
715  double GetZoom();
716 
727  void DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth,
728  double aScale, const wxString &aFilename,
729  const wxString &aSheetLayer = wxEmptyString );
730 
731  void DisplayToolMsg( const wxString& msg );
732  virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0;
733  virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
734  virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
735  virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
736  virtual void ToolOnRightClick( wxCommandEvent& event );
737  void AdjustScrollBars( const wxPoint& aCenterPosition );
738 
745  virtual void OnActivate( wxActivateEvent& event );
746 
759  virtual void UpdateStatusBar();
760 
764  void DisplayUnitsMsg();
765 
766  /* Handlers for block commands */
767  virtual void InitBlockPasteInfos();
768 
778  virtual bool HandleBlockBegin( wxDC* aDC, EDA_KEY aKey, const wxPoint& aPosition,
779  int aExplicitCommand = 0 );
780 
789  virtual int BlockCommand( EDA_KEY aKey );
790 
797  virtual void HandleBlockPlace( wxDC* DC );
798 
808  virtual bool HandleBlockEnd( wxDC* DC );
809 
813  void CopyToClipboard( wxCommandEvent& event );
814 
815  /* interprocess communication */
816  void CreateServer( int service, bool local = true );
817  void OnSockRequest( wxSocketEvent& evt );
818  void OnSockRequestServer( wxSocketEvent& evt );
819 
820  void LoadSettings( wxConfigBase* aCfg ) override;
821 
822  void SaveSettings( wxConfigBase* aCfg ) override;
823 
836  void AppendMsgPanel( const wxString& textUpper, const wxString& textLower,
837  COLOR4D color, int pad = 6 );
838 
842  void ClearMsgPanel( void );
843 
849  void SetMsgPanel( const std::vector< MSG_PANEL_ITEM >& aList );
850 
851  void SetMsgPanel( EDA_ITEM* aItem );
852 
856  virtual void UpdateMsgPanel();
857 
864  void PushPreferences( const EDA_DRAW_PANEL* aParentCanvas );
865 
874  virtual void PrintPage( wxDC* aDC, LSET aPrintMask, bool aPrintMirrorMode, void* aData = NULL );
875 
879  static EDA_DRAW_PANEL_GAL::GAL_TYPE LoadCanvasTypeSetting();
880 
886  virtual void UseGalCanvas( bool aEnable );
887 
893  virtual bool SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType );
894 
901  bool IsGalCanvasActive() const { return m_galCanvasActive; }
902 
908  EDA_DRAW_PANEL_GAL* GetGalCanvas() const { return m_galCanvas; }
909  void SetGalCanvas( EDA_DRAW_PANEL_GAL* aPanel ) { m_galCanvas = aPanel; }
910 
914  TOOL_MANAGER* GetToolManager() const { return m_toolManager; }
915 
921  virtual void* GetDisplayOptions() { return NULL; }
922 
926  KIGFX::GAL_DISPLAY_OPTIONS& GetGalDisplayOptions() { return m_galDisplayOptions; }
927 
932  virtual void SyncMenusAndToolbars( wxEvent& aEvent ) {};
933 
934  bool GetShowAxis() const { return m_showAxis; }
935  bool GetShowGridAxis() const { return m_showGridAxis; }
936  bool GetShowOriginAxis() const { return m_showOriginAxis; }
937 
938  virtual const BOX2I GetDocumentExtents() const;
939 
940  DECLARE_EVENT_TABLE()
941 };
942 
943 #endif // DRAW_FRAME_H_
bool ShowPageLimits() const
Definition: draw_frame.h:385
TOOL_MANAGER * m_toolManager
Definition: draw_frame.h:125
wxAuiToolBar * GetDrawToolBar() const
Definition: draw_frame.h:477
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:475
virtual EDA_DRAW_PANEL * GetCanvas() const
Definition: draw_frame.h:388
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
Definition: draw_frame.h:926
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:58
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:181
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:179
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:932
std::vector< wxSocketBase * > m_sockets
interprocess communication
Definition: draw_frame.h:101
virtual void SetDrawBgColor(COLOR4D aColor)
Definition: draw_frame.h:380
EDA_HOTKEY_CONFIG * GetHotkeyConfig() const
Return a structure containing currently used hotkey mapping.
Definition: draw_frame.h:431
int GetLastGridSizeId() const
Definition: draw_frame.h:301
bool GetShowBorderAndTitleBlock() const
Definition: draw_frame.h:382
void SetGalCanvas(EDA_DRAW_PANEL_GAL *aPanel)
Definition: draw_frame.h:909
virtual void SetGridColor(COLOR4D aColor)
Definition: draw_frame.h:553
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
wxChoice * m_gridSelectBox
Definition: draw_frame.h:148
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:464
void OnMouseEvent(wxMouseEvent &event)
virtual bool IsGridVisible() const
Definition: draw_frame.h:528
bool m_canvasTypeDirty
Flag indicating that drawing canvas type needs to be saved to config.
Definition: draw_frame.h:176
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:408
wxAuiToolBar * GetOptionsToolBar() const
Definition: draw_frame.h:476
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:397
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:375
EDA_HOTKEY_CONFIG * m_hotkeysDescrList
Definition: draw_frame.h:105
void OnEraseBackground(wxEraseEvent &event)
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:284
wxChoice * m_zoomSelectBox
Definition: draw_frame.h:149
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:934
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:73
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:901
static const wxString UserUnitsEntryKeyword(wxT("Units"))
User units.
wxAuiToolBar * GetAuxiliaryToolBar() const
Definition: draw_frame.h:478
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:545
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:914
bool GetShowGridAxis() const
Definition: draw_frame.h:935
bool GetShowOriginAxis() const
Definition: draw_frame.h:936
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:519
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
void SetLastGridSizeId(int aId)
Definition: draw_frame.h:302
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:908
virtual void SetGridVisibility(bool aVisible)
It may be overloaded by derived classes.
Definition: draw_frame.h:537
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:386
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:384
EDA_UNITS_T
Definition: common.h:159
virtual void * GetDisplayOptions()
A way to pass info to draw functions.
Definition: draw_frame.h:921
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:285
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