📄 instw32.tcl
字号:
-helpfile $setupVals(setupHelp) \ -modeless \ -controls $controls } set ctrlVals(parentDialog) $ctrlVals(mainWindow) windowQueryCloseCallbackSet $ctrlVals(mainWindow) quitCallback } customizeMainWindow $title return $ctrlVals(mainWindow) }############################################################################### customizeMainWindow - set the title of the wizard page ## This procedure will set the title of the wizard page## SYNOPSIS# .tS# customizeMainWindow# .tE## PARAMETERS:# .IP title # title of the wizard page## RETURNS: N/A## ERRORS: N/A#proc customizeMainWindow {title} { global ctrlVals windowTitleSet $ctrlVals(mainWindow) $title foreach ctrl $ctrlVals(volatileFrm) { controlCreate $ctrlVals(mainWindow) $ctrl } set ctrlVals(jumpBack) 1}############################################################################### destroyVolatileFrm - close the wizard page## This procedure will close the wizard page## SYNOPSIS# .tS# destroyVolatileFrm# .tE## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc destroyVolatileFrm {} { global ctrlVals # First hide the controls to make it 'invisible', mainwin may be slow in # how it implements refresh logic on unix. foreach ctrl $ctrlVals(volatileFrm) { set pos [lsearch $ctrl "-name"] if {$pos != "-1"} { controlHide \ $ctrlVals(mainWindow).[lindex $ctrl [expr $pos + 1]] 1 } } # Then we destroy the controls foreach ctrl $ctrlVals(volatileFrm) { set pos [lsearch $ctrl "-name"] if {$pos != "-1"} { controlDestroy \ $ctrlVals(mainWindow).[lindex $ctrl [expr $pos + 1]] } } set ctrlVals(volatileFrm) ""}############################################################################### backCallback - close the current wizard page and return to the previous# wizard page## This procedure will close the current wizard page and return to the previous# wizard page## SYNOPSIS# .tS# backCallback# .tE## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc backCallback {} { global ctrlVals # decrement the dialog index and re-create previous page set currPageIndex [lsearch $ctrlVals(pageList) $ctrlVals(currPage)] set prevPageIndex [expr $currPageIndex - 1] if {"$prevPageIndex" >= "0"} { set ctrlVals(currPage) [lindex $ctrlVals(pageList) $prevPageIndex] destroyVolatileFrm pageCreate($ctrlVals(currPage)) } else { messageBox "Can't go back further!" }}############################################################################### calcPage - return the difference in the desired page index and the current # page index ## This procedure will return the difference in the desired page index and# the current page index## SYNOPSIS# .tS# calcPage <desiredPage># .tE## PARAMETERS:# .IP desiredPage # page name of wizard to go next## RETURNS: N/A## ERRORS: N/A#proc calcPage {desiredPage} { global ctrlVals # jump to the desired page set desiredIndex [lsearch $ctrlVals(pageList) $desiredPage] set currentPageIndex [lsearch $ctrlVals(pageList) $ctrlVals(currPage)] set retval [expr $desiredIndex - $currentPageIndex] return $retval}############################################################################### restoreOriginalDialog - restore the original dialog size## This procedure will restore the original dialog size## SYNOPSIS# .tS# restoreOriginalDialog# .tE## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc restoreOriginalDialog {} { global ctrlVals global env set ctrlVals(restoredDialog) 1 windowShow $ctrlVals(mainWindow) -restore 1 if {![info exists env(SETUP_USEKDE)]} { windowPositionSet $ctrlVals(mainWindow) [expr $ctrlVals(dlg_orig_xpos)] \ [expr $ctrlVals(dlg_orig_ypos)] } controlHide $ctrlVals(mainWindow).bitmap 0 # hide the "phony" Next button and restore the original button. # See the procedure "resizeBbrdDialog". controlHide $ctrlVals(mainWindow).phonynextButt 1 controlHide $ctrlVals(mainWindow).nextButt 0 controlPropertySet $ctrlVals(mainWindow).nextButt -defaultbutton 1 controlSizeSet $ctrlVals(mainWindow).frm2 \ [lindex $ctrlVals(dlg_orig_frm2_size) 0] \ [lindex $ctrlVals(dlg_orig_frm2_size) 1] controlPositionSet $ctrlVals(mainWindow).frm2 \ [lindex $ctrlVals(dlg_orig_frm2_pos) 0] \ [lindex $ctrlVals(dlg_orig_frm2_pos) 1] controlPositionSet $ctrlVals(mainWindow).backButt \ [lindex $ctrlVals(dlg_orig_back_pos) 0] \ [lindex $ctrlVals(dlg_orig_back_pos) 1] controlPositionSet $ctrlVals(mainWindow).nextButt \ [lindex $ctrlVals(dlg_orig_next_pos) 0] \ [lindex $ctrlVals(dlg_orig_next_pos) 1] controlPositionSet $ctrlVals(mainWindow).cancelButt \ [lindex $ctrlVals(dlg_orig_cancel_pos) 0] \ [lindex $ctrlVals(dlg_orig_cancel_pos) 1] if {![info exists env(SETUP_USEKDE)]} { windowSizeSet $ctrlVals(mainWindow) [lindex $ctrlVals(dlg_orig_size) 0] \ [lindex $ctrlVals(dlg_orig_size) 1] }}############################################################################### nextCallback - go to the next wizard page## This procedure will take Setup to the next wizard page as if next button# is pushed## SYNOPSIS# .tS# nextCallback# .tE## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc nextCallback {} { global ctrlVals global setupVals set retVal 0 if {"$ctrlVals(currPage)" == ""} { return $retVal } set processRetVal [pageProcess($ctrlVals(currPage))] if {$processRetVal == "1"} { set currPageIndex [lsearch $ctrlVals(pageList) $ctrlVals(currPage)] if {"$currPageIndex" != "-1"} { set nextPageIndex [expr $currPageIndex + 1] set nextPage [lindex $ctrlVals(pageList) $nextPageIndex] if {"$nextPage" != ""} { set ctrlVals(currPage) $nextPage destroyVolatileFrm if {[info exists ctrlVals(restoredDialog)]} { if {$ctrlVals(restoredDialog) == 0} { restoreOriginalDialog } } pageCreate($nextPage) set retVal 1 } else { # temporary workaround for windowClose exit problem set setupVals(cancel) 1 applicationExit } } else { puts "error: page $ctrlVals(currPage) not found!" } } elseif {$processRetVal != "0"} { # calculate the current page based on the return value set currPageIndex [lsearch $ctrlVals(pageList) $ctrlVals(currPage)] set currPageIndex [expr $currPageIndex + $processRetVal] set maxVal [llength $ctrlVals(pageList)] if {"$currPageIndex" != "-1" && $currPageIndex <= $maxVal} { set nextPageIndex $currPageIndex set nextPage [lindex $ctrlVals(pageList) $nextPageIndex] if {"$nextPage" != ""} { set ctrlVals(currPage) $nextPage destroyVolatileFrm pageCreate($nextPage) set retVal 1 } else { applicationExit } } else { puts "error: page $ctrlVals(currPage) not found!" } } return $retVal}############################################################################### fileExistsNewerWarnExit - exit procedure for fileExistsNewerExit dialog box## This procedure is a exit procedure for fileExistsNewerExit dialog box## SYNOPSIS# .tS# fileExistsNewerWarnExit# .tE## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc fileExistsNewerWarnExit {} { global retvalNew if {[controlChecked file_exists_newer_warn.overwriteFile]} { set retvalNew 0 } if {[controlChecked file_exists_newer_warn.no_overwriteFile]} { set retvalNew 1 } if {[controlChecked file_exists_newer_warn.overwriteAll]} { set retvalNew 2 }}############################################################################### fileExistsNewerWarnInit - Init procedure for fileExistsNewerWarn dialog box## This procedure is a init procedure for fileExistsNewerWarn dialog box## SYNOPSIS# .tS# fileExistsNewerWarnInit# .tE## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc fileExistsNewerWarnInit {} { global retvalNew set retvalNew 2 windowExitCallbackSet file_exists_newer_warn fileExistsNewerWarnExit controlCheckSet file_exists_newer_warn.overwriteAll 1}############################################################################### fileExistsOlderWarnExit - exit procedure for fileExistsOlderExit dialog box## This procedure is a exit procedure for fileExistsOlderExit dialog box## SYNOPSIS# .tS# fileExistsOlderWarnExit# .tE## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc fileExistsOlderWarnExit {} { global retvalOld if {[controlChecked file_exists_older_warn.overwriteAll]} { set retvalOld 2 } if {[controlChecked file_exists_older_warn.no_overwriteFile]} { set retvalOld 0 } if {[controlChecked file_exists_older_warn.overwriteFile]} { set retvalOld 1 }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -