📄 01zinc.win32.tcl
字号:
} set line [gets $fd] } close $fd controlSelectionSet ZincConfig.zincArchList -string $zincArchType # set values for each page zincMiscConfig zincCompileConfig set zincConfigChange 0 set zincConfigModify 1 zincSetButtonState 1 set zincLoadNewConfig 0 endWaitCursor} ###################################################################### zincConfigSave - save a configuration#proc zincConfigSave {} { global zincConfigList global zincArchType global zincConfigDir global zincConfigChange global zincConfigModify global zincConfigName set fstr "%-30s : %s" set configname [controlValuesGet ZincConfig.zincFileList -edit] if {$configname == ""} { messageBox "Need to specify a configuation file" return } set fd [open $zincConfigDir/$configname.cfg w] set dateInfo "[lindex [date] 1]/[lindex [date] 3]/[lindex [date] 0] [lindex [date] 4]:[lindex [date] 5]:[lindex [date] 6]" puts $fd "# DO NOT MODIFY THIS FILE - GENERATED AUTOMATICALLY" puts $fd [format "# File: %s.cfg" $configname] puts $fd [format "# Creation date: %s" $dateInfo] puts $fd [format $fstr "ARCHITECTURE" $zincArchType ] # Output general configuration values puts $fd [format $fstr "BUILD_DEBUG" [controlChecked ZincConfig.zincDebug]] puts $fd [format $fstr "BUILD_TOOL" [controlSelectionGet ZincConfig.zincToolList -string]] # Output compile configuration values puts $fd [format $fstr "ZINC_UNICODE" [controlChecked ZincConfig.zincUnicode]] puts $fd [format $fstr "ZINC_CODE_SET" [controlChecked ZincConfig.zincCodeSet]] puts $fd [format $fstr "ZINC_ERROR_SYS" [controlChecked ZincConfig.zincError]] puts $fd [format $fstr "ZINC_HELP_TIPS" [controlChecked ZincConfig.zincHelpTips]] puts $fd [format $fstr "ZINC_KEYBOARD" [controlChecked ZincConfig.zincKeyboard]] puts $fd [format $fstr "ZINC_MOUSE" [controlChecked ZincConfig.zincMouse]] puts $fd [format $fstr "ZINC_SEARCH_PATH" [controlChecked ZincConfig.zincSearchPath]] puts $fd [format $fstr "ZINC_PERIST" [controlChecked ZincConfig.zincPersist]] puts $fd [format $fstr "ZINC_READ" [controlChecked ZincConfig.zincRead]] puts $fd [format $fstr "ZINC_WRITE" [controlChecked ZincConfig.zincWrite]] puts $fd "" close $fd set zincConfigChange 0 set zincConfigModify 1 # Update the list of configuration files zincSetFileList controlSelectionSet ZincConfig.zincFileList -string $configname}###################################################################### zincConfigDelete - delete a configuration#proc zincConfigDelete {args} { global zincConfigDir # Get the configuration file name set configname [controlValuesGet ZincConfig.zincFileList -edit] if {$configname == ""} { return } set zincDeleteWarningMsg "Do you want to remove the configuration $configname?" set answer [messageBox -yesno $zincDeleteWarningMsg ] if {[string match $answer no]} { return } # remove configuration file if {[file exist $zincConfigDir/$configname.cfg] == "1"} { rm $zincConfigDir/$configname.cfg } # Update the list of configuration files zincSetFileList}###################################################################### zincWriteConfigH - generate the configuration header file#proc zincWriteConfigH {configname dateInfo} { global zincFileWarningMsg global zincArchType global zincConfigDir global env # Write out file configuration to config.h file set fd [open $zincConfigDir/zinccnfg.h w] puts $fd "/* zinccnfg.h - Zinc configuration header file */" puts $fd $zincFileWarningMsg puts $fd [format "/* File created %s from %s */" $dateInfo $configname] puts $fd "" puts $fd "/*" puts $fd " * Because some defines may be prevously defined in z_env.hpp " puts $fd " * most must be undefined." puts $fd "*/" # Generate needed #defines. puts $fd "#undef ZAF_ISO8859_1" puts $fd "#undef ZAF_UNICODE" if {[controlChecked ZincConfig.zincUnicode]} { puts $fd "#define ZAF_UNICODE" } else { puts $fd "#define ZAF_ISO8859_1" } puts $fd "" puts $fd "#undef USE_ZAF_CODE_SET_DATA" if {[controlChecked ZincConfig.zincCodeSet]} { puts $fd "#define USE_ZAF_CODE_SET_DATA" } puts $fd "" puts $fd "#undef USE_ZAF_ERROR_SYSTEM" if {[controlChecked ZincConfig.zincError]} { puts $fd "#define USE_ZAF_ERROR_SYSTEM" } puts $fd "" puts $fd "#undef USE_ZAF_HELP_TIPS" if {[controlChecked ZincConfig.zincHelpTips]} { puts $fd "#define USE_ZAF_HELP_TIPS" } puts $fd "" puts $fd "#undef USE_ZAF_KEYBOARD" if {[controlChecked ZincConfig.zincKeyboard]} { puts $fd "#define USE_ZAF_KEYBOARD" } puts $fd "" puts $fd "#undef USE_ZAF_MOUSE" if {[controlChecked ZincConfig.zincMouse]} { puts $fd "#define USE_ZAF_MOUSE" } puts $fd "" puts $fd "#undef USE_ZAF_SEARCH_PATH" if {[controlChecked ZincConfig.zincSearchPath]} { puts $fd "#define USE_ZAF_SEARCH_PATH" } puts $fd "" puts $fd "#undef USE_ZAF_PERSISTENCE" if {[controlChecked ZincConfig.zincPersist]} { puts $fd "#define USE_ZAF_PERSISTENCE" } if {![controlChecked ZincConfig.zincPersist] || ![controlChecked ZincConfig.zincRead]} { puts $fd "#define EXCLUDE_ZAF_READ" } if {![controlChecked ZincConfig.zincPersist] || ![controlChecked ZincConfig.zincWrite]} { puts $fd "#define EXCLUDE_ZAF_WRITE" } puts $fd "" # Make sure ZAF_ITEXT is definded correctly. puts $fd "/* Make sure ZAF_ITEXT is defined correctly. */" puts $fd "#undef ZAF_ITEXT" puts $fd "#if defined(ZAF_UNICODE)" puts $fd "# define ZAF_ITEXT(x) L ## x" puts $fd "#else" puts $fd "# define ZAF_ITEXT(x) x" puts $fd "#endif" close $fd}###################################################################### zincConfigApply - generate the data file for a configuration#proc zincConfigApply {} { set configname [controlValuesGet ZincConfig.zincFileList -edit] if {$configname == ""} { messageBox "Need to specify a configuration file" return } beginWaitCursor set dateInfo "[lindex [date] 1]/[lindex [date] 3]/[lindex [date] 0] [lindex [date] 4]:[lindex [date] 5]:[lindex [date] 6]" zincWriteConfigH $configname $dateInfo endWaitCursor}###################################################################### zincConfigBuild - process the "build" button to build the ugl# system#proc zincConfigBuild {} { global zincArchType global zincConfigModify global zincConfigChange global zincToolDB global zincToolAllList global zincConfigMisc set zincBuildWarningMsg \"If a Configuration Option has been changed then a Clean Build must be done.Do you want to continue?" set answer [messageBox -yesno $zincBuildWarningMsg ] if {[string match $answer no]} { return } # if configuration changed then force a modified config file if { $zincConfigChange == 1 } { set zincConfigModify 1 } # Generate source code if { $zincConfigModify == 1 } { zincConfigApply } set zincConfigModify 0 # split out the processor type/BSP set archType [split $zincArchType - ] set cpuType [lindex $archType 0] # check for debug set debugMode "" if {[controlChecked ZincConfig.zincDebug]} { controlCheckSet ZincConfig.zincDebug 1 set debugMode "\\\"FLAGS+=-g\\\"" } # get the tool to use for build set tool $zincToolDB($zincConfigMisc(BUILD_TOOL),TOOL) buildLaunch "Build Zinc" "make.exe CPU=$cpuType TOOL=$tool $debugMode NEW_DEFINES=-DZINC_CONFIG_TOOL configtoolApplibs" [wtxPath target src]zinc}###################################################################### zincConfigBuildClean - process the "Build Clean" button to build # the zinc system#proc zincConfigBuildClean {} { global zincArchType global zincConfigModify global zincConfigChange global zincConfigMisc global zincToolDB # if configuration changed then force a modified config file if { $zincConfigChange == 1 } { set zincConfigModify 1 } # Generate source code if { $zincConfigModify == 1 } { zincConfigApply } set zincConfigModify 0 # split out the processor type/BSP set archType [split $zincArchType - ] set cpuType [lindex $archType 0] # get the tool to use for build set tool $zincToolDB($zincConfigMisc(BUILD_TOOL),TOOL) # check for debug set debugMode "" if {[controlChecked ZincConfig.zincDebug]} { controlCheckSet ZincConfig.zincDebug 1 set debugMode "\\\"FLAGS+=-g\\\"" } buildLaunch "Build Zinc" "make.exe CPU=$cpuType TOOL=$tool $debugMode NEW_DEFINES=-DZINC_CONFIG_TOOL configtoolApplibsClean" [wtxPath target src]zinc}###################################################################### zincConfigClean - process the "clean" button to execute the # clean target in make file#proc zincConfigClean {} { global zincArchType global zincConfigMisc global zincToolDB set zincCleanWarningMsg \"Performing a clean operation will remove all object files.Continuing will require a rebuild of all multimedia components.Do you want to continue?" set answer [messageBox -yesno $zincCleanWarningMsg ] if {[string match $answer no]} { return } # split out the processor type/BSP set archType [split $zincArchType - ] set cpuType [lindex $archType 0] # get the tool to use for build set tool $zincToolDB($zincConfigMisc(BUILD_TOOL),TOOL) buildLaunch "Clean Zinc" "make.exe CPU=$cpuType TOOL=$tool zincrclean" [wtxPath target src]zinc }###################################################################### zincSelectArch - process a menu pull-down for selection of the# processor achitecture#proc zincSelectArch {args} { global zincLoadNewConfig global zincArchType global zincOldArchType global zincConfigChange set zincArchType [controlSelectionGet ZincConfig.zincArchList -string] if { [ string compare $zincOldArchType $zincArchType ] } { set zincConfigChange 1 } zincSetButtonState 1 zincMiscConfig}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -