Get rid of annoying double-draw when choosing a new symbol.
This commit is contained in:
parent
34be4b4666
commit
c611f62ade
|
@ -669,7 +669,7 @@ wxString SYMBOL_EDIT_FRAME::SetCurLib( const wxString& aLibNickname )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SYMBOL_EDIT_FRAME::SetCurPart( LIB_PART* aPart )
|
void SYMBOL_EDIT_FRAME::SetCurPart( LIB_PART* aPart, bool aUpdateZoom )
|
||||||
{
|
{
|
||||||
m_toolManager->RunAction( EE_ACTIONS::clearSelection, true );
|
m_toolManager->RunAction( EE_ACTIONS::clearSelection, true );
|
||||||
GetCanvas()->GetView()->Clear();
|
GetCanvas()->GetView()->Clear();
|
||||||
|
@ -690,6 +690,7 @@ void SYMBOL_EDIT_FRAME::SetCurPart( LIB_PART* aPart )
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString partName = m_my_part ? m_my_part->GetName() : wxString();
|
wxString partName = m_my_part ? m_my_part->GetName() : wxString();
|
||||||
|
bool isAlias = !IsSymbolFromSchematic() && m_my_part && m_my_part->IsAlias();
|
||||||
|
|
||||||
// retain in case this wxFrame is re-opened later on the same PROJECT
|
// retain in case this wxFrame is re-opened later on the same PROJECT
|
||||||
Prj().SetRString( PROJECT::SCH_LIBEDIT_CUR_PART, partName );
|
Prj().SetRString( PROJECT::SCH_LIBEDIT_CUR_PART, partName );
|
||||||
|
@ -698,7 +699,18 @@ void SYMBOL_EDIT_FRAME::SetCurPart( LIB_PART* aPart )
|
||||||
m_SyncPinEdit = aPart && aPart->IsRoot() && aPart->IsMulti() && !aPart->UnitsLocked();
|
m_SyncPinEdit = aPart && aPart->IsRoot() && aPart->IsMulti() && !aPart->UnitsLocked();
|
||||||
|
|
||||||
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||||
RebuildView();
|
|
||||||
|
GetRenderSettings()->m_ShowUnit = m_unit;
|
||||||
|
GetRenderSettings()->m_ShowConvert = m_convert;
|
||||||
|
GetRenderSettings()->m_ShowDisabled = isAlias;
|
||||||
|
GetCanvas()->DisplayComponent( m_my_part );
|
||||||
|
GetCanvas()->GetView()->HideWorksheet();
|
||||||
|
GetCanvas()->GetView()->ClearHiddenFlags();
|
||||||
|
|
||||||
|
if( aUpdateZoom )
|
||||||
|
m_toolManager->RunAction( ACTIONS::zoomFitScreen, true );
|
||||||
|
|
||||||
|
GetCanvas()->Refresh();
|
||||||
|
|
||||||
WX_INFOBAR* infobar = GetInfoBar();
|
WX_INFOBAR* infobar = GetInfoBar();
|
||||||
|
|
||||||
|
@ -711,7 +723,7 @@ void SYMBOL_EDIT_FRAME::SetCurPart( LIB_PART* aPart )
|
||||||
infobar->RemoveAllButtons();
|
infobar->RemoveAllButtons();
|
||||||
infobar->ShowMessage( msg, wxICON_INFORMATION );
|
infobar->ShowMessage( msg, wxICON_INFORMATION );
|
||||||
}
|
}
|
||||||
else if( m_my_part && m_my_part->IsAlias() )
|
else if( isAlias )
|
||||||
{
|
{
|
||||||
wxString parentPartName = m_my_part->GetParent().lock()->GetName();
|
wxString parentPartName = m_my_part->GetParent().lock()->GetName();
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
@ -1041,7 +1053,7 @@ void SYMBOL_EDIT_FRAME::emptyScreen()
|
||||||
{
|
{
|
||||||
m_treePane->GetLibTree()->Unselect();
|
m_treePane->GetLibTree()->Unselect();
|
||||||
SetCurLib( wxEmptyString );
|
SetCurLib( wxEmptyString );
|
||||||
SetCurPart( nullptr );
|
SetCurPart( nullptr, false );
|
||||||
SetScreen( m_dummyScreen );
|
SetScreen( m_dummyScreen );
|
||||||
ClearUndoRedoList();
|
ClearUndoRedoList();
|
||||||
m_toolManager->RunAction( ACTIONS::zoomFitScreen, true );
|
m_toolManager->RunAction( ACTIONS::zoomFitScreen, true );
|
||||||
|
@ -1259,7 +1271,7 @@ void SYMBOL_EDIT_FRAME::LoadSymbolFromSchematic( const std::unique_ptr<LIB_PART>
|
||||||
wxCHECK( symbol, /* void */ );
|
wxCHECK( symbol, /* void */ );
|
||||||
|
|
||||||
if( m_my_part )
|
if( m_my_part )
|
||||||
SetCurPart( nullptr );
|
SetCurPart( nullptr, false );
|
||||||
|
|
||||||
m_isSymbolFromSchematic = true;
|
m_isSymbolFromSchematic = true;
|
||||||
m_reference = aReference;
|
m_reference = aReference;
|
||||||
|
@ -1270,9 +1282,8 @@ void SYMBOL_EDIT_FRAME::LoadSymbolFromSchematic( const std::unique_ptr<LIB_PART>
|
||||||
SCH_SCREEN* tmpScreen = new SCH_SCREEN();
|
SCH_SCREEN* tmpScreen = new SCH_SCREEN();
|
||||||
|
|
||||||
SetScreen( tmpScreen );
|
SetScreen( tmpScreen );
|
||||||
SetCurPart( symbol.release() );
|
SetCurPart( symbol.release(), true );
|
||||||
|
|
||||||
m_toolManager->RunAction( ACTIONS::zoomFitScreen, true );
|
|
||||||
ReCreateMenuBar();
|
ReCreateMenuBar();
|
||||||
ReCreateHToolbar();
|
ReCreateHToolbar();
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Take ownership of aPart and notes that it is the one currently being edited.
|
* Take ownership of aPart and notes that it is the one currently being edited.
|
||||||
*/
|
*/
|
||||||
void SetCurPart( LIB_PART* aPart );
|
void SetCurPart( LIB_PART* aPart, bool aUpdateZoom );
|
||||||
|
|
||||||
SYMBOL_LIBRARY_MANAGER& GetLibManager();
|
SYMBOL_LIBRARY_MANAGER& GetLibManager();
|
||||||
|
|
||||||
|
|
|
@ -247,7 +247,7 @@ bool SYMBOL_EDIT_FRAME::LoadOneLibraryPartAux( LIB_PART* aEntry, const wxString&
|
||||||
SCH_SCREEN* part_screen = m_libMgr->GetScreen( lib_part->GetName(), aLibrary );
|
SCH_SCREEN* part_screen = m_libMgr->GetScreen( lib_part->GetName(), aLibrary );
|
||||||
|
|
||||||
SetScreen( part_screen );
|
SetScreen( part_screen );
|
||||||
SetCurPart( new LIB_PART( *lib_part ) );
|
SetCurPart( new LIB_PART( *lib_part ), true );
|
||||||
SetCurLib( aLibrary );
|
SetCurLib( aLibrary );
|
||||||
|
|
||||||
if( rebuildMenuAndToolbar )
|
if( rebuildMenuAndToolbar )
|
||||||
|
@ -257,7 +257,6 @@ bool SYMBOL_EDIT_FRAME::LoadOneLibraryPartAux( LIB_PART* aEntry, const wxString&
|
||||||
GetInfoBar()->Dismiss();
|
GetInfoBar()->Dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_toolManager->RunAction( ACTIONS::zoomFitScreen, true );
|
|
||||||
updateTitle();
|
updateTitle();
|
||||||
RebuildSymbolUnitsList();
|
RebuildSymbolUnitsList();
|
||||||
SetShowDeMorgan( GetCurPart()->HasConversion() );
|
SetShowDeMorgan( GetCurPart()->HasConversion() );
|
||||||
|
|
|
@ -168,7 +168,7 @@ void SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo()
|
||||||
delete undoCommand;
|
delete undoCommand;
|
||||||
LIB_PART* part = (LIB_PART*) undoWrapper.GetItem();
|
LIB_PART* part = (LIB_PART*) undoWrapper.GetItem();
|
||||||
part->ClearFlags( UR_TRANSIENT );
|
part->ClearFlags( UR_TRANSIENT );
|
||||||
SetCurPart( part );
|
SetCurPart( part, false );
|
||||||
|
|
||||||
EE_SELECTION_TOOL* selTool = m_toolManager->GetTool<EE_SELECTION_TOOL>();
|
EE_SELECTION_TOOL* selTool = m_toolManager->GetTool<EE_SELECTION_TOOL>();
|
||||||
selTool->RebuildSelection();
|
selTool->RebuildSelection();
|
||||||
|
|
Loading…
Reference in New Issue