
destroy .lstyle
toplevel .lstyle
wm title .lstyle "GOBLIN Layout Styles"
wm resizable .lstyle 0 0
     
global ThisGraph ThisLabel goblinNodeSep
set ThisLabel "colours"

frame .lstyle.options
    label .lstyle.options.label -text "Layout Style:" -anchor w
    radiobutton .lstyle.options.tree -text "Align Predecessor Tree" \
        -variable ThisLabel -value "tree" -anchor w
    radiobutton .lstyle.options.circle -text "Place Nodes on a Circle" \
        -variable ThisLabel -value "circle" -anchor w
    radiobutton .lstyle.options.colours -text "Arrange Colours into Rows" \
        -variable ThisLabel -value "colours" -anchor w
    radiobutton .lstyle.options.grid -text "Square Grid" \
        -variable ThisLabel -value "grid" -anchor w
    pack .lstyle.options.label .lstyle.options.tree \
        .lstyle.options.circle .lstyle.options.colours \
        .lstyle.options.grid -side top -fill x
     
frame .lstyle.value
    label .lstyle.value.label -text "Node Separator:" -anchor w
    entry .lstyle.value.value -textvariable goblinNodeSep -bg white -width 5
    pack .lstyle.value.label .lstyle.value.value -side left -padx 1m -fill x

pack .lstyle.options .lstyle.value -padx 10m -pady 5m -side top -anchor w

     
frame .lstyle.buttons
pack .lstyle.buttons -padx 3m -pady 3m -side bottom

    button .lstyle.buttons.apply -text "Apply" -command { \
        if {$goblinNodeSep>0} {
            $ThisGraph layout $ThisLabel
            PropagateModifications
            InitDisplay
        }
    }    

    button .lstyle.buttons.done -text "Done" -command { \
        destroy .lstyle
    }
    
    pack .lstyle.buttons.apply \
        .lstyle.buttons.done \
        -side left -fill x -padx 3m
