Fix library tree updating bug present at least on OSX.
This commit is contained in:
parent
ffcf3b01fc
commit
102b530162
|
@ -189,7 +189,7 @@ void LIB_TREE::Regenerate( bool aKeepState )
|
||||||
|
|
||||||
// Store the state
|
// Store the state
|
||||||
if( aKeepState )
|
if( aKeepState )
|
||||||
m_unfilteredState = getState();
|
current = getState();
|
||||||
|
|
||||||
wxString filter = m_query_ctrl->GetValue();
|
wxString filter = m_query_ctrl->GetValue();
|
||||||
m_adapter->UpdateSearchString( filter );
|
m_adapter->UpdateSearchString( filter );
|
||||||
|
@ -197,7 +197,18 @@ void LIB_TREE::Regenerate( bool aKeepState )
|
||||||
|
|
||||||
// Restore the state
|
// Restore the state
|
||||||
if( aKeepState )
|
if( aKeepState )
|
||||||
setState( m_unfilteredState );
|
setState( current );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LIB_TREE::RefreshLibTree()
|
||||||
|
{
|
||||||
|
// Yes, this is an enormous hack. It should be replaced if anyone can figure out a better
|
||||||
|
// way to get the OSX version to re-fetch the text and attributes from the dataModel for
|
||||||
|
// each visible item.
|
||||||
|
int width = m_tree_ctrl->GetColumn( 0 )->GetWidth();
|
||||||
|
m_tree_ctrl->GetColumn( 0 )->SetWidth( width + 1 );
|
||||||
|
m_tree_ctrl->GetColumn( 0 )->SetWidth( width );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,11 @@ public:
|
||||||
*/
|
*/
|
||||||
void Regenerate( bool aKeepState );
|
void Regenerate( bool aKeepState );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Refreshes the tree (mainly to update highlighting and asterisking)
|
||||||
|
*/
|
||||||
|
void RefreshLibTree();
|
||||||
|
|
||||||
void SetFocus() override;
|
void SetFocus() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -164,8 +169,6 @@ protected:
|
||||||
wxTextCtrl* m_query_ctrl;
|
wxTextCtrl* m_query_ctrl;
|
||||||
wxDataViewCtrl* m_tree_ctrl;
|
wxDataViewCtrl* m_tree_ctrl;
|
||||||
wxHtmlWindow* m_details_ctrl;
|
wxHtmlWindow* m_details_ctrl;
|
||||||
|
|
||||||
STATE m_unfilteredState;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
///> Custom event sent when a new component is preselected
|
///> Custom event sent when a new component is preselected
|
||||||
|
|
|
@ -428,7 +428,7 @@ void LIB_EDIT_FRAME::OnModify()
|
||||||
GetScreen()->SetModify();
|
GetScreen()->SetModify();
|
||||||
storeCurrentPart();
|
storeCurrentPart();
|
||||||
|
|
||||||
m_treePane->GetLibTree()->Refresh();
|
m_treePane->GetLibTree()->RefreshLibTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -266,7 +266,7 @@ bool LIB_EDIT_FRAME::LoadOneLibraryPartAux( LIB_ALIAS* aEntry, const wxString& a
|
||||||
void LIB_EDIT_FRAME::SaveAll()
|
void LIB_EDIT_FRAME::SaveAll()
|
||||||
{
|
{
|
||||||
saveAllLibraries( false );
|
saveAllLibraries( false );
|
||||||
m_treePane->Refresh();
|
m_treePane->GetLibTree()->RefreshLibTree();
|
||||||
refreshSchematic();
|
refreshSchematic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,7 +365,7 @@ void LIB_EDIT_FRAME::Save()
|
||||||
m_libMgr->ClearPartModified( partName, libName );
|
m_libMgr->ClearPartModified( partName, libName );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_treePane->Refresh();
|
m_treePane->GetLibTree()->RefreshLibTree();
|
||||||
refreshSchematic();
|
refreshSchematic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -381,7 +381,7 @@ void LIB_EDIT_FRAME::SaveAs()
|
||||||
else
|
else
|
||||||
savePartAs();
|
savePartAs();
|
||||||
|
|
||||||
m_treePane->Refresh();
|
m_treePane->GetLibTree()->RefreshLibTree();
|
||||||
refreshSchematic();
|
refreshSchematic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,10 @@ void SYMBOL_TREE_PANE::Regenerate()
|
||||||
void SYMBOL_TREE_PANE::onComponentSelected( wxCommandEvent& aEvent )
|
void SYMBOL_TREE_PANE::onComponentSelected( wxCommandEvent& aEvent )
|
||||||
{
|
{
|
||||||
m_libEditFrame->GetToolManager()->RunAction( EE_ACTIONS::editSymbol, true );
|
m_libEditFrame->GetToolManager()->RunAction( EE_ACTIONS::editSymbol, true );
|
||||||
|
|
||||||
// Make sure current-part highlighting doesn't get lost in selection highlighting
|
// Make sure current-part highlighting doesn't get lost in selection highlighting
|
||||||
m_tree->Unselect();
|
m_tree->Unselect();
|
||||||
|
|
||||||
|
// Turn off any previous current-part highlighting
|
||||||
|
m_tree->RefreshLibTree();
|
||||||
}
|
}
|
||||||
|
|
|
@ -581,7 +581,7 @@ void FOOTPRINT_EDIT_FRAME::OnModify()
|
||||||
{
|
{
|
||||||
PCB_BASE_FRAME::OnModify();
|
PCB_BASE_FRAME::OnModify();
|
||||||
Update3DView( false );
|
Update3DView( false );
|
||||||
m_treePane->GetLibTree()->Refresh();
|
m_treePane->GetLibTree()->RefreshLibTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ void FOOTPRINT_EDIT_FRAME::LoadModuleFromLibrary( LIB_ID aFPID)
|
||||||
|
|
||||||
m_treePane->GetLibTree()->ExpandLibId( aFPID );
|
m_treePane->GetLibTree()->ExpandLibId( aFPID );
|
||||||
m_treePane->GetLibTree()->CenterLibId( aFPID );
|
m_treePane->GetLibTree()->CenterLibId( aFPID );
|
||||||
m_treePane->GetLibTree()->Refresh(); // update highlighting
|
m_treePane->GetLibTree()->RefreshLibTree(); // update highlighting
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_treePane->GetLibTree()->Refresh();
|
m_treePane->GetLibTree()->RefreshLibTree();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_MODEDIT_SAVE_AS:
|
case ID_MODEDIT_SAVE_AS:
|
||||||
|
@ -301,7 +301,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
SyncLibraryTree( true );
|
SyncLibraryTree( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_treePane->GetLibTree()->Refresh();
|
m_treePane->GetLibTree()->RefreshLibTree();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_ADD_FOOTPRINT_TO_BOARD:
|
case ID_ADD_FOOTPRINT_TO_BOARD:
|
||||||
|
@ -357,7 +357,7 @@ void FOOTPRINT_EDIT_FRAME::editFootprintProperties( MODULE* aModule )
|
||||||
// therefore not yet in tree.
|
// therefore not yet in tree.
|
||||||
{
|
{
|
||||||
static_cast<LIB_TREE_NODE_LIB_ID*>( treeItem.GetID() )->Update( &footprintInfo );
|
static_cast<LIB_TREE_NODE_LIB_ID*>( treeItem.GetID() )->Update( &footprintInfo );
|
||||||
m_treePane->GetLibTree()->Refresh();
|
m_treePane->GetLibTree()->RefreshLibTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTitle(); // in case of a name change...
|
updateTitle(); // in case of a name change...
|
||||||
|
|
|
@ -157,7 +157,7 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule )
|
||||||
Update3DView( true );
|
Update3DView( true );
|
||||||
updateView();
|
updateView();
|
||||||
GetCanvas()->Refresh();
|
GetCanvas()->Refresh();
|
||||||
m_treePane->GetLibTree()->Refresh(); // update any previously-highlighted items
|
m_treePane->GetLibTree()->RefreshLibTree(); // update any previously-highlighted items
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue