Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Vertically align boxes in the same layer? (Read 3424 times)
BF
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Joined: Feb 26th, 2013
Vertically align boxes in the same layer?
Jun 7th, 2013 at 1:47pm
Print Post  
Hi,

Id like to get all the boxes in the same layer vertically aligned to the top of the highest box in that layer (Using the Layered layout)

For example:



Is the FlowChart.LayoutStyle property the correct setting for this? Changing it does nothing as only lsVerticalCentered is supported according to the documentation.

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Vertically align boxes in the same layer?
Reply #1 - Jun 7th, 2013 at 4:50pm
Print Post  
Hi,

That property is for container boxes. Nodes in a layer are always aligned by their center points at this time. You could find the topmost node in a layer and align the remaining boxes to it like this:

Code
Select All
fcx.ArrangeDiagram ll

Dim topY(200) As Integer

Dim b As box
For Each b In fcx.boxes
    Dim i As Integer
    i = ((b.top + b.bottom) / 2 - fcx.DocTop) \ ll.LayerDistance
    b.Tag = i
    If topY(i) = 0 Then
        topY(i) = b.top
    Else
        If topY(i) > b.top Then topY(i) = b.top
    End If
Next

For Each b In fcx.boxes
    b.MoveTo b.left, topY(b.Tag)
Next 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
BF
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Joined: Feb 26th, 2013
Re: Vertically align boxes in the same layer?
Reply #2 - Jun 10th, 2013 at 9:16am
Print Post  
Ok thanks for clarifying.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint