Add high contrast hotkey to GerbView

Also add all existing hotkeys to menubar.

Fixes: lp:1795388
https://bugs.launchpad.net/kicad/+bug/1795388
This commit is contained in:
Michael 2019-03-03 23:45:52 +00:00 committed by Seth Hillbrand
parent 643d884fde
commit de706635cc
3 changed files with 27 additions and 12 deletions

View File

@ -69,6 +69,8 @@ static EDA_HOTKEY HkHelp( _HKI( "List Hotkeys" ), HK_HELP, GR_KB_CTRL + WXK_F1
static EDA_HOTKEY HkSwitchUnits( _HKI( "Switch Units" ), HK_SWITCH_UNITS, 'U' );
static EDA_HOTKEY HkResetLocalCoord( _HKI( "Reset Local Coordinates" ),
HK_RESET_LOCAL_COORD, ' ' );
static EDA_HOTKEY HkSwitchHighContrastMode( _HKI( "Toggle High Contrast Mode" ),
HK_SWITCH_HIGHCONTRAST_MODE, 'H' + GR_KB_CTRL );
static EDA_HOTKEY HkLinesDisplayMode( _HKI( "Gbr Lines Display Mode" ),
HK_GBR_LINES_DISPLAY_MODE, 'L' );
@ -115,6 +117,7 @@ EDA_HOTKEY* gerbviewHotkeyList[] = {
&HkZoomAuto, &HkZoomSelection, &HkSwitchUnits, &HkResetLocalCoord,
&HkLinesDisplayMode, &HkFlashedDisplayMode, &HkPolygonDisplayMode,
&HkDCodesDisplayMode, &HkNegativeObjDisplayMode,
&HkSwitchHighContrastMode,
&HkSwitch2NextCopperLayer,
&HkSwitch2PreviousCopperLayer,
&HkCanvasDefault,
@ -237,6 +240,11 @@ bool GERBVIEW_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
m_canvas->Refresh();
break;
case HK_SWITCH_HIGHCONTRAST_MODE:
CHANGE( m_DisplayOptions.m_HighContrastMode );
m_canvas->Refresh();
break;
case HK_SWITCH_LAYER_TO_PREVIOUS:
if( GetActiveLayer() > 0 )
{

View File

@ -41,6 +41,7 @@ enum hotkey_id_commnand {
HK_GBR_POLYGON_DISPLAY_MODE,
HK_GBR_NEGATIVE_DISPLAY_ONOFF,
HK_GBR_DCODE_DISPLAY_ONOFF,
HK_SWITCH_HIGHCONTRAST_MODE,
HK_SWITCH_LAYER_TO_NEXT,
HK_SWITCH_LAYER_TO_PREVIOUS,
HK_CANVAS_LEGACY,

View File

@ -246,24 +246,29 @@ void GERBVIEW_FRAME::ReCreateMenuBar()
viewMenu->AppendSeparator();
AddMenuItem( viewMenu, ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH,
_( "Sketch F&lashed Items" ),_( "Show flashed items in outline mode" ),
text = AddHotkeyName( _( "Sketch F&lashed Items" ), GerbviewHokeysDescr, HK_GBR_FLASHED_DISPLAY_MODE );
AddMenuItem( viewMenu, ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH, text,
_( "Show flashed items in outline mode" ),
KiBitmap( pad_sketch_xpm ), wxITEM_CHECK );
AddMenuItem( viewMenu, ID_TB_OPTIONS_SHOW_LINES_SKETCH,
_( "Sketch &Lines" ),_( "Show lines in outline mode" ),
text = AddHotkeyName( _( "Sketch &Lines" ), GerbviewHokeysDescr, HK_GBR_LINES_DISPLAY_MODE );
AddMenuItem( viewMenu, ID_TB_OPTIONS_SHOW_LINES_SKETCH, text,
_( "Show lines in outline mode" ),
KiBitmap( showtrack_xpm ), wxITEM_CHECK );
AddMenuItem( viewMenu, ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH,
_( "Sketch Pol&ygons" ),_( "Show polygons in outline mode" ),
text = AddHotkeyName( _( "Sketch Pol&ygons" ), GerbviewHokeysDescr, HK_GBR_POLYGON_DISPLAY_MODE );
AddMenuItem( viewMenu, ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, text,
_( "Show polygons in outline mode" ),
KiBitmap( opt_show_polygon_xpm ), wxITEM_CHECK );
AddMenuItem( viewMenu, ID_TB_OPTIONS_SHOW_DCODES,
_( "Show &DCodes" ), _( "Show or hide DCodes" ),
text = AddHotkeyName( _( "Show &DCodes" ), GerbviewHokeysDescr, HK_GBR_DCODE_DISPLAY_ONOFF );
AddMenuItem( viewMenu, ID_TB_OPTIONS_SHOW_DCODES, text,
_( "Show or hide DCodes" ),
KiBitmap( show_dcodenumber_xpm ), wxITEM_CHECK );
AddMenuItem( viewMenu, ID_TB_OPTIONS_SHOW_NEGATIVE_ITEMS,
_( "Show &Negative Objects" ), _( "Show negative objects in ghost color" ),
text = AddHotkeyName( _( "Show &Negative Objects" ), GerbviewHokeysDescr, HK_GBR_NEGATIVE_DISPLAY_ONOFF );
AddMenuItem( viewMenu, ID_TB_OPTIONS_SHOW_NEGATIVE_ITEMS, text,
_( "Show negative objects in ghost color" ),
KiBitmap( gerbview_show_negative_objects_xpm ), wxITEM_CHECK );
if( IsGalCanvasActive() )
@ -272,8 +277,9 @@ void GERBVIEW_FRAME::ReCreateMenuBar()
_( "Show in Differential Mode" ), _( "Show layers in differential mode" ),
KiBitmap( gbr_select_mode2_xpm ), wxITEM_CHECK );
AddMenuItem( viewMenu, ID_TB_OPTIONS_HIGH_CONTRAST_MODE,
_( "Show in High Contrast" ), _( "Show in high contrast mode" ),
text = AddHotkeyName( _( "Show in High Contrast" ), GerbviewHokeysDescr, HK_SWITCH_HIGHCONTRAST_MODE );
AddMenuItem( viewMenu, ID_TB_OPTIONS_HIGH_CONTRAST_MODE, text,
_( "Show in high contrast mode" ),
KiBitmap( contrast_mode_xpm ), wxITEM_CHECK );
}
else