2011-09-29 16:49:40 +00:00
|
|
|
/**
|
|
|
|
* @file pcbnew/hotkeys.cpp
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
|
|
|
#include <pcbnew.h>
|
|
|
|
#include <wxPcbStruct.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <hotkeys.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
/* How to add a new hotkey:
|
|
|
|
* add a new id in the enum hotkey_id_commnand like MY_NEW_ID_FUNCTION.
|
2011-09-29 16:49:40 +00:00
|
|
|
* add a new EDA_HOTKEY entry like:
|
|
|
|
* static EDA_HOTKEY HkMyNewEntry(wxT("Command Label"), MY_NEW_ID_FUNCTION, default key value);
|
|
|
|
* "Command Label" is the name used in hotkey list display, and the identifier in the
|
|
|
|
* hotkey list file MY_NEW_ID_FUNCTION is an equivalent id function used in the switch
|
|
|
|
* in OnHotKey() function.
|
|
|
|
* default key value is the default hotkey for this command. Can be overridden by the user
|
|
|
|
* hotkey list file
|
|
|
|
* add the HkMyNewEntry pointer in the s_board_edit_Hotkey_List list ( or/and the
|
|
|
|
* s_module_edit_Hotkey_List list)
|
2007-08-30 08:15:05 +00:00
|
|
|
* Add the new code in the switch in OnHotKey() function.
|
2010-08-12 19:41:13 +00:00
|
|
|
* Note: when the variable itemCurrentlyEdited is true, an item is currently edited.
|
2011-09-29 16:49:40 +00:00
|
|
|
* This can be useful if the new function cannot be executed while an item is currently
|
|
|
|
* being edited ( For example, one cannot start a new wire when a component is moving.)
|
2007-08-30 08:15:05 +00:00
|
|
|
*
|
2007-09-06 11:52:26 +00:00
|
|
|
* Note: If an hotkey is a special key, be sure the corresponding wxWidget keycode (WXK_XXXX)
|
2007-08-30 08:15:05 +00:00
|
|
|
* is handled in the hotkey_name_descr s_Hotkey_Name_List list (see hotkeys_basic.cpp)
|
|
|
|
* and see this list for some ascii keys (space ...)
|
|
|
|
*/
|
2007-08-20 10:55:09 +00:00
|
|
|
|
|
|
|
/* local variables */
|
|
|
|
/* Hotkey list: */
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkSwitch2CopperLayer( wxT( "Switch to Copper layer" ),
|
|
|
|
HK_SWITCH_LAYER_TO_COPPER, WXK_PAGEDOWN );
|
|
|
|
static EDA_HOTKEY HkSwitch2ComponentLayer( wxT( "Switch to Component layer" ),
|
|
|
|
HK_SWITCH_LAYER_TO_COMPONENT, WXK_PAGEUP );
|
|
|
|
static EDA_HOTKEY HkSwitch2InnerLayer1( wxT( "Switch to Inner layer 1" ),
|
|
|
|
HK_SWITCH_LAYER_TO_INNER1, WXK_F5 );
|
|
|
|
static EDA_HOTKEY HkSwitch2InnerLayer2( wxT( "Switch to Inner layer 2" ),
|
|
|
|
HK_SWITCH_LAYER_TO_INNER2, WXK_F6 );
|
|
|
|
static EDA_HOTKEY HkSwitch2InnerLayer3( wxT( "Switch to Inner layer 3" ),
|
|
|
|
HK_SWITCH_LAYER_TO_INNER3, WXK_F7 );
|
|
|
|
static EDA_HOTKEY HkSwitch2InnerLayer4( wxT( "Switch to Inner layer 4" ),
|
|
|
|
HK_SWITCH_LAYER_TO_INNER4, WXK_F8 );
|
|
|
|
static EDA_HOTKEY HkSwitch2InnerLayer5( wxT( "Switch to Inner layer 5" ),
|
|
|
|
HK_SWITCH_LAYER_TO_INNER5, WXK_F9 );
|
|
|
|
static EDA_HOTKEY HkSwitch2InnerLayer6( wxT( "Switch to Inner layer 6" ),
|
|
|
|
HK_SWITCH_LAYER_TO_INNER6, WXK_F10 );
|
|
|
|
|
|
|
|
static EDA_HOTKEY HkSwitch2NextCopperLayer( wxT( "Switch to Next Layer" ),
|
|
|
|
HK_SWITCH_LAYER_TO_NEXT, '+' );
|
|
|
|
static EDA_HOTKEY HkSwitch2PreviousCopperLayer( wxT( "Switch to Previous Layer" ),
|
|
|
|
HK_SWITCH_LAYER_TO_PREVIOUS, '-' );
|
|
|
|
|
2012-09-12 11:11:30 +00:00
|
|
|
static EDA_HOTKEY HkSaveModule( wxT( "Save Module" ), HK_SAVE_MODULE, 'S' + GR_KB_CTRL );
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkSavefile( wxT( "Save board" ), HK_SAVE_BOARD, 'S' + GR_KB_CTRL );
|
|
|
|
static EDA_HOTKEY HkLoadfile( wxT( "Load board" ), HK_LOAD_BOARD, 'L' + GR_KB_CTRL );
|
|
|
|
static EDA_HOTKEY HkFindItem( wxT( "Find Item" ), HK_FIND_ITEM, 'F' + GR_KB_CTRL );
|
|
|
|
static EDA_HOTKEY HkBackspace( wxT( "Delete track segment" ), HK_BACK_SPACE, WXK_BACK );
|
|
|
|
static EDA_HOTKEY HkAddNewTrack( wxT( "Add new track" ), HK_ADD_NEW_TRACK, 'X' );
|
|
|
|
static EDA_HOTKEY HkAddVia( wxT( "Add Via" ), HK_ADD_VIA, 'V' );
|
|
|
|
static EDA_HOTKEY HkSwitchTrackPosture( wxT( "Switch Track Posture" ),
|
|
|
|
HK_SWITCH_TRACK_POSTURE, '/' );
|
|
|
|
static EDA_HOTKEY HkDragTrackKeepSlope( wxT( "Drag track keep slope" ),
|
|
|
|
HK_DRAG_TRACK_KEEP_SLOPE, 'D' );
|
|
|
|
static EDA_HOTKEY HkPlaceItem( wxT( "Place Item" ), HK_PLACE_ITEM, 'P' );
|
|
|
|
static EDA_HOTKEY HkAddMicroVia( wxT( "Add MicroVia" ), HK_ADD_MICROVIA, 'V' + GR_KB_CTRL );
|
|
|
|
static EDA_HOTKEY HkEndTrack( wxT( "End Track" ), HK_END_TRACK, WXK_END );
|
|
|
|
static EDA_HOTKEY HkEditBoardItem( wxT( "Edit Item" ), HK_EDIT_ITEM, 'E' );
|
2012-05-30 17:38:52 +00:00
|
|
|
static EDA_HOTKEY HkFlipItem( wxT( "Flip Item" ), HK_FLIP_ITEM, 'F' );
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkRotateItem( wxT( "Rotate Item" ), HK_ROTATE_ITEM, 'R' );
|
|
|
|
static EDA_HOTKEY HkMoveItem( wxT( "Move Item" ), HK_MOVE_ITEM, 'M' );
|
2012-07-04 19:50:47 +00:00
|
|
|
static EDA_HOTKEY HkCopyItem( wxT( "Copy Item" ), HK_COPY_ITEM, 'C' );
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkDragFootprint( wxT( "Drag Footprint" ), HK_DRAG_ITEM, 'G' );
|
|
|
|
static EDA_HOTKEY HkGetAndMoveFootprint( wxT( "Get and Move Footprint" ),
|
|
|
|
HK_GET_AND_MOVE_FOOTPRINT, 'T' );
|
|
|
|
static EDA_HOTKEY HkLock_Unlock_Footprint( wxT( "Lock/Unlock Footprint" ),
|
|
|
|
HK_LOCK_UNLOCK_FOOTPRINT, 'L' );
|
|
|
|
static EDA_HOTKEY HkDelete( wxT( "Delete Track or Footprint" ), HK_DELETE, WXK_DELETE );
|
|
|
|
static EDA_HOTKEY HkResetLocalCoord( wxT( "Reset Local Coordinates" ),
|
|
|
|
HK_RESET_LOCAL_COORD, ' ' );
|
2012-05-30 17:38:52 +00:00
|
|
|
static EDA_HOTKEY HkSwitchHighContrastMode( wxT("Switch Highcontrast mode"),
|
2012-02-19 17:33:06 +00:00
|
|
|
HK_SWITCH_HIGHCONTRAST_MODE,'H');
|
Introduction of Graphics Abstraction Layer based rendering for pcbnew.
New classes:
- VIEW - represents view that is seen by user, takes care of layer ordering & visibility and how it is displayed (which location, how much zoomed, etc.)
- VIEW_ITEM - Base class for every item that can be displayed on VIEW (the biggest change is that now it may be necessary to override ViewBBox & ViewGetLayers method for derived classes).
- EDA_DRAW_PANEL_GAL - Inherits after EDA_DRAW_PANEL, displays VIEW output, right now it is not editable (in opposite to usual EDA_DRAW_PANEL).
- GAL/OPENGL_GAL/CAIRO_GAL - Base Graphics Abstraction Layer class + two different flavours (Cairo is not fully supported yet), that offers methods to draw primitives using different libraries.
- WX_VIEW_CONTROLS - Controller for VIEW, handles user events, allows zooming, panning, etc.
- PAINTER/PCB_PAINTER - Classes that uses GAL interface to draw items (as you may have already guessed - PCB_PAINTER is a class for drawing PCB specific object, PAINTER is an abstract class). Its methods are invoked by VIEW, when an item has to be drawn. To display a new type of item - you need to implement draw(ITEM_TYPE*) method that draws it using GAL methods.
- STROKE_FONT - Implements stroke font drawing using GAL methods.
Most important changes to Kicad original code:
* EDA_ITEM now inherits from VIEW_ITEM, which is a base class for all drawable objects.
* EDA_DRAW_FRAME contains both usual EDA_DRAW_PANEL and new EDA_DRAW_PANEL_GAL, that can be switched anytime.
* There are some new layers for displaying multilayer pads, vias & pads holes (these are not shown yet on the right sidebar in pcbnew)
* Display order of layers is different than in previous versions (if you are curious - you may check m_galLayerOrder@pcbnew/basepcbframe.cpp). Preserving usual order would result in not very natural display, such as showing silkscreen texts on the bottom.
* Introduced new hotkey (Alt+F12) and new menu option (View->Switch canvas) for switching canvas during runtime.
* Some of classes (mostly derived from BOARD_ITEM) now includes ViewBBox & ViewGetLayers methods.
* Removed tools/class_painter.h, as now it is extended and included in source code.
Build changes:
* GAL-based rendering option is turned on by a new compilation CMake option KICAD_GAL.
* When compiling with CMake option KICAD_GAL=ON, GLEW and Cairo libraries are required.
* GAL-related code is compiled into a static library (common/libgal).
* Build with KICAD_GAL=OFF should not need any new libraries and should come out as a standard version of Kicad
Currently most of items in pcbnew can be displayed using OpenGL (to be done are DIMENSIONS and MARKERS).
More details about GAL can be found in: http://www.ohwr.org/attachments/1884/view-spec.pdf
2013-04-02 06:54:03 +00:00
|
|
|
#ifdef KICAD_GAL
|
2013-06-24 11:46:24 +00:00
|
|
|
static EDA_HOTKEY HkCanvasDefault( wxT( "Switch to default canvas" ),
|
|
|
|
HK_CANVAS_DEFAULT, GR_KB_ALT + WXK_F9 );
|
|
|
|
static EDA_HOTKEY HkCanvasOpenGL( wxT( "Switch to OpenGL canvas" ),
|
|
|
|
HK_CANVAS_OPENGL, GR_KB_ALT + WXK_F10 );
|
2013-06-04 14:18:33 +00:00
|
|
|
static EDA_HOTKEY HkCanvasOpenGLShaders( wxT( "Switch to OpenGL canvas with shaders" ),
|
2013-06-24 11:46:24 +00:00
|
|
|
HK_CANVAS_OPENGL_SHADERS, GR_KB_ALT + WXK_F11 );
|
|
|
|
static EDA_HOTKEY HkCanvasCairo( wxT( "Switch to Cairo canvas" ),
|
|
|
|
HK_CANVAS_CAIRO, GR_KB_ALT + WXK_F12 );
|
Introduction of Graphics Abstraction Layer based rendering for pcbnew.
New classes:
- VIEW - represents view that is seen by user, takes care of layer ordering & visibility and how it is displayed (which location, how much zoomed, etc.)
- VIEW_ITEM - Base class for every item that can be displayed on VIEW (the biggest change is that now it may be necessary to override ViewBBox & ViewGetLayers method for derived classes).
- EDA_DRAW_PANEL_GAL - Inherits after EDA_DRAW_PANEL, displays VIEW output, right now it is not editable (in opposite to usual EDA_DRAW_PANEL).
- GAL/OPENGL_GAL/CAIRO_GAL - Base Graphics Abstraction Layer class + two different flavours (Cairo is not fully supported yet), that offers methods to draw primitives using different libraries.
- WX_VIEW_CONTROLS - Controller for VIEW, handles user events, allows zooming, panning, etc.
- PAINTER/PCB_PAINTER - Classes that uses GAL interface to draw items (as you may have already guessed - PCB_PAINTER is a class for drawing PCB specific object, PAINTER is an abstract class). Its methods are invoked by VIEW, when an item has to be drawn. To display a new type of item - you need to implement draw(ITEM_TYPE*) method that draws it using GAL methods.
- STROKE_FONT - Implements stroke font drawing using GAL methods.
Most important changes to Kicad original code:
* EDA_ITEM now inherits from VIEW_ITEM, which is a base class for all drawable objects.
* EDA_DRAW_FRAME contains both usual EDA_DRAW_PANEL and new EDA_DRAW_PANEL_GAL, that can be switched anytime.
* There are some new layers for displaying multilayer pads, vias & pads holes (these are not shown yet on the right sidebar in pcbnew)
* Display order of layers is different than in previous versions (if you are curious - you may check m_galLayerOrder@pcbnew/basepcbframe.cpp). Preserving usual order would result in not very natural display, such as showing silkscreen texts on the bottom.
* Introduced new hotkey (Alt+F12) and new menu option (View->Switch canvas) for switching canvas during runtime.
* Some of classes (mostly derived from BOARD_ITEM) now includes ViewBBox & ViewGetLayers methods.
* Removed tools/class_painter.h, as now it is extended and included in source code.
Build changes:
* GAL-based rendering option is turned on by a new compilation CMake option KICAD_GAL.
* When compiling with CMake option KICAD_GAL=ON, GLEW and Cairo libraries are required.
* GAL-related code is compiled into a static library (common/libgal).
* Build with KICAD_GAL=OFF should not need any new libraries and should come out as a standard version of Kicad
Currently most of items in pcbnew can be displayed using OpenGL (to be done are DIMENSIONS and MARKERS).
More details about GAL can be found in: http://www.ohwr.org/attachments/1884/view-spec.pdf
2013-04-02 06:54:03 +00:00
|
|
|
#endif
|
2010-02-16 10:42:57 +00:00
|
|
|
/* Fit on Screen */
|
|
|
|
#if !defined( __WXMAC__ )
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkZoomAuto( wxT( "Zoom Auto" ), HK_ZOOM_AUTO, WXK_HOME );
|
2010-02-16 10:42:57 +00:00
|
|
|
#else
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkZoomAuto( wxT( "Zoom Auto" ), HK_ZOOM_AUTO, GR_KB_CTRL + '0' );
|
2010-02-16 10:42:57 +00:00
|
|
|
#endif
|
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkZoomCenter( wxT( "Zoom Center" ), HK_ZOOM_CENTER, WXK_F4 );
|
2010-02-16 10:42:57 +00:00
|
|
|
|
|
|
|
/* Refresh Screen */
|
|
|
|
#if !defined( __WXMAC__ )
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkZoomRedraw( wxT( "Zoom Redraw" ), HK_ZOOM_REDRAW, WXK_F3 );
|
2010-02-16 10:42:57 +00:00
|
|
|
#else
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkZoomRedraw( wxT( "Zoom Redraw" ), HK_ZOOM_REDRAW, GR_KB_CTRL + 'R' );
|
2010-02-16 10:42:57 +00:00
|
|
|
#endif
|
2010-01-19 20:43:44 +00:00
|
|
|
|
|
|
|
/* Zoom In */
|
|
|
|
#if !defined( __WXMAC__ )
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkZoomIn( wxT( "Zoom In" ), HK_ZOOM_IN, WXK_F1 );
|
2010-01-19 20:43:44 +00:00
|
|
|
#else
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkZoomIn( wxT( "Zoom In" ), HK_ZOOM_IN, GR_KB_CTRL + '+' );
|
2010-01-19 20:43:44 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Zoom Out */
|
|
|
|
#if !defined( __WXMAC__ )
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkZoomOut( wxT( "Zoom Out" ), HK_ZOOM_OUT, WXK_F2 );
|
2010-01-19 20:43:44 +00:00
|
|
|
#else
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkZoomOut( wxT( "Zoom Out" ), HK_ZOOM_OUT, GR_KB_CTRL + '-' );
|
2010-01-19 20:43:44 +00:00
|
|
|
#endif
|
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkHelp( wxT( "Help (this window)" ), HK_HELP, '?' );
|
2010-01-19 20:43:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Undo */
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkUndo( wxT( "Undo" ), HK_UNDO, GR_KB_CTRL + 'Z', (int) wxID_UNDO );
|
2010-01-19 20:43:44 +00:00
|
|
|
|
|
|
|
/* Redo */
|
|
|
|
#if !defined( __WXMAC__ )
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkRedo( wxT( "Redo" ), HK_REDO, GR_KB_CTRL + 'Y', (int) wxID_REDO );
|
2010-01-19 20:43:44 +00:00
|
|
|
#else
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkRedo( wxT( "Redo" ), HK_REDO,
|
|
|
|
GR_KB_SHIFT + GR_KB_CTRL + 'Z',
|
|
|
|
(int) wxID_REDO );
|
2010-01-19 20:43:44 +00:00
|
|
|
#endif
|
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkSwitchTrackWidthToNext( wxT( "Switch Track Width To Next" ),
|
|
|
|
HK_SWITCH_TRACK_WIDTH_TO_NEXT, 'W' );
|
2011-09-09 11:02:03 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkSwitchTrackWidthToPrevious( wxT( "Switch Track Width To Previous" ),
|
|
|
|
HK_SWITCH_TRACK_WIDTH_TO_PREVIOUS, 'W'
|
|
|
|
+ GR_KB_CTRL );
|
2011-09-09 11:02:03 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkSwitchGridToFastGrid1( wxT( "Switch Grid To Fast Grid1" ),
|
|
|
|
HK_SWITCH_GRID_TO_FASTGRID1, GR_KB_ALT + '1' );
|
2011-09-09 11:02:03 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkSwitchGridToFastGrid2( wxT( "Switch Grid To Fast Grid2" ),
|
|
|
|
HK_SWITCH_GRID_TO_FASTGRID2, GR_KB_ALT + '2' );
|
2011-09-09 11:02:03 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkSwitchGridToNext( wxT( "Switch Grid To Next" ),
|
|
|
|
HK_SWITCH_GRID_TO_NEXT, '`' );
|
2011-09-09 11:02:03 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkSwitchGridToPrevious( wxT( "Switch Grid To Previous" ),
|
|
|
|
HK_SWITCH_GRID_TO_PREVIOUS, '`' + GR_KB_CTRL );
|
2010-01-19 20:43:44 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkSwitchUnits( wxT( "Switch Units" ), HK_SWITCH_UNITS, 'U' + GR_KB_CTRL );
|
|
|
|
static EDA_HOTKEY HkTrackDisplayMode( wxT( "Track Display Mode" ),
|
|
|
|
HK_SWITCH_TRACK_DISPLAY_MODE, 'K' );
|
|
|
|
static EDA_HOTKEY HkAddModule( wxT( "Add Module" ), HK_ADD_MODULE, 'O' );
|
2011-09-09 11:02:03 +00:00
|
|
|
|
2011-09-07 09:27:02 +00:00
|
|
|
/* Record and play macros */
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkRecordMacros0( wxT( "Record Macro 0" ), HK_RECORD_MACROS_0, GR_KB_CTRL+'0' );
|
|
|
|
|
|
|
|
static EDA_HOTKEY HkCallMacros0( wxT( "Call Macro 0" ), HK_CALL_MACROS_0, '0' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkRecordMacros1( wxT( "Record Macro 1" ), HK_RECORD_MACROS_1, GR_KB_CTRL+'1' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkCallMacros1( wxT( "Call Macro 1" ), HK_CALL_MACROS_1, '1' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkRecordMacros2( wxT( "Record Macro 2" ), HK_RECORD_MACROS_2, GR_KB_CTRL+'2' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkCallMacros2( wxT( "Call Macro 2" ), HK_CALL_MACROS_2, '2' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkRecordMacros3( wxT( "Record Macro 3" ), HK_RECORD_MACROS_3, GR_KB_CTRL+'3' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkCallMacros3( wxT( "Call Macro 3" ), HK_CALL_MACROS_3, '3' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkRecordMacros4( wxT( "Record Macro 4" ), HK_RECORD_MACROS_4, GR_KB_CTRL+'4' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkCallMacros4( wxT( "Call Macro 4" ), HK_CALL_MACROS_4, '4' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkRecordMacros5( wxT( "Record Macro 5" ), HK_RECORD_MACROS_5, GR_KB_CTRL+'5' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkCallMacros5( wxT( "Call Macro 5" ), HK_CALL_MACROS_5, '5' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkRecordMacros6( wxT( "Record Macro 6" ), HK_RECORD_MACROS_6, GR_KB_CTRL+'6' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkCallMacros6( wxT( "Call Macro 6" ), HK_CALL_MACROS_6, '6' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkRecordMacros7( wxT( "Record Macro 7" ), HK_RECORD_MACROS_7, GR_KB_CTRL+'7' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkCallMacros7( wxT( "Call Macro 7" ), HK_CALL_MACROS_7, '7' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkRecordMacros8( wxT( "Record Macro 8" ), HK_RECORD_MACROS_8, GR_KB_CTRL+'8' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkCallMacros8( wxT( "Call Macro 8" ), HK_CALL_MACROS_8, '8' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkRecordMacros9( wxT( "Record Macro 9" ), HK_RECORD_MACROS_9, GR_KB_CTRL+'9' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
static EDA_HOTKEY HkCallMacros9( wxT( "Call Macro 9" ), HK_CALL_MACROS_9, '9' );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2007-08-20 10:55:09 +00:00
|
|
|
|
2007-09-10 04:51:01 +00:00
|
|
|
// List of common hotkey descriptors
|
2011-09-29 16:49:40 +00:00
|
|
|
EDA_HOTKEY* common_Hotkey_List[] =
|
2009-12-02 09:59:49 +00:00
|
|
|
{
|
|
|
|
&HkHelp, &HkZoomIn, &HkZoomOut,
|
|
|
|
&HkZoomRedraw, &HkZoomCenter, &HkZoomAuto,
|
2010-01-19 20:43:44 +00:00
|
|
|
&HkSwitchUnits, &HkResetLocalCoord,
|
|
|
|
&HkUndo, &HkRedo,
|
|
|
|
NULL
|
2009-12-02 09:59:49 +00:00
|
|
|
};
|
2007-08-20 10:55:09 +00:00
|
|
|
|
2011-09-30 18:15:37 +00:00
|
|
|
// List of hotkey descriptors for Pcbnew
|
2011-09-29 16:49:40 +00:00
|
|
|
EDA_HOTKEY* board_edit_Hotkey_List[] =
|
2009-12-02 09:59:49 +00:00
|
|
|
{
|
|
|
|
&HkTrackDisplayMode, &HkDelete,
|
2009-12-03 12:28:04 +00:00
|
|
|
&HkBackspace,
|
2009-12-08 13:41:20 +00:00
|
|
|
&HkAddNewTrack, &HkAddVia, &HkAddMicroVia,
|
2010-06-16 15:01:45 +00:00
|
|
|
&HkSwitchTrackPosture,
|
2011-08-30 09:42:42 +00:00
|
|
|
&HkDragTrackKeepSlope,
|
2012-07-04 19:50:47 +00:00
|
|
|
&HkPlaceItem, &HkCopyItem,
|
2012-05-30 17:38:52 +00:00
|
|
|
&HkEndTrack, &HkMoveItem, &HkFlipItem,
|
|
|
|
&HkRotateItem, &HkDragFootprint,
|
2009-12-02 09:59:49 +00:00
|
|
|
&HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, &HkSavefile,
|
2010-08-10 18:34:26 +00:00
|
|
|
&HkLoadfile, &HkFindItem, &HkEditBoardItem,
|
|
|
|
&HkSwitch2CopperLayer, &HkSwitch2InnerLayer1,
|
2009-12-02 09:59:49 +00:00
|
|
|
&HkSwitch2InnerLayer2, &HkSwitch2InnerLayer3, &HkSwitch2InnerLayer4,
|
|
|
|
&HkSwitch2InnerLayer5, &HkSwitch2InnerLayer6, &HkSwitch2ComponentLayer,
|
|
|
|
&HkSwitch2NextCopperLayer, &HkSwitch2PreviousCopperLayer,&HkAddModule,
|
2011-09-09 11:02:03 +00:00
|
|
|
&HkSwitchTrackWidthToNext, &HkSwitchTrackWidthToPrevious,&HkSwitchGridToFastGrid1,
|
|
|
|
&HkSwitchGridToFastGrid2, &HkSwitchGridToNext, &HkSwitchGridToPrevious,
|
|
|
|
&HkRecordMacros0, &HkCallMacros0, &HkRecordMacros1, &HkCallMacros1,
|
|
|
|
&HkRecordMacros2, &HkCallMacros2, &HkRecordMacros3, &HkCallMacros3,
|
|
|
|
&HkRecordMacros4, &HkCallMacros4, &HkRecordMacros5, &HkCallMacros5,
|
|
|
|
&HkRecordMacros6, &HkCallMacros6, &HkRecordMacros7, &HkCallMacros7,
|
|
|
|
&HkRecordMacros8, &HkCallMacros8, &HkRecordMacros9, &HkCallMacros9,
|
2012-02-19 17:33:06 +00:00
|
|
|
&HkSwitchHighContrastMode,
|
Introduction of Graphics Abstraction Layer based rendering for pcbnew.
New classes:
- VIEW - represents view that is seen by user, takes care of layer ordering & visibility and how it is displayed (which location, how much zoomed, etc.)
- VIEW_ITEM - Base class for every item that can be displayed on VIEW (the biggest change is that now it may be necessary to override ViewBBox & ViewGetLayers method for derived classes).
- EDA_DRAW_PANEL_GAL - Inherits after EDA_DRAW_PANEL, displays VIEW output, right now it is not editable (in opposite to usual EDA_DRAW_PANEL).
- GAL/OPENGL_GAL/CAIRO_GAL - Base Graphics Abstraction Layer class + two different flavours (Cairo is not fully supported yet), that offers methods to draw primitives using different libraries.
- WX_VIEW_CONTROLS - Controller for VIEW, handles user events, allows zooming, panning, etc.
- PAINTER/PCB_PAINTER - Classes that uses GAL interface to draw items (as you may have already guessed - PCB_PAINTER is a class for drawing PCB specific object, PAINTER is an abstract class). Its methods are invoked by VIEW, when an item has to be drawn. To display a new type of item - you need to implement draw(ITEM_TYPE*) method that draws it using GAL methods.
- STROKE_FONT - Implements stroke font drawing using GAL methods.
Most important changes to Kicad original code:
* EDA_ITEM now inherits from VIEW_ITEM, which is a base class for all drawable objects.
* EDA_DRAW_FRAME contains both usual EDA_DRAW_PANEL and new EDA_DRAW_PANEL_GAL, that can be switched anytime.
* There are some new layers for displaying multilayer pads, vias & pads holes (these are not shown yet on the right sidebar in pcbnew)
* Display order of layers is different than in previous versions (if you are curious - you may check m_galLayerOrder@pcbnew/basepcbframe.cpp). Preserving usual order would result in not very natural display, such as showing silkscreen texts on the bottom.
* Introduced new hotkey (Alt+F12) and new menu option (View->Switch canvas) for switching canvas during runtime.
* Some of classes (mostly derived from BOARD_ITEM) now includes ViewBBox & ViewGetLayers methods.
* Removed tools/class_painter.h, as now it is extended and included in source code.
Build changes:
* GAL-based rendering option is turned on by a new compilation CMake option KICAD_GAL.
* When compiling with CMake option KICAD_GAL=ON, GLEW and Cairo libraries are required.
* GAL-related code is compiled into a static library (common/libgal).
* Build with KICAD_GAL=OFF should not need any new libraries and should come out as a standard version of Kicad
Currently most of items in pcbnew can be displayed using OpenGL (to be done are DIMENSIONS and MARKERS).
More details about GAL can be found in: http://www.ohwr.org/attachments/1884/view-spec.pdf
2013-04-02 06:54:03 +00:00
|
|
|
#ifdef KICAD_GAL
|
2013-06-04 14:18:33 +00:00
|
|
|
&HkCanvasDefault, &HkCanvasCairo, &HkCanvasOpenGL, &HkCanvasOpenGLShaders,
|
Introduction of Graphics Abstraction Layer based rendering for pcbnew.
New classes:
- VIEW - represents view that is seen by user, takes care of layer ordering & visibility and how it is displayed (which location, how much zoomed, etc.)
- VIEW_ITEM - Base class for every item that can be displayed on VIEW (the biggest change is that now it may be necessary to override ViewBBox & ViewGetLayers method for derived classes).
- EDA_DRAW_PANEL_GAL - Inherits after EDA_DRAW_PANEL, displays VIEW output, right now it is not editable (in opposite to usual EDA_DRAW_PANEL).
- GAL/OPENGL_GAL/CAIRO_GAL - Base Graphics Abstraction Layer class + two different flavours (Cairo is not fully supported yet), that offers methods to draw primitives using different libraries.
- WX_VIEW_CONTROLS - Controller for VIEW, handles user events, allows zooming, panning, etc.
- PAINTER/PCB_PAINTER - Classes that uses GAL interface to draw items (as you may have already guessed - PCB_PAINTER is a class for drawing PCB specific object, PAINTER is an abstract class). Its methods are invoked by VIEW, when an item has to be drawn. To display a new type of item - you need to implement draw(ITEM_TYPE*) method that draws it using GAL methods.
- STROKE_FONT - Implements stroke font drawing using GAL methods.
Most important changes to Kicad original code:
* EDA_ITEM now inherits from VIEW_ITEM, which is a base class for all drawable objects.
* EDA_DRAW_FRAME contains both usual EDA_DRAW_PANEL and new EDA_DRAW_PANEL_GAL, that can be switched anytime.
* There are some new layers for displaying multilayer pads, vias & pads holes (these are not shown yet on the right sidebar in pcbnew)
* Display order of layers is different than in previous versions (if you are curious - you may check m_galLayerOrder@pcbnew/basepcbframe.cpp). Preserving usual order would result in not very natural display, such as showing silkscreen texts on the bottom.
* Introduced new hotkey (Alt+F12) and new menu option (View->Switch canvas) for switching canvas during runtime.
* Some of classes (mostly derived from BOARD_ITEM) now includes ViewBBox & ViewGetLayers methods.
* Removed tools/class_painter.h, as now it is extended and included in source code.
Build changes:
* GAL-based rendering option is turned on by a new compilation CMake option KICAD_GAL.
* When compiling with CMake option KICAD_GAL=ON, GLEW and Cairo libraries are required.
* GAL-related code is compiled into a static library (common/libgal).
* Build with KICAD_GAL=OFF should not need any new libraries and should come out as a standard version of Kicad
Currently most of items in pcbnew can be displayed using OpenGL (to be done are DIMENSIONS and MARKERS).
More details about GAL can be found in: http://www.ohwr.org/attachments/1884/view-spec.pdf
2013-04-02 06:54:03 +00:00
|
|
|
#endif
|
2009-12-03 19:11:34 +00:00
|
|
|
NULL
|
2009-12-02 09:59:49 +00:00
|
|
|
};
|
2007-08-20 10:55:09 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
// List of hotkey descriptors for the module editor
|
2011-09-29 16:49:40 +00:00
|
|
|
EDA_HOTKEY* module_edit_Hotkey_List[] = {
|
2010-08-29 17:55:53 +00:00
|
|
|
&HkMoveItem, &HkRotateItem, &HkEditBoardItem,
|
|
|
|
&HkDelete,
|
2012-09-12 11:11:30 +00:00
|
|
|
&HkSaveModule,
|
2010-08-29 17:55:53 +00:00
|
|
|
NULL
|
|
|
|
};
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-09-30 18:15:37 +00:00
|
|
|
// list of sections and corresponding hotkey list for Pcbnew
|
2010-11-24 15:10:33 +00:00
|
|
|
// (used to create an hotkey config file, and edit hotkeys )
|
2011-09-29 16:49:40 +00:00
|
|
|
struct EDA_HOTKEY_CONFIG g_Pcbnew_Editor_Hokeys_Descr[] = {
|
|
|
|
{ &g_CommonSectionTag, common_Hotkey_List, L"Common keys" },
|
|
|
|
{ &g_BoardEditorSectionTag, board_edit_Hotkey_List, L"Board editor keys" },
|
|
|
|
{ &g_ModuleEditSectionTag, module_edit_Hotkey_List, L"Footprint editor keys" },
|
|
|
|
{ NULL, NULL, NULL }
|
|
|
|
};
|
2007-09-06 11:52:26 +00:00
|
|
|
|
2010-11-24 15:10:33 +00:00
|
|
|
// list of sections and corresponding hotkey list for the board editor
|
|
|
|
// (used to list current hotkeys in the board editor)
|
2011-09-29 16:49:40 +00:00
|
|
|
struct EDA_HOTKEY_CONFIG g_Board_Editor_Hokeys_Descr[] = {
|
|
|
|
{ &g_CommonSectionTag, common_Hotkey_List, NULL },
|
|
|
|
{ &g_BoardEditorSectionTag, board_edit_Hotkey_List, NULL },
|
|
|
|
{ NULL, NULL, NULL }
|
|
|
|
};
|
2007-09-06 11:52:26 +00:00
|
|
|
|
2010-11-24 15:10:33 +00:00
|
|
|
// list of sections and corresponding hotkey list for the footprint editor
|
|
|
|
// (used to list current hotkeys in the module editor)
|
2011-09-29 16:49:40 +00:00
|
|
|
struct EDA_HOTKEY_CONFIG g_Module_Editor_Hokeys_Descr[] = {
|
|
|
|
{ &g_CommonSectionTag, common_Hotkey_List, NULL },
|
|
|
|
{ &g_ModuleEditSectionTag, module_edit_Hotkey_List, NULL },
|
|
|
|
{ NULL, NULL, NULL }
|
|
|
|
};
|
2012-02-09 20:33:38 +00:00
|
|
|
|
|
|
|
// list of sections and corresponding hotkey list for the footprint viewer
|
|
|
|
// (used to list current hotkeys in the module viewer)
|
|
|
|
struct EDA_HOTKEY_CONFIG g_Module_Viewer_Hokeys_Descr[] = {
|
|
|
|
{ &g_CommonSectionTag, common_Hotkey_List, NULL },
|
|
|
|
{ NULL, NULL, NULL }
|
|
|
|
};
|
|
|
|
|