⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compslct.tcl

📁 vxworks WindML 3.0补丁包3 (CP3)
💻 TCL
📖 第 1 页 / 共 5 页
字号:
    if { [isGUImode] } {
        if {"$info" != "obj"} {
            set retVal $ctrlVals(currSelProdIndex)
        } else {
            set retVal $objGuiMap(gui2prod,$ctrlVals(currSelProdIndex))
        }
    } else { # TEXT mode
       set retVal $prodToListMap($info)
    }

    return $retVal
}

#############################################################################
#
# onClickPartCheckList -  is invoked when a part is selected from the
#                         partListDlg dialog box and it calls helper
#                         procedures to update the GUI and the object
#
# This procedure is a callback when a part is selected from the partListDlg
# dialog box and it calls helper procedures to update the GUI and the object
#
#
# SYNOPSIS
# .tS
# onClickPartCheckList
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#

proc onClickPartCheckList {} {

    partObjUpdate
    partGuiSizeUpdate

}

#############################################################################
#
# partObjUpdate - update the part object of the product
#
# This procedure will update the part object of the product when the part
# is selected/deselected
#
# SYNOPSIS
# .tS
# partObjUpdate
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#

proc partObjUpdate {} {
    global ctrlVals objGuiMap

    set i 0
    foreach itemState \
                [controlItemPropertyGet partListDlgHnd.optionList -checkstate] {

        partInfoSet instFlag $objGuiMap(gui2part,$i) $itemState
        incr i
    }

}

#############################################################################
#
# partGuiUpdate - update the partListDlg GUI
#
# This procedure will update the partListDlg GUI
#
# SYNOPSIS
# .tS
# partGuiUpdate <guiPartIndex>
# .tE
#
# PARAMETERS:
# .IP guiPartIndex
# the index of selected part
#
# RETURNS: N/A
#
# ERRORS: N/A
#

proc partGuiUpdate {guiPartIndex} {

    partGuiChkLstUpdate $guiPartIndex
    partGuiSizeUpdate

}

#############################################################################
#
# partGuiChkLstUpdate - update the partListDlg GUI
#
# This procedure will update the partListDlg GUI
#
# SYNOPSIS
# .tS
# partGuiChkLstUpdate <guiPartIndex>
# .tE
#
# PARAMETERS:
# .IP guiPartIndex
# the index of selected part
#
# RETURNS: N/A
#
# ERRORS: N/A
#

proc partGuiChkLstUpdate {guiPartIndex} {
    global objGuiMap
    global ctrlVals

    set prodIndex [currSelProdIndexGet]

    if {"$prodIndex" == ""} {
        windowClose partListDlgHnd
        messageBox "Please select a product first"
    } else {
        set chkList {}
        set i 0

        foreach partIndex [productInfoGet partIndexList $prodIndex] {
            set objGuiMap(gui2part,$i) $partIndex
            set objGuiMap(part2gui,$partIndex) $i
            set size [partInfoGet size $partIndex]
            set formatMbSize [format "%7s MB" [byteToMbyte $size]]
            set desc " [partInfoGet desc $partIndex]\t$formatMbSize "
            lappend chkList [list $desc [partInfoGet instFlag $partIndex]]
            incr i
        }

        controlValuesSet partListDlgHnd.optionList $chkList
        controlFocusSet partListDlgHnd.optionList
        controlSelectionSet partListDlgHnd.optionList -noevent $guiPartIndex
    }
}

#############################################################################
#
# partGuiSizeUpdate - update the size of each product's part
#
# This procedure will update the size of each product's part when user
# selects/deselects a part
#
# SYNOPSIS
# .tS
# partGuiSizeUpdate
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#

proc partGuiSizeUpdate {} {

    set totalSize [byteToMbyte [productInfoGet size [currSelProdIndexGet]]]

    controlValuesSet partListDlgHnd.spaceRequireLabel \
           "Space Required:  $totalSize MB"

}

#############################################################################
#
# onPartListDlgOk - callback when OK button is pushed and close partListDlg
#                   dialog box and save changes
#
# This procedure is a callback whne OK button is pushed and
# close partListDlg dialog box and save changes
#
# SYNOPSIS
# .tS
# onPartListDlgOk
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#

