Refresh issues around sheet pins.
This commit is contained in:
parent
96724af2c4
commit
97c83766db
|
@ -614,7 +614,7 @@ bool SCH_EDIT_FRAME::SchematicCleanUp( bool aAppend )
|
|||
remove_item( item );
|
||||
remove_item( secondItem );
|
||||
itemList.PushItem( ITEM_PICKER( line, UR_NEW ) );
|
||||
AddToScreen( (SCH_ITEM*) line );
|
||||
AddToScreen( line );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -845,8 +845,6 @@ void SCH_EDIT_FRAME::RepeatDrawItem()
|
|||
if( !repeater )
|
||||
return;
|
||||
|
||||
//D( repeater>Show( 0, std::cout ); )
|
||||
|
||||
// clone the repeater, move it, insert into display list, then save a copy
|
||||
// via SetRepeatItem();
|
||||
|
||||
|
@ -872,9 +870,7 @@ void SCH_EDIT_FRAME::RepeatDrawItem()
|
|||
AddToScreen( my_clone );
|
||||
|
||||
if( my_clone->IsConnectable() )
|
||||
{
|
||||
GetScreen()->TestDanglingEnds();
|
||||
}
|
||||
|
||||
SaveCopyInUndoList( my_clone, UR_NEW );
|
||||
my_clone->ClearFlags();
|
||||
|
|
|
@ -46,7 +46,7 @@ SCH_BUS_BUS_ENTRY* SCH_EDIT_FRAME::CreateBusBusEntry()
|
|||
|
||||
busEntry->SetFlags( IS_NEW );
|
||||
GetScreen()->SetCurItem( busEntry );
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
return busEntry;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ SCH_BUS_WIRE_ENTRY* SCH_EDIT_FRAME::CreateBusWireEntry()
|
|||
|
||||
busEntry->SetFlags( IS_NEW );
|
||||
GetScreen()->SetCurItem( busEntry );
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
return busEntry;
|
||||
}
|
||||
|
||||
|
|
|
@ -313,7 +313,7 @@ void SCH_EDIT_FRAME::OrientComponent( COMPONENT_ORIENTATION_T aOrientation )
|
|||
|
||||
if( item->GetFlags() == 0 )
|
||||
{
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
SchematicCleanUp( true );
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
case SCH_FIELD_T:
|
||||
case SCH_BITMAP_T:
|
||||
case SCH_NO_CONNECT_T:
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
GetCanvas()->GetView()->ClearPreview();
|
||||
GetCanvas()->GetView()->ClearHiddenFlags();
|
||||
return;
|
||||
|
@ -133,7 +133,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
}
|
||||
else
|
||||
{
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -150,7 +150,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
}
|
||||
else
|
||||
{
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -162,7 +162,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
}
|
||||
else
|
||||
{
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -174,7 +174,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
}
|
||||
else
|
||||
{
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -205,7 +205,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
}
|
||||
else
|
||||
{
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -217,7 +217,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
}
|
||||
else
|
||||
{
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -229,7 +229,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
}
|
||||
else
|
||||
{
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -247,7 +247,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
}
|
||||
else
|
||||
{
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -264,7 +264,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
}
|
||||
else
|
||||
{
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -285,7 +285,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
}
|
||||
else if( (item->Type() == SCH_SHEET_PIN_T) && (item->GetFlags() != 0) )
|
||||
{
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -299,7 +299,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
}
|
||||
else
|
||||
{
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -313,7 +313,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
}
|
||||
else
|
||||
{
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem, bool aAppend )
|
|||
wxT( "Sheet label has invalid parent item." ) );
|
||||
SaveCopyInUndoList( (SCH_ITEM*) sheet, UR_CHANGED, aAppend );
|
||||
sheet->RemovePin( (SCH_SHEET_PIN*) aItem );
|
||||
m_canvas->RefreshDrawingRect( sheet->GetBoundingBox() );
|
||||
RefreshItem( sheet );
|
||||
}
|
||||
else if( aItem->Type() == SCH_JUNCTION_T )
|
||||
{
|
||||
|
|
|
@ -567,17 +567,45 @@ void EDA_DRAW_FRAME::createCanvas()
|
|||
}
|
||||
|
||||
|
||||
void SCH_BASE_FRAME::RefreshItem( SCH_ITEM* aItem, bool isAddOrDelete )
|
||||
{
|
||||
EDA_ITEM* parent = aItem->GetParent();
|
||||
|
||||
if( aItem->Type() == SCH_SHEET_PIN_T )
|
||||
{
|
||||
// Sheet pins aren't in the view. Refresh their parent.
|
||||
if( parent )
|
||||
GetCanvas()->GetView()->Update( parent );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !isAddOrDelete )
|
||||
GetCanvas()->GetView()->Update( aItem );
|
||||
|
||||
// Component children are drawn from their parents. Mark them for re-paint.
|
||||
if( parent && parent->Type() == SCH_COMPONENT_T )
|
||||
GetCanvas()->GetView()->Update( parent, KIGFX::REPAINT );
|
||||
}
|
||||
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
void SCH_BASE_FRAME::AddToScreen( SCH_ITEM* aItem )
|
||||
{
|
||||
GetScreen()->Append( aItem );
|
||||
GetCanvas()->GetView()->Add( aItem );
|
||||
RefreshItem( aItem, true ); // handle any additional parent semantics
|
||||
}
|
||||
|
||||
|
||||
void SCH_BASE_FRAME::AddToScreen( DLIST<SCH_ITEM>& aItems )
|
||||
{
|
||||
for( SCH_ITEM* item = aItems.begin(); item; item = item->Next() )
|
||||
{
|
||||
GetCanvas()->GetView()->Add( item );
|
||||
RefreshItem( item, true ); // handle any additional parent semantics
|
||||
}
|
||||
|
||||
GetScreen()->Append( aItems );
|
||||
}
|
||||
|
@ -587,6 +615,7 @@ void SCH_BASE_FRAME::RemoveFromScreen( SCH_ITEM* aItem )
|
|||
{
|
||||
GetCanvas()->GetView()->Remove( aItem );
|
||||
GetScreen()->Remove( aItem );
|
||||
RefreshItem( aItem, true ); // handle any additional parent semantics
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -290,10 +290,29 @@ public:
|
|||
|
||||
virtual void HardRedraw() override;
|
||||
|
||||
/**
|
||||
* Add an item to the screen (and view)
|
||||
*/
|
||||
void AddToScreen( SCH_ITEM* aItem );
|
||||
|
||||
/**
|
||||
* Add a list of items to the screen (and view)
|
||||
*/
|
||||
void AddToScreen( DLIST<SCH_ITEM>& aItems );
|
||||
|
||||
/**
|
||||
* Remove an item from the screen (and view)
|
||||
*/
|
||||
void RemoveFromScreen( SCH_ITEM* aItem );
|
||||
|
||||
/**
|
||||
* Mark an item for refresh.
|
||||
*/
|
||||
void RefreshItem( SCH_ITEM* aItem, bool isAddOrDelete = false );
|
||||
|
||||
/**
|
||||
* Mark all items for refresh.
|
||||
*/
|
||||
void SyncView();
|
||||
|
||||
|
||||
|
|
|
@ -752,18 +752,6 @@ void SCH_EDIT_FRAME::OnModify()
|
|||
}
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::RefreshItem( SCH_ITEM* aItem )
|
||||
{
|
||||
GetCanvas()->GetView()->Update( aItem );
|
||||
|
||||
// Component children are drawn from their parents so we must also dirty the parent.
|
||||
if( aItem->GetParent() && aItem->GetParent()->Type() == SCH_COMPONENT_T )
|
||||
GetCanvas()->GetView()->Update( aItem->GetParent(), KIGFX::REPAINT );
|
||||
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::OnUpdatePaste( wxUpdateUIEvent& event )
|
||||
{
|
||||
event.Enable( m_blockItems.GetCount() > 0 );
|
||||
|
@ -1339,7 +1327,7 @@ bool SCH_EDIT_FRAME::isAutoSaveRequired() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::addCurrentItemToList( bool aRedraw )
|
||||
void SCH_EDIT_FRAME::addCurrentItemToScreen( bool aRedraw )
|
||||
{
|
||||
SCH_SCREEN* screen = GetScreen();
|
||||
SCH_ITEM* item = screen->GetCurItem();
|
||||
|
@ -1416,7 +1404,7 @@ void SCH_EDIT_FRAME::addCurrentItemToList( bool aRedraw )
|
|||
if( item->Type() == SCH_SHEET_PIN_T )
|
||||
( (SCH_SHEET*)undoItem )->AddPin( (SCH_SHEET_PIN*) item );
|
||||
else
|
||||
wxLogMessage( wxT( "addCurrentItemToList: expected type = SCH_SHEET_PIN_T, actual type = %d" ),
|
||||
wxLogMessage( wxT( "addCurrentItemToScreen: expected type = SCH_SHEET_PIN_T, actual type = %d" ),
|
||||
item->Type() );
|
||||
}
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ protected:
|
|||
*
|
||||
* @param aRedraw = true (default) to redrw -the screen after adding the item.
|
||||
*/
|
||||
void addCurrentItemToList( bool aRedraw = true );
|
||||
void addCurrentItemToScreen( bool aRedraw = true );
|
||||
|
||||
void updateFindReplaceView( wxFindDialogEvent& aEvent );
|
||||
|
||||
|
@ -347,11 +347,6 @@ public:
|
|||
*/
|
||||
void OnModify();
|
||||
|
||||
/**
|
||||
* Mark an item for refresh.
|
||||
*/
|
||||
void RefreshItem( SCH_ITEM* aItem );
|
||||
|
||||
virtual wxString GetScreenDesc() const override;
|
||||
|
||||
/**
|
||||
|
|
|
@ -166,6 +166,7 @@ bool SCH_PAINTER::Draw( const VIEW_ITEM *aItem, int aLayer )
|
|||
HANDLE_ITEM(SCH_HIERARCHICAL_LABEL_T, SCH_HIERLABEL);
|
||||
HANDLE_ITEM(SCH_GLOBAL_LABEL_T, SCH_GLOBALLABEL);
|
||||
HANDLE_ITEM(SCH_SHEET_T, SCH_SHEET);
|
||||
HANDLE_ITEM(SCH_SHEET_PIN_T, SCH_HIERLABEL);
|
||||
HANDLE_ITEM(SCH_NO_CONNECT_T, SCH_NO_CONNECT);
|
||||
HANDLE_ITEM(SCH_BUS_WIRE_ENTRY_T, SCH_BUS_ENTRY_BASE);
|
||||
HANDLE_ITEM(SCH_BUS_BUS_ENTRY_T, SCH_BUS_ENTRY_BASE);
|
||||
|
|
|
@ -151,13 +151,14 @@ void SCH_VIEW::ClearPreview()
|
|||
|
||||
void SCH_VIEW::AddToPreview( EDA_ITEM *aItem, bool owned )
|
||||
{
|
||||
m_preview->Add(aItem);
|
||||
if(owned)
|
||||
m_previewItems.push_back(aItem);
|
||||
m_preview->Add( aItem );
|
||||
|
||||
SetVisible(m_preview.get(), true);
|
||||
Hide(m_preview.get(), false);
|
||||
Update(m_preview.get());
|
||||
if( owned )
|
||||
m_previewItems.push_back( aItem );
|
||||
|
||||
SetVisible( m_preview.get(), true );
|
||||
Hide( m_preview.get(), false );
|
||||
Update( m_preview.get() );
|
||||
}
|
||||
|
||||
void SCH_VIEW::ShowSelectionArea( bool aShow )
|
||||
|
|
|
@ -229,7 +229,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
case ID_POPUP_SCH_END_SHEET:
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_RESIZE_SHEET:
|
||||
|
@ -360,7 +360,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
item = screen->GetCurItem();
|
||||
|
||||
if( item )
|
||||
addCurrentItemToList();
|
||||
addCurrentItemToScreen();
|
||||
|
||||
break;
|
||||
|
||||
|
@ -664,6 +664,7 @@ bool SCH_EDIT_FRAME::DeleteItemAtCrossHair()
|
|||
if( itemHasConnections )
|
||||
screen->TestDanglingEnds();
|
||||
|
||||
GetCanvas()->Refresh();
|
||||
OnModify();
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue