
proc SelectArcLabels {} {
    global WDArcLabels InternalWindowing DialogFrame DefPadX DefPadY

    if {$InternalWindowing} {
        set WDArcLabels $DialogFrame.arcLabels
        if {![winfo exists $WDArcLabels]} {
            frame $WDArcLabels
        }
        
        RegisterDialog "Arc Labels" $WDArcLabels SelectArcLabels {}
    } else {
        set WDArcLabels .arclabels
        if {![winfo exists $WDArcLabels]} {
            toplevel $WDArcLabels
            wm title $WDArcLabels "Arc Labels"
            wm resizable $WDArcLabels 0 0
        }
    }

    global goblinArcLabels goblinArcLabels2
    
    frame $WDArcLabels.buttons
    button $WDArcLabels.buttons.done -text "Done" -command { \
        if {$InternalWindowing} {
            DestroyActiveDialog
        } else {
            destroy $WDArcLabels
        }
        InitDisplay
    }
    
    pack $WDArcLabels.buttons.done -side left -fill x -padx 3m
    pack $WDArcLabels.buttons -padx 3m -pady 3m -side bottom

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

    frame $WDArcLabels.options.arcLabels
    frame $WDArcLabels.options.arcLabels2
    pack $WDArcLabels.options.arcLabels $WDArcLabels.options.arcLabels2 \
        -side top -fill x -pady 5m

    label $WDArcLabels.options.arcLabels.label -text "Primary Arc Labels:" -anchor w
    radiobutton $WDArcLabels.options.arcLabels.noLabels -text "No Labels" \
        -variable goblinArcLabels -value 0 -anchor w
    radiobutton $WDArcLabels.options.arcLabels.indices -text "Indices" \
        -variable goblinArcLabels -value 1 -anchor w
    radiobutton $WDArcLabels.options.arcLabels.upper -text "Upper Capacity Bounds" \
        -variable goblinArcLabels -value 2 -anchor w
    radiobutton $WDArcLabels.options.arcLabels.lower -text "Lower Capacity Bounds" \
        -variable goblinArcLabels -value 6 -anchor w
    radiobutton $WDArcLabels.options.arcLabels.length -text "Length Labels" \
        -variable goblinArcLabels -value 4 -anchor w
    radiobutton $WDArcLabels.options.arcLabels.redlength -text "Reduced Length Labels" \
        -variable goblinArcLabels -value 5 -anchor w
    radiobutton $WDArcLabels.options.arcLabels.subgraph -text "Subgraph / Flow Labels" \
        -variable goblinArcLabels -value 3 -anchor w
    pack $WDArcLabels.options.arcLabels.label \
        $WDArcLabels.options.arcLabels.noLabels \
        $WDArcLabels.options.arcLabels.indices \
        $WDArcLabels.options.arcLabels.upper \
        $WDArcLabels.options.arcLabels.lower \
        $WDArcLabels.options.arcLabels.length \
        $WDArcLabels.options.arcLabels.redlength \
        $WDArcLabels.options.arcLabels.subgraph \
        -fill x
        
    label $WDArcLabels.options.arcLabels2.label -text "Secondary Arc Labels:" -anchor w
    radiobutton $WDArcLabels.options.arcLabels2.noLabels -text "No Labels" \
        -variable goblinArcLabels2 -value 0 -anchor w
    radiobutton $WDArcLabels.options.arcLabels2.indices -text "Indices" \
        -variable goblinArcLabels2 -value 1 -anchor w
    radiobutton $WDArcLabels.options.arcLabels2.upper -text "Upper Capacity Bounds" \
        -variable goblinArcLabels2 -value 2 -anchor w
    radiobutton $WDArcLabels.options.arcLabels2.lower -text "Lower Capacity Bounds" \
        -variable goblinArcLabels2 -value 6 -anchor w
    radiobutton $WDArcLabels.options.arcLabels2.length -text "Length Labels" \
        -variable goblinArcLabels2 -value 4 -anchor w
    radiobutton $WDArcLabels.options.arcLabels2.redlength -text "Reduced Length Labels" \
        -variable goblinArcLabels2 -value 5 -anchor w
    radiobutton $WDArcLabels.options.arcLabels2.subgraph -text "Subgraph / Flow Labels" \
        -variable goblinArcLabels2 -value 3 -anchor w
    pack $WDArcLabels.options.arcLabels2.label \
        $WDArcLabels.options.arcLabels2.noLabels \
        $WDArcLabels.options.arcLabels2.indices \
        $WDArcLabels.options.arcLabels2.upper \
        $WDArcLabels.options.arcLabels2.lower \
        $WDArcLabels.options.arcLabels2.length \
        $WDArcLabels.options.arcLabels2.redlength \
        $WDArcLabels.options.arcLabels2.subgraph \
        -fill x

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

global WDArcLabels
if {![info exists WDArcLabels] || ![winfo exists $WDArcLabels]} {SelectArcLabels}