proc onPartListDlgOk {} {
    global objGuiMap ctrlVals

    set prodIndex [currSelProdIndexGet]
    windowClose partListDlgHnd

    switch [productInfoGet stateInfo $prodIndex] {
        changedIncr {
            productInfoSet instFlag \
                    [partInfoGet parent $objGuiMap(gui2part,0)] 1
            set desc [productInfoGet desc $prodIndex]
            
            set hostType [hostVerGet]
            
            set prodHostType [prodHostTypeGet $desc]
            if {[productInfoGet instFlag $prodIndex]} {
                if {$hostType != $prodHostType && $prodHostType != "unknown"} {
                    set msg "The product, $desc, is not meant for installation \
                        on this host type of $hostType.\nContinuing with the \
                        installation may lead to an incomplete installation \
                        due to missing host tools."

                    if { $ctrlVals(useInputScript) } {
                        autoSetupLog "$msg"
                        autoSetupLog "Please re-select the component\(s\)."
                        autoSetupLog "Application Exit\n"
                        set setupVals(cancel) 1                
                        applicationExit
                        return 0
                    } else {
                        dialog ok_with_title "WARNING: Product Installation" $msg
                    }
                }
            }
        }

        changedToNone {
            productInfoSet instFlag \
                    [partInfoGet parent $objGuiMap(gui2part,0)] 0
        }
    }

    productGuiChkLstUpdate [currSelProdIndexGet gui]
    productInfoSet stateCommit [currSelProdIndexGet]
    productInfoSet childStateCommit [currSelProdIndexGet]
    productGuiSizeUpdate

}

#############################################################################
#
# onPartListDlgCancel - callback when cancel button is pushed and restore
#                       the previous settings
#
# This procedure
#
# SYNOPSIS
# .tS
# onPartListDlgCancel
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#

proc onPartListDlgCancel {} {

    windowClose partListDlgHnd
    productInfoSet childStateRestore [currSelProdIndexGet]

}

#############################################################################
#
# detailShow - enable detail button if the product has subparts
#
# This procedure will enable detail button if the product has subparts
#
# SYNOPSIS
# .tS
# detailShow
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#

proc detailShow {} {
    global productObj
    global ctrlVals


    set hasSubPart [expr [llength [productInfoGet partIndexList \
                                                  [currSelProdIndexGet]]] > 1]
    set numSubPart \
        [llength [productInfoGet partIndexList [currSelProdIndexGet]]]
    if {$hasSubPart} {

        # add an indication of components/product selected

        set nCompSel 0
        set totComps 0
        foreach partIndex $productObj([currSelProdIndexGet],partIndexList) {
            if {"[partInfoGet instFlag $partIndex]" == "1"} {
                incr nCompSel
            }
            incr totComps
        }

        if {[productInfoGet instFlag [currSelProdIndexGet]] == 1} {
            controlValuesSet $ctrlVals(mainWindow).compSelected "There\
               are $nCompSel out of $totComps components selected for\
               [productInfoGet desc [currSelProdIndexGet]]."
        } else {
            controlValuesSet $ctrlVals(mainWindow).compSelected "There\
               are 0 out of $totComps components selected for\
               [productInfoGet desc [currSelProdIndexGet]]."
        }
        controlEnable $ctrlVals(mainWindow).partDetailButt 1
    } else {

       # This is a single part product

        if {[productInfoGet instFlag [currSelProdIndexGet]] == 1} {
            controlValuesSet $ctrlVals(mainWindow).compSelected "There\
               are 1 out of 1 components selected for\
               [productInfoGet desc [currSelProdIndexGet]]."
        } else {
            controlValuesSet $ctrlVals(mainWindow).compSelected "There\
               are 0 out of 1 components selected for\
               [productInfoGet desc [currSelProdIndexGet]]."
        }
        controlEnable $ctrlVals(mainWindow).partDetailButt 0
    }

    return $hasSubPart
}

#############################################################################
#
# drvIndexGet - return the driverObjects/Header product index if it exists
#               on the CD.
#
# This procedure will returns the driverObjects/Header product index
# if it exists on the CD.
#
# SYNOPSIS
# .tS
# drvIndexGet
# .tE
#
# PARAMETERS:
# .IP currentProdIndex
# the current product index being selected or deselected
#
# RETURNS: Returns the index of the driverObjects product if the index of the
#          driverObjec is same as that of the current selected product
#          else returns -1
#
# ERRORS: N/A
#
proc drvIndexGet {currProdIndex} {
    global setupVals

    if {$setupVals(drvIndex) == -1} {
        return -1
    }

    foreach drvObj $setupVals(drvIndex) {
        set index [lindex $drvObj 0]
        if {$index == $currProdIndex} {
            return $index
        }
    }

    return -1
}

#############################################################################
#
# drvArchGet - return the driverObjects/Header product arch if it exists
#              on the CD.
#
# This procedure will return the driverObjects/Header product arch if it exists
# on the CD.
#
# SYNOPSIS
# .tS
# drvArchGet
# .tE
#
# PARAMETERS:
# .IP currentProdIndex
# the current product index being selected
#
# RETURNS: Returns the arch of the driverObjects product if the index of the
#          driverObjec is same as that of the current selected product
#          else returns -1
#
# ERRORS: N/A
#

proc drvArchGet {currProdIndex} {
    global setupVals

    if {$setupVals(drvIndex) == -1} {
        return -1
    }

    foreach drvObj $setupVals(drvIndex) {
        set index [lindex $drvObj 0]
        if {$index == $currProdIndex} {
            return [lindex $drvObj 1]
        }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -