
proc ShowADisplayOptions {} {
    global WDArcDisplay InternalWindowing DialogFrame DefPadX DefPadY

    if {$InternalWindowing} {
        set WDArcDisplay $DialogFrame.arcdisplay
        if {![winfo exists $WDArcDisplay]} {
            frame $WDArcDisplay
        }
        
        RegisterDialog "Arc Display Options" $WDArcDisplay ShowADisplayOptions {}
    } else {
        set WDArcDisplay .arcdisplay
        if {![winfo exists $WDArcDisplay]} {
            toplevel $WDArcDisplay
            wm title $WDArcDisplay "Arc Display Options"
            wm resizable $WDArcDisplay 0 0
        }
    }

    global goblinArrows goblinArcStyle goblinPredecessors goblinSubgraph
    
    frame $WDArcDisplay.buttons
    button $WDArcDisplay.buttons.done -text "Done" -command { \
        if {$InternalWindowing} {
            DestroyActiveDialog
        } else {
            destroy $WDArcDisplay
        }
        InitDisplay
    }
    
    pack $WDArcDisplay.buttons.done -side left -fill x -padx 3m
    pack $WDArcDisplay.buttons -padx 3m -pady 3m -side bottom

    frame $WDArcDisplay.options
    pack $WDArcDisplay.options -fill both -padx $DefPadX -pady $DefPadY

    frame $WDArcDisplay.options.subgraph
    frame $WDArcDisplay.options.arcStyle
    frame $WDArcDisplay.options.arrows
    frame $WDArcDisplay.options.checkButtons
    pack $WDArcDisplay.options.subgraph $WDArcDisplay.options.arcStyle \
        $WDArcDisplay.options.arrows $WDArcDisplay.options.checkButtons \
        -side top -fill x -pady 5m
     
    label $WDArcDisplay.options.subgraph.label -text "Arc Display:" -anchor w
    radiobutton $WDArcDisplay.options.subgraph.hide -text "Hide Arcs" \
        -variable goblinSubgraph -value 0 -anchor w
    radiobutton $WDArcDisplay.options.subgraph.support -text "Supported Arcs" \
        -variable goblinSubgraph -value 1 -anchor w
    radiobutton $WDArcDisplay.options.subgraph.dashed -text "Fractional Arcs Dashed" \
        -variable goblinSubgraph -value 2 -anchor w
    radiobutton $WDArcDisplay.options.subgraph.width -text "Various Width" \
        -variable goblinSubgraph -value 3 -anchor w
    radiobutton $WDArcDisplay.options.subgraph.all -text "Uniform" \
        -variable goblinSubgraph -value 4 -anchor w
    radiobutton $WDArcDisplay.options.subgraph.ordinal -text "Ordinal" \
        -variable goblinSubgraph -value 5 -anchor w
    pack $WDArcDisplay.options.subgraph.label \
        $WDArcDisplay.options.subgraph.hide \
        $WDArcDisplay.options.subgraph.support \
        $WDArcDisplay.options.subgraph.dashed \
        $WDArcDisplay.options.subgraph.width \
        $WDArcDisplay.options.subgraph.all \
        $WDArcDisplay.options.subgraph.ordinal \
        -fill x

    label $WDArcDisplay.options.arrows.label -text "Arrows:" -anchor w
    radiobutton $WDArcDisplay.options.arrows.leading -text "Leading" \
        -variable goblinArrows -value 0 -anchor w
    radiobutton $WDArcDisplay.options.arrows.centered -text "Centered" \
        -variable goblinArrows -value 1 -anchor w
    pack $WDArcDisplay.options.arrows.label \
        $WDArcDisplay.options.arrows.leading \
        $WDArcDisplay.options.arrows.centered \
        -fill x

    label $WDArcDisplay.options.arcStyle.label -text "Arc Style:" -anchor w
    radiobutton $WDArcDisplay.options.arcStyle.polygones -text "Polygones" \
        -variable goblinArcStyle -value 0 -anchor w
    radiobutton $WDArcDisplay.options.arcStyle.curves -text "Curves" \
        -variable goblinArcStyle -value 1 -anchor w
    radiobutton $WDArcDisplay.options.arcStyle.pipes -text "Pipes" \
        -variable goblinArcStyle -value 2 -anchor w
    pack $WDArcDisplay.options.arcStyle.label \
        $WDArcDisplay.options.arcStyle.polygones \
        $WDArcDisplay.options.arcStyle.curves \
        $WDArcDisplay.options.arcStyle.pipes \
        -fill x

    checkbutton $WDArcDisplay.options.checkButtons.predecessors \
        -text "Show Predecessors" -variable goblinPredecessors -anchor w
    pack $WDArcDisplay.options.checkButtons.predecessors -fill x

    if {$InternalWindowing} {
        pack $WDArcDisplay -anchor nw
        AlignActiveDialog
    }
}

global WDArcDisplay
if {![info exists WDArcDisplay] || ![winfo exists $WDArcDisplay]} {ShowADisplayOptions}
