Hiding EDA_ITEMs

41 views
Skip to first unread message

James Jackson

unread,
Jan 18, 2023, 6:52:20 PM1/18/23
to dev...@kicad.org
Hi all,

I'm making some decent progress with https://gitlab.com/kicad/code/kicad/-/issues/10926 (WIP here: https://gitlab.com/kicad/code/kicad/-/merge_requests/1460 ), but have hit an issue I can't figure out.

I need to set EDA_ITEM visibility in SCH_EDIT_FRAME::DisplayCurrentSheet(), so I can hide markers on sheets they are not relevant to. I've tried some flag twiddling, but this isn't affecting the visibility:

if( setVisible )
{
    item->SetFlags( KIGFX::VISIBLE );
}
else
{
     if( item->HasFlag( KIGFX::VISIBLE ) )
         item->XorFlags( KIGFX::VISIBLE );
}

I'd welcome any suggestions on how to change item visibility here.

Many thanks,
James.

Seth Hillbrand

unread,
Jan 18, 2023, 7:47:42 PM1/18/23
to dev...@kicad.org
Hi James-

After you set a flag on a view item, you will need to update it and then force a refresh on that item.  This can be done using `UpdateAllItemsConditionally` and then calling a `ForceRefresh`.  Since the ERC items live on an overlay, I don't think that you need to mark the layer dirty.  But if they were on another layer, you would need to mark that dirty before calling `ForceRefresh()`

Best,
Seth

--
You received this message because you are subscribed to the Google Groups "KiCad Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to devlist+u...@kicad.org.
To view this discussion on the web visit https://groups.google.com/a/kicad.org/d/msgid/devlist/CANhYM9GSZ8wU2%3DeHmsbaQ%3DME2SsHtWfPjvWoz6dwWF0BeKrMcg%40mail.gmail.com.


--
KiCad Services Corporation Logo
Seth Hillbrand
Lead Developer
+1-530-302-5483
Long Beach, CA
www.kipro-pcb.com    in...@kipro-pcb.com

James Jackson

unread,
Jan 19, 2023, 10:16:06 AM1/19/23
to KiCad Developers, se...@kipro-pcb.com
Hi Seth,

This was actually happening before a global Update... and ForceRefresh(), so slightly confused why it wasn't working. However, on the MR thread Jeff Young suggested another method which has worked perfectly. I'll tidy up the commit and get some more involved testing done, but it's looking good so far.

Yours,
James.
Reply all
Reply to author
Forward
0 new messages