# finish.tcl
# Copyright (c) 2003 Digi International Inc., All Rights Reserved
# 
# This software contains proprietary and confidential information of Digi
# International Inc.  By accepting transfer of this copy, Recipient agrees
# to retain this software in confidence, to prevent disclosure to others,
# and to make no use of this software other than that for which it was
# delivered.  This is an unpublished copyrighted work of Digi International
# Inc.  Except as permitted by federal law, 17 USC 117, copying is strictly
# prohibited.
# 
# Restricted Rights Legend
#
# Use, duplication, or disclosure by the Government is subject to
# restrictions set forth in sub-paragraph (c)(1)(ii) of The Rights in
# Technical Data and Computer Software clause at DFARS 252.227-7031 or
# subparagraphs (c)(1) and (2) of the Commercial Computer Software -
# Restricted Rights at 48 CFR 52.227-19, as applicable.
#
# Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
#
# ***************************************************************************

namespace eval Finish {}

proc Finish::MainGuts {w} {
    variable Tab1st
    variable boolLogon 0
    variable boolRegister 1
    set frmMain $w.frmfinish
    catch {destroy $frmMain}
    if {![winfo exists $frmMain]} {
        frame $frmMain
        BuildPage $frmMain
        grid $frmMain -row 0 -column 0 -sticky news \
         -padx [expr $::numTitleBoldXPad + $::numBorderWidth] -pady 5
    }
    raise $frmMain
    set ::Tab1st $Tab1st
    bind $Tab1st <<ShiftTab>> {focus $::btnHelp;break}
}

proc Finish::BuildPage {w} {
    variable Tab1st
    set numlblWarningPadx 15
    set numlblWarningWidth [expr (2 * $numlblWarningPadx) + 5]
    set numWraplength [expr $::numGutsHeadingWraplength - $numlblWarningWidth]
    set lblWarning [label $w.lblwarn -bitmap warning]
    set lblBHeading [label $w.lblbheading -text [mc finish.body.bheading] -font fontRegularBold]
    set lblWebui [label $w.lblwebui -text [mc finish.body.webui \
        $::Save::arrSettings(Hardware) \
        [mc finish.body.log] \
        $::Save::arrSettings(IP)] \
     -wraplength $numWraplength -justify left]
    set lblUserPw [label $w.lbluserpw -text "[mc finish.body.userpw]\n   [mc finish.body.user]\n   [mc finish.body.pass]" \
     -wraplength $numWraplength -justify left]
    set lblGuide [label $w.lblguide -text [mc finish.body.guide] \
     -wraplength $numWraplength -justify left]
    set chkRegister [checkbutton $w.chkreg \
     -text [mc finish.body.register $::Save::arrSettings(Hardware)] \
     -variable ::Finish::boolRegister]
    set chkLog [checkbutton $w.chklog -text [mc finish.body.log] \
     -variable ::Finish::boolLogon]
    set lblContinue [label $w.lblcont -text [mc finish.tocontinue] -font fontRegularBold]
    
    grid $lblWarning -row 1 -column 0 -sticky nw -rowspan 3 -padx $numlblWarningPadx -pady 5
    grid $lblBHeading -row 0 -column 1 -sticky sw
    grid $lblWebui -row 1 -column 1 -sticky nw -pady 2
    grid $lblUserPw -row 2 -column 1 -sticky nw
    grid $lblGuide -row 3 -column 1 -sticky nw -pady 2
    grid $chkRegister -row 4 -column 0 -columnspan 2 -sticky nw
    grid $chkLog -row 5 -column 0 -columnspan 2 -sticky nw
    grid $lblContinue -row 6 -column 0 -sticky sw -columnspan 2

    grid rowconfigure $w 0 -weight 1
    grid rowconfigure $w 3 -weight 2
    grid rowconfigure $w 5 -weight 3
    grid columnconfigure $w 1 -weight 1
    set Tab1st $chkRegister
}
