From 36504b3071811c0d1ed088ccd3efe2898470661e Mon Sep 17 00:00:00 2001 From: Baranovskiy Konstantin Date: Wed, 30 May 2018 16:37:27 +0300 Subject: [PATCH] SymLibEditor: synced state of search tree tool button with its panel Button "Toggle the search tree" from left toolbar of Symbol Library Editor does not show actual state of visibility of the search tree panel. State of this button (checked or unchecked) changes on clicking only. Toggling panel visibility from menu does not make effect on tool state. Applied changes makes tool state (checkd/unchecked) synced with panel state (shown/hidden). --- eeschema/lib_edit_frame.cpp | 8 ++++++++ eeschema/lib_edit_frame.h | 1 + 2 files changed, 9 insertions(+) diff --git a/eeschema/lib_edit_frame.cpp b/eeschema/lib_edit_frame.cpp index 617acf2c49..83cfe58b60 100644 --- a/eeschema/lib_edit_frame.cpp +++ b/eeschema/lib_edit_frame.cpp @@ -199,6 +199,7 @@ BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, EDA_DRAW_FRAME ) EVT_UPDATE_UI_RANGE( ID_LIBEDIT_PIN_BUTT, ID_LIBEDIT_DELETE_ITEM_BUTT, LIB_EDIT_FRAME::OnUpdateEditingPart ) EVT_UPDATE_UI( ID_LIBEDIT_SHOW_ELECTRICAL_TYPE, LIB_EDIT_FRAME::OnUpdateElectricalType ) + EVT_UPDATE_UI( ID_LIBEDIT_SHOW_HIDE_SEARCH_TREE, LIB_EDIT_FRAME::OnUpdateSearchTreeTool ) END_EVENT_TABLE() @@ -489,6 +490,13 @@ void LIB_EDIT_FRAME::OnUpdateElectricalType( wxUpdateUIEvent& aEvent ) } +void LIB_EDIT_FRAME::OnUpdateSearchTreeTool( wxUpdateUIEvent& aEvent ) +{ + if( aEvent.GetEventObject() == m_optionsToolBar ) + aEvent.Check( IsSearchTreeShown() ); +} + + void LIB_EDIT_FRAME::OnUpdateEditingPart( wxUpdateUIEvent& aEvent ) { LIB_PART* part = GetCurPart(); diff --git a/eeschema/lib_edit_frame.h b/eeschema/lib_edit_frame.h index eb27bf7053..f496b3fcab 100644 --- a/eeschema/lib_edit_frame.h +++ b/eeschema/lib_edit_frame.h @@ -351,6 +351,7 @@ public: void OnUpdateDeMorganConvert( wxUpdateUIEvent& event ); void OnUpdateSelectAlias( wxUpdateUIEvent& event ); void OnUpdateElectricalType( wxUpdateUIEvent& aEvent ); + void OnUpdateSearchTreeTool( wxUpdateUIEvent& aEvent ); void UpdateAliasSelectList(); void UpdatePartSelectList();