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-2017 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
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 
64 {
67  friend class EDA_DRAW_PANEL;
68 
70  int m_toolId;
71 
73 
74  bool m_snapToGrid;
76 
78 
80  std::unique_ptr<KIGFX::GAL_DISPLAY_OPTIONS> m_galDisplayOptions;
81 
82 protected:
83 
84  wxSocketServer* m_socketServer;
85  std::vector<wxSocketBase*> m_sockets;
86 
87  std::unique_ptr<wxSingleInstanceChecker> m_file_checker;
88 
90 
91  int m_LastGridSizeId; // the command id offset (>= 0) of the last selected grid
92  // 0 is for the grid corresponding to
93  // a wxCommand ID = ID_POPUP_GRID_LEVEL_1000.
94  bool m_drawGrid; // hide/Show grid
98  double m_zoomLevelCoeff;
100  // to a zoom level value which rougly gives 1.0 when the board/schematic
101  // is at scale = 1
103  // to screens
104 
107 
111 
114 
117 
120 
124 
127 
130 
132  wxChoice* m_gridSelectBox;
133 
135  wxChoice* m_zoomSelectBox;
136 
139  wxAuiToolBar* m_auxiliaryToolBar;
140 
143  wxAuiToolBar* m_drawToolBar;
144 
146  wxAuiToolBar* m_optionsToolBar;
147 
150 
152 
153 #ifdef USE_WX_OVERLAY
154  // MAC Uses overlay to workaround the wxINVERT and wxXOR miss
155  wxOverlay m_overlay;
156 #endif
157 
160 
163 
166 
167  void SetScreen( BASE_SCREEN* aScreen ) { m_currentScreen = aScreen; }
168 
169  double bestZoom( double sizeX, double sizeY, double scaleFactor, wxPoint centre );
170 
178  virtual void unitsChangeRefresh();
179 
189  bool GeneralControlKeyMovement( int aHotKey, wxPoint *aPos, bool aSnapToGrid );
190 
194  void RefreshCrossHair( const wxPoint &aOldPos, const wxPoint &aEvtPos, wxDC* aDC );
195 
199  bool isBusy() const;
200 
204  EDA_DRAW_PANEL_GAL::GAL_TYPE loadCanvasTypeSetting() const;
205 
209  bool saveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType );
210 
212  static const wxChar CANVAS_TYPE_KEY[];
213 
214 public:
215  EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent,
216  FRAME_T aFrameType,
217  const wxString& aTitle,
218  const wxPoint& aPos, const wxSize& aSize,
219  long aStyle,
220  const wxString& aFrameName );
221 
222  ~EDA_DRAW_FRAME();
223 
230  virtual void OnCharHook( wxKeyEvent& event );
231 
238  bool LockFile( const wxString& aFileName );
239 
244  void ReleaseFile();
245 
246  virtual void SetPageSettings( const PAGE_INFO& aPageSettings ) = 0;
247  virtual const PAGE_INFO& GetPageSettings() const = 0;
248 
254  virtual const wxSize GetPageSizeIU() const = 0;
255 
260  virtual const wxPoint& GetAuxOrigin() const = 0;
261  virtual void SetAuxOrigin( const wxPoint& aPosition ) = 0;
262 
269  virtual const wxPoint& GetGridOrigin() const = 0;
270  virtual void SetGridOrigin( const wxPoint& aPosition ) = 0;
271 
272  //-----<BASE_SCREEN API moved here>------------------------------------------
279  wxPoint GetCrossHairPosition( bool aInvertY = false ) const;
280 
289  void SetCrossHairPosition( const wxPoint& aPosition, bool aSnapToGrid = true );
290 
299  wxPoint GetCursorPosition( bool aOnGrid, wxRealPoint* aGridSize = NULL ) const;
300 
309  wxPoint GetNearestGridPosition( const wxPoint& aPosition, wxRealPoint* aGridSize = NULL ) const;
310 
316  wxPoint GetCrossHairScreenPosition() const;
317 
318  void SetMousePosition( const wxPoint& aPosition );
319 
330  wxPoint RefPos( bool useMouse ) const;
331 
332  const wxPoint& GetScrollCenterPosition() const;
333  void SetScrollCenterPosition( const wxPoint& aPoint );
334 
335  //-----</BASE_SCREEN API moved here>-----------------------------------------
336 
337 
338  virtual const TITLE_BLOCK& GetTitleBlock() const = 0;
339  virtual void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) = 0;
340 
341  // the background color of the draw canvas:
342  // Virtual because some frames can have a specific way to get/set the bg color
346  virtual COLOR4D GetDrawBgColor() const { return m_drawBgColor; }
347 
351  virtual void SetDrawBgColor( COLOR4D aColor) { m_drawBgColor= aColor ; }
352 
353  bool GetShowBorderAndTitleBlock() const { return m_showBorderAndTitleBlock; }
354 
355  void SetShowBorderAndTitleBlock( bool aShow ) { m_showBorderAndTitleBlock = aShow; }
356  bool ShowPageLimits() const { return m_showPageLimits; }
357  void SetShowPageLimits( bool aShow ) { m_showPageLimits = aShow; }
358 
359  EDA_DRAW_PANEL* GetCanvas() { return m_canvas; }
360 
361  virtual wxString GetScreenDesc() const;
362 
369  virtual BASE_SCREEN* GetScreen() const { return m_currentScreen; }
370 
380  virtual void ExecuteRemoteCommand( const char* cmdline ){}
381 
382  void OnMenuOpen( wxMenuEvent& event );
383  void OnMouseEvent( wxMouseEvent& event );
384 
396  void SkipNextLeftButtonReleaseEvent();
397 
399  int WriteHotkeyConfig( struct EDA_HOTKEY_CONFIG* aDescList, wxString* aFullFileName = NULL ) override;
400 
405  EDA_HOTKEY_CONFIG* GetHotkeyConfig() const { return m_hotkeysDescrList; }
406 
414  virtual EDA_HOTKEY* GetHotKeyDescription( int aCommand ) const = 0;
415 
416  virtual bool OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
417  EDA_ITEM* aItem = NULL );
418 
425  virtual void AddMenuZoomAndGrid( wxMenu* aMasterMenu );
426 
436  virtual const wxString GetZoomLevelIndicator() const;
437 
442  inline double GetZoomLevelCoeff() const { return m_zoomLevelCoeff; }
443 
444  void EraseMsgBox();
445  void Process_PageSettings( wxCommandEvent& event );
446 
447  virtual void ReCreateHToolbar() = 0;
448  virtual void ReCreateVToolbar() = 0;
449  virtual void ReCreateMenuBar() override;
450  virtual void ReCreateAuxiliaryToolbar();
451 
452  // Toolbar accessors
453  wxAuiToolBar* GetMainToolBar() const { return m_mainToolBar; }
454  wxAuiToolBar* GetOptionsToolBar() const { return m_optionsToolBar; }
455  wxAuiToolBar* GetDrawToolBar() const { return m_drawToolBar; }
456  wxAuiToolBar* GetAuxiliaryToolBar() const { return m_auxiliaryToolBar; }
457 
464  bool GetToolToggled( int aToolId );
465 
470  wxAuiToolBarItem* GetToolbarTool( int aToolId );
471 
484  virtual void SetToolID( int aId, int aCursor, const wxString& aToolMsg );
485 
489  virtual void SetNoToolSelected();
490 
496  int GetToolId() const { return m_toolId; }
497 
498  /* These 4 functions provide a basic way to show/hide grid
499  * and /get/set grid color.
500  * These parameters are saved in KiCad config for each main frame
501  */
506  virtual bool IsGridVisible() const
507  {
508  return m_drawGrid;
509  }
510 
516  virtual void SetGridVisibility( bool aVisible )
517  {
518  m_drawGrid = aVisible;
519  }
520 
526  {
527  return m_gridColor;
528  }
529 
534  virtual void SetGridColor( COLOR4D aColor )
535  {
536  m_gridColor = aColor;
537  }
538 
547  wxPoint GetGridPosition( const wxPoint& aPosition ) const;
548 
553  virtual void SetNextGrid();
554 
559  virtual void SetPrevGrid();
560 
566  void SetPresetGrid( int aIndex );
567 
578  virtual void OnSelectGrid( wxCommandEvent& event );
579 
587  virtual void OnSelectZoom( wxCommandEvent& event );
588 
589  // Command event handlers shared by all applications derived from EDA_DRAW_FRAME.
590  void OnToggleGridState( wxCommandEvent& aEvent );
591  void OnSelectUnits( wxCommandEvent& aEvent );
592  void OnToggleCrossHairStyle( wxCommandEvent& aEvent );
593 
594  // Update user interface event handlers shared by all applications derived from
595  // EDA_DRAW_FRAME.
596  void OnUpdateUndo( wxUpdateUIEvent& aEvent );
597  void OnUpdateRedo( wxUpdateUIEvent& aEvent );
598  void OnUpdateGrid( wxUpdateUIEvent& aEvent );
599  void OnUpdateUnits( wxUpdateUIEvent& aEvent );
600  void OnUpdateCrossHairStyle( wxUpdateUIEvent& aEvent );
601 
614  virtual bool GeneralControl( wxDC* aDC, const wxPoint& aPosition, EDA_KEY aHotKey = 0 )
615  {
616  return false;
617  }
618 
623  virtual void OnSize( wxSizeEvent& event );
624 
625  void OnEraseBackground( wxEraseEvent& SizeEvent );
626 
627  virtual void OnZoom( wxCommandEvent& event );
628 
633  void SetNextZoom();
634 
639  void SetPrevZoom();
640 
646  void SetPresetZoom( int aIndex );
647 
655  void RedrawScreen( const wxPoint& aCenterPoint, bool aWarpPointer );
656 
662  void RedrawScreen2( const wxPoint& posBefore );
663 
669  void Zoom_Automatique( bool aWarpPointer );
670 
671  /* Set the zoom level to show the area Rect */
672  void Window_Zoom( EDA_RECT& Rect );
673 
675  virtual double BestZoom() = 0;
676 
681  double GetZoom();
682 
693  void DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth,
694  double aScale, const wxString &aFilename,
695  const wxString &aSheetLayer = wxEmptyString );
696 
697  void DisplayToolMsg( const wxString& msg );
698  virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0;
699  virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
700  virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
701  virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
702  virtual void ToolOnRightClick( wxCommandEvent& event );
703  void AdjustScrollBars( const wxPoint& aCenterPosition );
704 
711  virtual void OnActivate( wxActivateEvent& event );
712 
726  virtual void UpdateStatusBar();
727 
732  void DisplayUnitsMsg();
733 
734  /* Handlers for block commands */
735  virtual void InitBlockPasteInfos();
736 
746  virtual bool HandleBlockBegin( wxDC* aDC, EDA_KEY aKey, const wxPoint& aPosition,
747  int aExplicitCommand = 0 );
748 
758  virtual int BlockCommand( EDA_KEY aKey );
759 
767  virtual void HandleBlockPlace( wxDC* DC );
768 
779  virtual bool HandleBlockEnd( wxDC* DC );
780 
785  void CopyToClipboard( wxCommandEvent& event );
786 
787  /* interprocess communication */
788  void CreateServer( int service, bool local = true );
789  void OnSockRequest( wxSocketEvent& evt );
790  void OnSockRequestServer( wxSocketEvent& evt );
791 
792  void LoadSettings( wxConfigBase* aCfg ) override;
793 
794  void SaveSettings( wxConfigBase* aCfg ) override;
795 
808  void AppendMsgPanel( const wxString& textUpper, const wxString& textLower,
809  COLOR4D color, int pad = 6 );
810 
814  void ClearMsgPanel( void );
815 
822  void SetMsgPanel( const std::vector< MSG_PANEL_ITEM >& aList );
823 
824  void SetMsgPanel( EDA_ITEM* aItem );
825 
830  virtual void UpdateMsgPanel();
831 
839  void PushPreferences( const EDA_DRAW_PANEL* aParentCanvas );
840 
850  virtual void PrintPage( wxDC* aDC, LSET aPrintMask, bool aPrintMirrorMode, void* aData = NULL );
851 
861  wxString CoordinateToString( int aValue, bool aConvertToMils = false ) const;
862 
872  wxString LengthDoubleToString( double aValue, bool aConvertToMils = false ) const;
873 
880  virtual void UseGalCanvas( bool aEnable );
881 
887  virtual bool SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType );
888 
895  bool IsGalCanvasActive() const { return m_galCanvasActive; }
896 
903  EDA_DRAW_PANEL_GAL* GetGalCanvas() const { return m_galCanvas; }
904  void SetGalCanvas( EDA_DRAW_PANEL_GAL* aPanel ) { m_galCanvas = aPanel; }
905 
910  TOOL_MANAGER* GetToolManager() const { return m_toolManager; }
911 
918  virtual void* GetDisplayOptions() { return NULL; }
919 
924  KIGFX::GAL_DISPLAY_OPTIONS& GetGalDisplayOptions() { return *m_galDisplayOptions; }
925 
931  virtual void SyncMenusAndToolbars( wxEvent& aEvent ) {};
932 
933  DECLARE_EVENT_TABLE()
934 };
935 
936 #endif // DRAW_FRAME_H_
bool ShowPageLimits() const
Definition: draw_frame.h:356
TOOL_MANAGER * m_toolManager
Definition: draw_frame.h:108
wxString CoordinateToString(int aValue, bool aConvertToMils)
Function CoordinateToString is a helper to convert the integer coordinate aValue to a string in inche...
Definition: base_units.cpp:118
wxAuiToolBar * GetDrawToolBar() const
Definition: draw_frame.h:455
double GetZoom()
Definition: draw_panel.cpp:282
Class KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a porti...
Definition: kiway_player.h:111
std::unique_ptr< KIGFX::GAL_DISPLAY_OPTIONS > m_galDisplayOptions
Definition: draw_frame.h:80
Structure EDA_HOTKEY_CONFIG contains the information required to save hot key information to a config...
Definition: hotkeys_basic.h:89
bool m_galCanvasActive
whether to use new GAL engine
Definition: draw_frame.h:75
wxAuiToolBar * GetMainToolBar() const
Definition: draw_frame.h:453
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Function GetGalDisplayOptions Returns a reference to the gal rendering options used by GAL for render...
Definition: draw_frame.h:924
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:116
TOOL_DISPATCHER * m_toolDispatcher
Definition: draw_frame.h:109
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:359
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:165
void SetScreen(BASE_SCREEN *aScreen)
Definition: draw_frame.h:167
int color
Definition: DXF_plotter.cpp:62
virtual void SyncMenusAndToolbars(wxEvent &aEvent)
Function SyncMenusAndToolbars Updates the toolbars and menus (mostly settings/check buttons/checkboxe...
Definition: draw_frame.h:931
std::vector< wxSocketBase * > m_sockets
interprocess communication
Definition: draw_frame.h:85
virtual void SetDrawBgColor(COLOR4D aColor)
Definition: draw_frame.h:351
EDA_HOTKEY_CONFIG * GetHotkeyConfig() const
Function GetHotkeyConfig() Returns a structure containing currently used hotkey mapping.
Definition: draw_frame.h:405
bool GetShowBorderAndTitleBlock() const
Definition: draw_frame.h:353
void SetGalCanvas(EDA_DRAW_PANEL_GAL *aPanel)
Definition: draw_frame.h:904
virtual void SetGridColor(COLOR4D aColor)
Function SetGridColor() , virtual.
Definition: draw_frame.h:534
class EDA_MSG_PANEL is a panel to display various information messages.
Definition: msgpanel.h:111
Class EDA_DRAW_FRAME is the base class for create windows for drawing purpose.
Definition: draw_frame.h:63
COLOR4D m_drawBgColor
the background color of the draw canvas BLACK for Pcbnew, BLACK or WHITE for eeschema ...
Definition: draw_frame.h:97
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:39
wxChoice * m_gridSelectBox
Choice box to choose the grid size.
Definition: draw_frame.h:132
COLOR4D m_gridColor
Grid color.
Definition: draw_frame.h:96
std::unique_ptr< wxSingleInstanceChecker > m_file_checker
prevents opening same file multiple times.
Definition: draw_frame.h:87
double GetZoomLevelCoeff() const
Function GetZoomLevelCoeff returns the coefficient to convert internal display scale factor to zoom l...
Definition: draw_frame.h:442
void OnMouseEvent(wxMouseEvent &event)
virtual bool IsGridVisible() const
Function IsGridVisible() , virtual.
Definition: draw_frame.h:506
bool m_canvasTypeDirty
Flag indicating that drawing canvas type needs to be saved to config.
Definition: draw_frame.h:162
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:380
wxAuiToolBar * GetOptionsToolBar() const
Definition: draw_frame.h:454
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:123
wxAuiToolBar * m_auxiliaryToolBar
Auxiliary tool bar typically shown below the main tool bar at the top of the main window...
Definition: draw_frame.h:139
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:369
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:146
BASE_SCREEN * m_currentScreen
current used SCREEN
Definition: draw_frame.h:72
virtual COLOR4D GetDrawBgColor() const
Definition: draw_frame.h:346
EDA_HOTKEY_CONFIG * m_hotkeysDescrList
Definition: draw_frame.h:89
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:149
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:49
bool m_showBorderAndTitleBlock
True shows the drawing border and title block.
Definition: draw_frame.h:126
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
wxChoice * m_zoomSelectBox
Choice box to choose the zoom value.
Definition: draw_frame.h:135
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
Base window classes and related definitions.
bool m_showGridAxis
True shows the grid axis indicators.
Definition: draw_frame.h:119
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:52
wxString LengthDoubleToString(double aValue, bool aConvertToMils)
Function LengthDoubleToString is a helper to convert the double length aValue to a string in inches...
Definition: base_units.cpp:123
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:895
wxAuiToolBar * GetAuxiliaryToolBar() const
Definition: draw_frame.h:456
int m_UndoRedoCountMax
default Undo/Redo command Max depth, to be handed
Definition: draw_frame.h:102
int m_LastGridSizeId
Definition: draw_frame.h:91
virtual COLOR4D GetGridColor()
Function GetGridColor() , virtual.
Definition: draw_frame.h:525
wxAuiToolBar * m_drawToolBar
The tool bar that contains the buttons for quick access to the application draw tools.
Definition: draw_frame.h:143
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:77
wxSocketServer * m_socketServer
Definition: draw_frame.h:84
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:106
TOOL_MANAGER * GetToolManager() const
Function GetToolManager returns the tool manager instance, if any.
Definition: draw_frame.h:910
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:151
void OnActivate(wxActivateEvent &event)
Function OnActivate handles window activation events.
Definition: draw_panel.cpp:413
int GetToolId() const
Definition: draw_frame.h:496
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:162
bool m_showPageLimits
true to display the page limits
Definition: draw_frame.h:95
bool OnRightClick(wxMouseEvent &event)
Function OnRightClick builds and displays a context menu on a right mouse button click.
Definition: draw_panel.cpp:899
Class ACTIONS.
Definition: actions.h:41
virtual bool GeneralControl(wxDC *aDC, const wxPoint &aPosition, EDA_KEY aHotKey=0)
Function GeneralControl performs application specific control using aDC at aPosition in logical units...
Definition: draw_frame.h:614
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:903
virtual void SetGridVisibility(bool aVisible)
Function SetGridVisibility() , virtual It may be overloaded by derived classes.
Definition: draw_frame.h:516
Some functions to handle hotkeys in KiCad.
void SetShowPageLimits(bool aShow)
Definition: draw_frame.h:357
ACTIONS * m_actions
Definition: draw_frame.h:110
bool m_movingCursorWithKeyboard
One-shot to avoid a recursive mouse event during hotkey movement.
Definition: draw_frame.h:159
int m_lastDrawToolId
Tool ID of previously active draw tool bar button.
Definition: draw_frame.h:113
void SetShowBorderAndTitleBlock(bool aShow)
Definition: draw_frame.h:355
virtual void * GetDisplayOptions()
Function GetDisplayOptions A way to pass info to draw functions.
Definition: draw_frame.h:918
long m_firstRunDialogSetting
Key to control whether first run dialog is shown on startup.
Definition: draw_frame.h:129
bool m_snapToGrid
Indicates if cursor should be snapped to grid.
Definition: draw_frame.h:74
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39