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

📄 filecopy.tcl

📁 这是vxworks 的图形界面开发软件windML2.0和另一个CP2可以构成完整的界面开发。
💻 TCL
📖 第 1 页 / 共 3 页
字号:
# FILECOPY.TCL  - Setup procedures for implementing file-copying wizard page
#
# Copyright 1999 Wind River Systems, Inc
#
# modification history
# --------------------
# 01n,27jun00,j_w  Fixed filescopy dialog to avoid blank page
# 01m,26apr99,bjl  do not resize or reposition window for KDE.
# 01l,23apr99,bjl  check for KDE and FVWM.
# 01k,22apr99,wmd  Added fix for window resizing problem.
# 01j,22mar99,bjl  do not move window during resizing.
# 01i,19mar99,wmd  Output to a file any debug messages.
# 01h,15mar99,wmd  Need to make array multipleVersion global, spr #25678..
# 01g,15mar99,tcy  use setupWinVerGetEx() to obtain os version info
# 01f,12mar99,wmd  Add line indicating host os type to setup.log.
# 01e,04mar99,tcy  fixed problem with last checkin
# 01d,03mar99,tcy  save CD number in installCDnumber file for About-Box usage
# 01c,01feb99,tcy  invoke setExecutePermissions in filesCopy()
# 01b,28jan99,tcy  moved procs here from INSTALL.TCL
# 01a,26jan99,tcy  extracted from INSTW32.TCL.
#

#############################################################################
#
# pageCreate(filesCopy) - display file installation progress with meter and
#                         install files onto user's destination directory and
#                         back up files if necessary
#
# This procedure will display file installation progress with meter, install
# files onto user's destination directory and back up files if necessary
#
# SYNOPSIS
# .tS
# pageCreate(filesCopy)
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#

proc pageCreate(filesCopy) {} {
    global ctrlVals
    global setupVals

    if {[limitColors]} {

        # create the meter here, so it can be displayed in the
        # dialog window.  Do not display the billboard.

        set ctrlVals(numBbrd) 0
        meterCreate [strTableGet 1170_FILE_COPY]

    } elseif {[removeBackground]} {
        resizeBbrdDialog
    }

    set w [dlgFrmCreate [strTableGet 1470_TITLE_FILECOPY]]

    controlEnable $w.backButt 0
    controlEnable $w.nextButt 0
    set setupVals(cancel) 0

    if {![removeBackground]} {

        # create the billboards and meter to be placed in the background.

        set ctrlVals(bbrdList) [bbrdListGet .BMP]

        if {"$ctrlVals(bbrdList)" == ""} {
            set ctrlVals(bbrdList) \
                [dosToUnix [cdFileNameGet \
                           [file join RESOURCE BITMAPS SETUP.BMP]]]
        }

        set ctrlVals(numBbrd) [llength $ctrlVals(bbrdList)]
        set ctrlVals(displayInt) [expr 100 / $ctrlVals(numBbrd)]
        set ctrlVals(bbrdElapse) $ctrlVals(displayInt)

        meterCreate [strTableGet 1170_FILE_COPY]
    }

    controlPropertySet $ctrlVals(meterWindow).$ctrlVals(meterWg) \
                        -background Blue -foreground Black

    setupCopy

    if {!$setupVals(cancel)} {
        filesCopy
        backupFileQueueFlush
        lappend setupVals(commandQueue) [list backupFileQueueFlush]
    }

    controlEnable $w.backButt 1
    controlEnable $w.nextButt 1

    # test automation

    if { $ctrlVals(useInputScript) } {
        autoSetupLog "Files copy page:"
        autoSetupLog "\tFiles copyied onto $setupVals(destDir)"
    }

    nextCallback
}

#############################################################################
#
# pageProcess(filesCopy) - process inputs from filesCopy page
#
# This procedure will process inputs from filesCopy page
#
# SYNOPSIS
# .tS
# pageProcess(filesCopy)
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: 0 if successful
#          1 if cancel button is pushed
#
# ERRORS: N/A
#

