From 1ca3b2c76891b3e04d94b6dafa4a43779c73ef48 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 9 Jan 2019 14:38:44 +0100 Subject: [PATCH] Eeschema: DIALOG_FIELDS_EDITOR_GLOBAL: fix missing clearing old highlight when highlighting a new symbol or exiting the dialog --- .../dialogs/dialog_fields_editor_global.cpp | 8 + .../dialog_fields_editor_global_base.fbp | 1072 ++++++++--------- 2 files changed, 544 insertions(+), 536 deletions(-) diff --git a/eeschema/dialogs/dialog_fields_editor_global.cpp b/eeschema/dialogs/dialog_fields_editor_global.cpp index 625ae31afa..d2616ea954 100644 --- a/eeschema/dialogs/dialog_fields_editor_global.cpp +++ b/eeschema/dialogs/dialog_fields_editor_global.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -770,6 +771,10 @@ DIALOG_FIELDS_EDITOR_GLOBAL::~DIALOG_FIELDS_EDITOR_GLOBAL() m_grid->PopEventHandler( true ); // we gave ownership of m_dataModel to the wxGrid... + + // Clear highligted symbols, if any + m_parent->GetCanvas()->GetView()->HighlightItem( nullptr, nullptr ); + m_parent->GetCanvas()->Refresh(); } @@ -972,6 +977,9 @@ void DIALOG_FIELDS_EDITOR_GLOBAL::OnTableCellClick( wxGridEvent& event ) { if( event.GetCol() == REFERENCE ) { + // Clear highligted symbols, if any + m_parent->GetCanvas()->GetView()->HighlightItem( nullptr, nullptr ); + m_dataModel->ExpandCollapseRow( event.GetRow() ); std::vector refs = m_dataModel->GetRowReferences( event.GetRow() ); diff --git a/eeschema/dialogs/dialog_fields_editor_global_base.fbp b/eeschema/dialogs/dialog_fields_editor_global_base.fbp index 71bc086e96..6e4c89459d 100644 --- a/eeschema/dialogs/dialog_fields_editor_global_base.fbp +++ b/eeschema/dialogs/dialog_fields_editor_global_base.fbp @@ -1,8 +1,8 @@ - + - + C++ 1 source_name @@ -16,9 +16,9 @@ none 1 dialog_fields_editor_global_base - + . - + 1 1 1 @@ -29,65 +29,65 @@ 0 wxAUI_MGR_DEFAULT - + wxBOTH - + 1 1 impl_virtual - - - + + + 0 wxID_ANY - + -1,-1 DIALOG_FIELDS_EDITOR_GLOBAL_BASE - + -1,-1 wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Symbol Fields - - - - - - - - - - - - - + + + + + + + + + + + + + OnClose - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + -1,-1 bMainSizer @@ -102,162 +102,162 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 200 - + 0 -1,-1 1 m_splitter1 1 - - + + protected 1 - + Resizable 0.0 -1 -1 1 - + wxSPLIT_VERTICAL wxSP_LIVE_UPDATE - + 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 m_leftPanel 1 - - + + protected 1 - + Resizable 1 - - + + 0 - - - + + + wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + bLeftSizer wxVERTICAL none @@ -266,7 +266,7 @@ wxALL|wxBOTTOM|wxEXPAND|wxTOP 0 - + bGroupSizer wxHORIZONTAL none @@ -279,83 +279,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 OPT_GROUP_COMPONENTS Group symbols - + 0 - - + + 0 - + 1 m_groupComponentsBox 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Group components together based on common properties - + wxFILTER_NONE wxDefaultValidator - - - - - + + + + + OnGroupComponentsToggled - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -377,88 +377,88 @@ 1 1 1 - - - - - - - - + + + + + + + + 1 0 1 - + 1 0 0 - + Dock 0 Left 1 - + 1 - - + + 0 0 - + wxID_ANY Refresh Grouping - + 0 - - + + 0 30,30 1 m_bRefresh 1 - - + + protected 1 - + Resizable - + 1 - - + + ; forward_declare 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnRegroupComponents - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -468,67 +468,67 @@ wxALL|wxEXPAND 1 - - + + 1 1 - - + + 0 wxID_ANY - + -1,220 m_fieldsCtrl protected - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + OnColumnItemToggled - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + OnSizeFieldList - + @@ -540,17 +540,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -558,65 +558,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Add Field... - + 0 - - + + 0 - + 1 m_addFieldButton 1 - - + + protected 1 - + Resizable 1 - - + + ; forward_declare 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnAddField - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -628,77 +628,77 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 m_panel4 1 - - + + protected 1 - + Resizable 1 - - + + 0 - - - + + + wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + bRightSizer wxVERTICAL none @@ -711,30 +711,30 @@ 1 1 1 - - - - + + + + 0 0 - - - + + + 1 - - + + wxALIGN_LEFT - + wxALIGN_TOP 0 1 - wxALIGN_CENTRE + wxALIGN_CENTER 20 - - wxALIGN_CENTRE + + wxALIGN_CENTER 5 - - + + 1 0 Dock @@ -746,103 +746,103 @@ 0 1 1 - + 1 - - + + 1 0 0 wxID_ANY - - - + + + 0 0 - + 0 - - + + 0 400,240 1 m_grid 1 - - + + protected 1 - + Resizable - wxALIGN_CENTRE + wxALIGN_CENTER 0 - - wxALIGN_CENTRE - + + wxALIGN_CENTER + 5 1 - + WX_GRID; widgets/wx_grid.h; forward_declare 0 - - - - - - - + + + + + + + OnTableValueChanged OnTableCellClick OnTableCellClick OnTableItemContextMenu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -855,7 +855,7 @@ wxEXPAND 0 - + bButtonsSizer wxHORIZONTAL none @@ -878,17 +878,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -896,65 +896,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Apply, Save Schematic && Continue - + 0 - - + + 0 - + 1 m_button1 1 - - + + protected 1 - + Resizable 1 - - + + ; forward_declare 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnSaveAndContinue - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -970,17 +970,17 @@ 1 0 0 - + m_sdbSizer1 protected - + OnCancel - - - - - - + + + + + +