From b90d86aa2d0d1b24d749748fe1f49e3efaed0eee Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 17 Sep 2017 21:26:07 -0400 Subject: [PATCH] Properly update toolbar buttons on application start --- gerbview/events_called_functions.cpp | 2 ++ gerbview/gerbview_frame.h | 2 ++ gerbview/toolbars_gerber.cpp | 12 ++++++++++++ 3 files changed, 16 insertions(+) diff --git a/gerbview/events_called_functions.cpp b/gerbview/events_called_functions.cpp index 3108152795..61c1bf3b89 100644 --- a/gerbview/events_called_functions.cpp +++ b/gerbview/events_called_functions.cpp @@ -162,6 +162,8 @@ BEGIN_EVENT_TABLE( GERBVIEW_FRAME, EDA_DRAW_FRAME ) EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_NEGATIVE_ITEMS, GERBVIEW_FRAME::OnUpdateShowNegativeItems ) EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR, GERBVIEW_FRAME::OnUpdateShowLayerManager ) + EVT_UPDATE_UI( ID_TB_OPTIONS_DIFF_MODE, GERBVIEW_FRAME::OnUpdateDiffMode ) + EVT_UPDATE_UI( ID_TB_OPTIONS_HIGH_CONTRAST_MODE, GERBVIEW_FRAME::OnUpdateHighContrastMode ) EVT_UPDATE_UI( ID_TOOLBARH_GERBER_SELECT_ACTIVE_DCODE, GERBVIEW_FRAME::OnUpdateSelectDCode ) EVT_UPDATE_UI( ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER, diff --git a/gerbview/gerbview_frame.h b/gerbview/gerbview_frame.h index a25b18f1a6..8bbc8202f6 100644 --- a/gerbview/gerbview_frame.h +++ b/gerbview/gerbview_frame.h @@ -563,6 +563,8 @@ public: void OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent ); void OnUpdateSelectDCode( wxUpdateUIEvent& aEvent ); void OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent ); + void OnUpdateDiffMode( wxUpdateUIEvent& aEvent ); + void OnUpdateHighContrastMode( wxUpdateUIEvent& aEvent ); /** * Function BlockCommand diff --git a/gerbview/toolbars_gerber.cpp b/gerbview/toolbars_gerber.cpp index 43384e7e0c..d4e60d44b4 100644 --- a/gerbview/toolbars_gerber.cpp +++ b/gerbview/toolbars_gerber.cpp @@ -541,6 +541,18 @@ void GERBVIEW_FRAME::OnUpdateShowNegativeItems( wxUpdateUIEvent& aEvent ) } +void GERBVIEW_FRAME::OnUpdateDiffMode( wxUpdateUIEvent& aEvent ) +{ + aEvent.Check( m_DisplayOptions.m_DiffMode ); +} + + +void GERBVIEW_FRAME::OnUpdateHighContrastMode( wxUpdateUIEvent& aEvent ) +{ + aEvent.Check( m_DisplayOptions.m_HighContrastMode ); +} + + void GERBVIEW_FRAME::OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent ) { aEvent.Check( m_show_layer_manager_tools );