|
|
@ -31,30 +31,9 @@ SCH_SEARCH_PANE::SCH_SEARCH_PANE( SCH_EDIT_FRAME* aFrame ) : |
|
|
|
if( m_sch != nullptr ) |
|
|
|
m_sch->AddListener( this ); |
|
|
|
|
|
|
|
m_schFrame->Bind( EDA_EVT_UNITS_CHANGED, [&]( wxCommandEvent& aEvent ) |
|
|
|
{ |
|
|
|
ClearAllResults(); |
|
|
|
RefreshSearch(); |
|
|
|
aEvent.Skip(); |
|
|
|
} ); |
|
|
|
|
|
|
|
m_schFrame->Bind( EDA_EVT_SCHEMATIC_CHANGED, [&]( wxCommandEvent& aEvent ) |
|
|
|
{ |
|
|
|
m_sch = &m_schFrame->Schematic(); |
|
|
|
|
|
|
|
if( m_sch != nullptr ) |
|
|
|
m_sch->AddListener( this ); |
|
|
|
|
|
|
|
ClearAllResults(); |
|
|
|
RefreshSearch(); |
|
|
|
aEvent.Skip(); |
|
|
|
} ); |
|
|
|
|
|
|
|
m_schFrame->Bind( EDA_EVT_SCHEMATIC_CHANGING, [&]( wxCommandEvent& aEvent ) |
|
|
|
{ |
|
|
|
ClearAllResults(); |
|
|
|
aEvent.Skip(); |
|
|
|
} ); |
|
|
|
m_schFrame->Bind( EDA_EVT_UNITS_CHANGED, &SCH_SEARCH_PANE::onUnitsChanged, this ); |
|
|
|
m_schFrame->Bind( EDA_EVT_SCHEMATIC_CHANGING, &SCH_SEARCH_PANE::onSchChanging, this ); |
|
|
|
m_schFrame->Bind( EDA_EVT_SCHEMATIC_CHANGED, &SCH_SEARCH_PANE::onSchChanged, this ); |
|
|
|
|
|
|
|
wxFont infoFont = KIUI::GetDockedPaneFont( this ); |
|
|
|
SetFont( infoFont ); |
|
|
@ -68,6 +47,42 @@ SCH_SEARCH_PANE::SCH_SEARCH_PANE( SCH_EDIT_FRAME* aFrame ) : |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
SCH_SEARCH_PANE::~SCH_SEARCH_PANE() |
|
|
|
{ |
|
|
|
m_schFrame->Unbind( EDA_EVT_UNITS_CHANGED, &SCH_SEARCH_PANE::onUnitsChanged, this ); |
|
|
|
m_schFrame->Unbind( EDA_EVT_SCHEMATIC_CHANGING, &SCH_SEARCH_PANE::onSchChanging, this ); |
|
|
|
m_schFrame->Unbind( EDA_EVT_SCHEMATIC_CHANGED, &SCH_SEARCH_PANE::onSchChanged, this ); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SCH_SEARCH_PANE::onUnitsChanged( wxCommandEvent& event ) |
|
|
|
{ |
|
|
|
ClearAllResults(); |
|
|
|
RefreshSearch(); |
|
|
|
event.Skip(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SCH_SEARCH_PANE::onSchChanging( wxCommandEvent& event ) |
|
|
|
{ |
|
|
|
ClearAllResults(); |
|
|
|
event.Skip(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SCH_SEARCH_PANE::onSchChanged( wxCommandEvent& event ) |
|
|
|
{ |
|
|
|
m_sch = &m_schFrame->Schematic(); |
|
|
|
|
|
|
|
if( m_sch != nullptr ) |
|
|
|
m_sch->AddListener( this ); |
|
|
|
|
|
|
|
ClearAllResults(); |
|
|
|
RefreshSearch(); |
|
|
|
event.Skip(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SCH_SEARCH_PANE::OnSchItemsAdded( SCHEMATIC& aBoard, std::vector<SCH_ITEM*>& aBoardItems ) |
|
|
|
{ |
|
|
|
if( !IsShownOnScreen() ) |
|
|
|