Notifications
Clear all

Bring objects to front/send to back


Posts: 4
Customer
Topic starter
Active Member
Joined: 11 months ago

Hello,

How do I bring objects to front or send them to back programmatically?

 

Thanks

Topic Tags
#UI
2 Replies
Posts: 20
Admin
Member
Joined: 12 years ago

The Front-to-back is determined by the z-order, which is stored in the NodeLocation attribute.  It is an integer, and can be positive or negative.  Nodes with larger Z-order display over nodes with lower Z-order.  When you select "Bring to Front" on the right-mouse context menu, it sets the Z-order to a number that is larger than the other z-orders on the same diagram.

Here is a UDF to do it:

Function Send_to_front(o : Object)

Definition:

Local z := NodeLocation::z of Contains of isin of o;
NodeLocation::z of o := Max([10,z+1])

Function Send_to_back(o : Object)

Local z := NodeLocation::z of Contains of isin of o;
NodeLocation::z of o := Min([-10,z-1])

 

Reply
1 Reply
Customer
Joined: 11 months ago

Active Member
Posts: 4

Great, thanks!

Reply
Share:
Scroll to Top