proc pageProcess(filesCopy) {} {
    global objects
    global ctrlVals
    global setupVals

    # This global variable is set in the tornado/postInstall.tcl

    global tornadoInstalled

    set retVal 0

    if {"$setupVals(cancel)" != "1"} {

        if {[array names objects] == ""} {
            pageRemove "libUpdate"
        }

        meterDestroy $ctrlVals(meterWindow)
        set retVal 1

    } {
        applicationExit
    }

    return $retVal
}

#############################################################################
#
# resizeBbrdDialog - resize the billboard dialog box
#
# This procedure will resize the billboard dialog box according to window size
#
# SYNOPSIS
# resizeBbrdDialog
#
# .tE
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#

proc resizeBbrdDialog {} {
    global ctrlVals
    global env

    set ctrlVals(restoredDialog) 0

    # calculate the billboard dimensions.

    set bbrdW $ctrlVals(bbrdW)
    set bbrdH $ctrlVals(bbrdH)

    set dimension [pixelsToDialogUnits $ctrlVals(mainWindow) \
                    [list $bbrdW $bbrdH]]
    set bbrdW [lindex $dimension 0]
    set bbrdH [lindex $dimension 1]

    # move and resize the dialog window so the billboards can fit.
    # save the original values of the dialog window first.

    set ctrlVals(dlg_orig_xpos) [lindex [windowPositionGet \
                                             $ctrlVals(mainWindow)] 0]
    set ctrlVals(dlg_orig_ypos) [lindex [windowPositionGet \
                                         $ctrlVals(mainWindow)] 1]
    set ctrlVals(dlg_orig_size) [windowSizeGet $ctrlVals(mainWindow)]
    set ctrlVals(dlg_orig_frm2_size) [controlSizeGet \
                                         $ctrlVals(mainWindow).frm2]
    set ctrlVals(dlg_orig_frm2_pos) [controlPositionGet \
                                         $ctrlVals(mainWindow).frm2]
    set ctrlVals(dlg_orig_back_pos) [controlPositionGet \
                                         $ctrlVals(mainWindow).backButt]
    set ctrlVals(dlg_orig_next_pos) [controlPositionGet \
                                         $ctrlVals(mainWindow).nextButt]
    set ctrlVals(dlg_orig_next_size) [controlSizeGet \
                                         $ctrlVals(mainWindow).nextButt]
    set ctrlVals(dlg_orig_cancel_pos) [controlPositionGet \
                                         $ctrlVals(mainWindow).cancelButt]

    set dlg_orig_w [lindex $ctrlVals(dlg_orig_size) 0]
    set right_border [expr $dlg_orig_w - 10]
    set dlg_orig_h [lindex $ctrlVals(dlg_orig_size) 1]
    set dlg_orig_cancel_w \
        [lindex [controlSizeGet $ctrlVals(mainWindow).cancelButt] 0]
    set dlg_orig_next_w \
        [lindex [controlSizeGet $ctrlVals(mainWindow).nextButt] 0]
    set dlg_orig_back_w \
        [lindex [controlSizeGet $ctrlVals(mainWindow).backButt] 0]

    # The dialog window will be reduced in width to just fit the billboard
    # width, and increased in height to account for the billboard.

    # subtract billboard width but add 20 for the edges

    set width_reduction [expr $dlg_orig_w - $bbrdW + 20]

    # now calculate the height increase
    # based on the the billboard ypos

    if {[info exists env(SETUP_USEKDE)]} {
        set billboard_ypos 10
    } else {
        set billboard_ypos 40
    }

    set billboard_bottom [expr $billboard_ypos + $bbrdH]
    set meterlabel_ypos [expr $billboard_bottom + 10]
    set meter_ypos [expr $meterlabel_ypos + 12]
    set frm2_ypos [expr $meter_ypos + 15]
    set button_ypos [expr $frm2_ypos + 7]

    # bottomedge is also the new dialog window height

    set bottomedge [expr $button_ypos + 19]

    set height_increase [expr $bottomedge - $dlg_orig_h]

    # do not reposition the window for KDE to avoid window manager
    # crash.

    if {![info exists env(SETUP_USEKDE)]} {
        windowPositionSet $ctrlVals(mainWindow) \
                          $ctrlVals(dlg_orig_xpos) \
                          $ctrlVals(dlg_orig_ypos)
    }

    # Hide the Next button and substitute it with a "phony" button.
    # The Next button is set to be the default button, which causes
    # UITclSh to think that its size is larger due to the border.
    # This causes problems with the button appearance when moving the
    # button around and when restoring the original dialog window.
    # Restore the Next button in the "restoreOriginalDialog" procedure.

    controlHide $ctrlVals(mainWindow).nextButt 1
    controlCreate $ctrlVals(mainWindow) \
                [list button -name phonynextButt -title "&Next >" \
                             -callback nextCallback \
                              -x 197 -y 185 -w 50 -h 14]
    controlEnable $ctrlVals(mainWindow).phonynextButt 0

    controlFocusSet $ctrlVals(mainWindow).cancelButt
    controlHide $ctrlVals(mainWindow).bitmap 1

    # controls are specially set for KDE because we do not shrink
    # the window.  

    if {[info exists env(SETUP_USEKDE)]} {
        controlSizeSet $ctrlVals(mainWindow).frm2 [expr $right_border - 10] 2
    } else {
        controlSizeSet $ctrlVals(mainWindow).frm2 $bbrdW 2
    }
    controlPositionSet $ctrlVals(mainWindow).frm2 10 $frm2_ypos

    if {[info exists env(SETUP_USEKDE)]} {
        set cancel_xpos [expr $right_border - $dlg_orig_cancel_w]
    } else {
        set cancel_xpos [expr 10 + $bbrdW - $dlg_orig_cancel_w]
    }
    set next_xpos [expr $cancel_xpos - 8 - $dlg_orig_next_w ]
    set back_xpos [expr $next_xpos - $dlg_orig_back_w]
    controlPositionSet $ctrlVals(mainWindow).backButt $back_xpos \
                                                      $button_ypos
    controlPositionSet $ctrlVals(mainWindow).phonynextButt $next_xpos \
                                                      $button_ypos
    controlPositionSet $ctrlVals(mainWindow).cancelButt $cancel_xpos \
                                                        $button_ypos

    # do not resize the window for KDE to avoid a window manager crash.

    if {![info exists env(SETUP_USEKDE)]} {
        set ctrlVals(mainWindowSize) [list [expr $bbrdW + 20] $bottomedge]
        windowSizeSet $ctrlVals(mainWindow) \
            [expr $bbrdW + 20] $bottomedge
    }


    set ctrlVals(bbrdList) [bbrdListGet .BMP]

    if {"$ctrlVals(bbrdList)" == ""} {
            set ctrlVals(bbrdList) \
                [dosToUnix [cdFileNameGet \
                           [file join RESOURCE BITMAPS SETUP.BMP]]]
    }

    set ctrlVals(numBbrd) [llength $ctrlVals(bbrdList)]
    set ctrlVals(displayInt) [expr 100 / $ctrlVals(numBbrd)]
    set ctrlVals(bbrdElapse) $ctrlVals(displayInt)

    # create the meter here, so it can be displayed in the
    # dialog window.

    meterCreate [strTableGet 1170_FILE_COPY]
}

##############################################################################
#
# archListPut - save the object filename
#
# This procedure checks the provided filename for a special pattent.  If
# matches, the filename will be saved in a global array for later archiving
# step.  The keys of this associated array are the object location, and product
# index.
#
# SYNOPSIS
# archListPut <fileName> <index>
#
# PARAMETERS:
#    fileName : a path filename
#    index : an index to a current product
#
# RETURNS: N/A
#
# ERRORS: N/A
#

proc archListPut {fileName index} {
    global objects

    # toolset and typeset can be a set of strings "|" together
    # "gnu|gnucoff|..."

    set toolset "gnu"
    set typeset "vx"

    if {[regexp "^.*/lib/obj(.*)($toolset)($typeset)(.*)/(.*$)" $fileName \
         junk cpu tool type typex tailFileName] == "1"} {

        set objDir "$index,obj,$cpu,$tool,$type,$typex"

        if [info exists objects($objDir)] {
            if {[lsearch $objects($objDir) $tailFileName] == "-1"} {
                lappend objects($objDir) $tailFileName
            }

⌨️ 快捷键说明

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