📄 conftooldlg.tcl
字号:
set flags "${flags} [$itk_option(-toolchain) GetRuleFlags $itk_option(-rule) Warning\ $warnLookUp([${warnLBX} get])]" set flags "${flags} [$itk_option(-toolchain) GetRuleFlags $itk_option(-rule) CodeGen\ $codeLookUp([${codeLBX} get])]" # Get user flags set userflags [${uflagsENT} get] # Get the marco defs set defines_list [${UserDefsList} get 0 end] set defines_spec [$itk_option(-toolchain) FormatDefines $itk_option(-rule)\ ${defines_list}] # Get the include paths set includes_list1 [${AutoGenList} get 0 end] set includes_list2 [${UserGenList} get 0 end] set includes_list [concat ${includes_list1} ${includes_list2}] set include_spec [$itk_option(-toolchain) FormatIncludes $itk_option(-rule)\ ${includes_list}] return "${tool} ${basicaction} ${flags} ${userflags} ${defines_spec}\ ${include_spec}" } method InitializeFlagData {} { SetDebugFlags SetWarningFlags SetOptimizationFlags SetCodeGenerationFlags SetUserFlags SetCompilerLocation # Includes tab SetGeneratedIncludes SetUserIncludes # Defines tab SetDefinesList } method SetDebugFlags {{flags ""}} { global FlagTags if {${flags}==""} { #Let check the build object set flags [$itk_option(-buildtarget) GetToolChainFlags $itk_option(-rule) Debug] } else { set flags [$itk_option(-buildtarget) SetToolChainFlags $itk_option(-rule) Debug ${flags}] } if {${flags}==""} { # Select the first one in the list as default combobox::select ${debugLBX} 0 } else { #set it to editable first ${debugLBX} configure -editable 1 #Delete current selection ${debugLBX} delete 0 end #Add stored selection ${debugLBX} insert 0 "$FlagTags(${flags})" #Disable edit again ${debugLBX} configure -editable 0 } } method SetWarningFlags {{flags ""}} { global FlagTags if {${flags}==""} { #Let check the build object set flags [$itk_option(-buildtarget) GetToolChainFlags $itk_option(-rule) Warning] } else { set flags [$itk_option(-buildtarget) SetToolChainFlags $itk_option(-rule) Warning\ ${flags}] } if {${flags}==""} { # Select the first one in the list as default combobox::select ${warnLBX} 0 } else { #set it to editable first ${warnLBX} configure -editable 1 #Delete current selection ${warnLBX} delete 0 end #Add stored selection ${warnLBX} insert 0 "$FlagTags(${flags})" #Disable edit again ${warnLBX} configure -editable 0 } } method SetOptimizationFlags {{flags ""}} { global FlagTags if {${flags}==""} { #Let check the build object set flags [$itk_option(-buildtarget) GetToolChainFlags $itk_option(-rule) Optimize] } else { set flags [$itk_option(-buildtarget) SetToolChainFlags $itk_option(-rule) Optimize\ ${flags}] } if {${flags}==""} { # Select the first one in the list as default combobox::select ${optimizeLBX} 0 } else { #set it to editable first ${optimizeLBX} configure -editable 1 #Delete current selection ${optimizeLBX} delete 0 end #Add stored selection ${optimizeLBX} insert 0 "$FlagTags(${flags})" #Disable edit again ${optimizeLBX} configure -editable 0 } } method SetCodeGenerationFlags {{flags ""}} { global FlagTags if {${flags}==""} { #Let check the build object set flags [$itk_option(-buildtarget) GetToolChainFlags $itk_option(-rule) CodeGen] } else { set flags [$itk_option(-buildtarget) SetToolChainFlags $itk_option(-rule) CodeGen\ ${flags}] } if {${flags}==""} { # Select the first one in the list as default combobox::select ${codeLBX} 0 } else { #set it to editable first ${codeLBX} configure -editable 1 #Delete current selection ${codeLBX} delete 0 end #Add stored selection ${codeLBX} insert 0 "$FlagTags(${flags})" #Disable edit again ${codeLBX} configure -editable 0 } } method SetUserFlags {{flags ""}} { if {${flags}==""} { set flags [$itk_option(-buildtarget) GetToolChainFlags $itk_option(-rule) UserFlags] # Clean current entry ${uflagsENT} delete 0 end ${uflagsENT} insert 0 ${flags} } else { $itk_option(-buildtarget) SetToolChainFlags $itk_option(-rule) UserFlags ${flags} } } method SetCompilerLocation {{local ""}} { set tc_local [$itk_option(-toolchain) GetTool $itk_option(-rule)] set bt_local [$itk_option(-buildtarget) GetToolChainFlags $itk_option(-rule) ToolLocation] if {${local}==""} { set local ${bt_local} if {${local}==""} { set local ${tc_local} } [${exeLEB} component entry] delete 0 end [${exeLEB} component entry] insert 0 ${local} } else { # Don't save compiler location if # it's the same as the toolchain one. # This may course confusion later. if {${local}==${tc_local}} { # Clear the ToolLocation field. $itk_option(-buildtarget) SetToolChainFlags $itk_option(-rule) ToolLocation "" } else { $itk_option(-buildtarget) SetToolChainFlags $itk_option(-rule) ToolLocation ${local} } } } method IncludesPage {leaf} { set leaffr [frame ${leaf}.frame] # Auto generated includes set AutoGenLabel [label ${leaffr}.aglbl -text [get_indep String\ IDEBRAutoGenPathsLabel]] # Use this frame to hold listbox and scrollbars. set AutoGen [frame $leaffr.scrolllistbox -relief sunken\ -borderwidth 2] scrollbar $AutoGen.vertsb -orient vertical \ -relief flat -borderwidth 1 -highlightthickness 0 scrollbar $AutoGen.horizsb -orient horizontal \ -relief flat -borderwidth 1 -highlightthickness 0 set AutoGenList [listbox $AutoGen.aglbx -height 3 -width 55 \ -relief flat -borderwidth 0 \ -xscrollcommand "scrollListbox $AutoGen.horizsb" \ -yscrollcommand "scrollListbox $AutoGen.vertsb"] $AutoGen.vertsb configure -command "$AutoGenList yview" $AutoGen.horizsb configure -command "$AutoGenList xview" grid $AutoGenList -row 1 -column 1 -sticky news grid $AutoGen.vertsb -row 1 -column 2 -sticky ns grid $AutoGen.horizsb -row 2 -column 1 -sticky ew grid [frame $AutoGen.dummyframe -relief groove -borderwidth 2] -row 2 -column 2 -sticky news grid columnconfigure $AutoGen 1 -weight 1 grid rowconfigure $AutoGen 1 -weight 1 # User includes set UserGenLabel [label ${leaffr}.uglbl -text [get_indep String\ IDEBRUserGenPathsLabel]] # Use this frame to hold listbox and scrollbars. set UserGen [frame $leaffr.ug_scrolllistbox -relief sunken\ -borderwidth 2] scrollbar $UserGen.vertsb -orient vertical \ -relief flat -borderwidth 1 -highlightthickness 0 scrollbar $UserGen.horizsb -orient horizontal \ -relief flat -borderwidth 1 -highlightthickness 0 set UserGenList [listbox $UserGen.uglbx -height 3 -width 55 \ -relief flat -borderwidth 0 \ -xscrollcommand "scrollListbox $UserGen.horizsb" \ -yscrollcommand "scrollListbox $UserGen.vertsb"] $UserGen.vertsb configure -command "$UserGenList yview" $UserGen.horizsb configure -command "$UserGenList xview" grid $UserGenList -row 1 -column 1 -sticky news grid $UserGen.vertsb -row 1 -column 2 -sticky ns grid $UserGen.horizsb -row 2 -column 1 -sticky ew grid [frame $UserGen.dummyframe -relief groove -borderwidth 2] -row 2 -column 2 -sticky news grid columnconfigure $UserGen 1 -weight 1 grid rowconfigure $UserGen 1 -weight 1 #The Buttons set GenButt [button ${leaf}.gbut -width 11 -text [get_indep String\ IDEBRGeneratePaths] -under [get_indep Pos IDEBRGeneratePaths]\ -command " ${this} generate_cb "] set DelButt [button ${leaf}.dbut -width 11 -text [get_indep String\ IDEBRDeletePath] -under [get_indep Pos IDEBRDeletePath] -command\ " ${this} cb_deletepath "] set AddButt [button ${leaf}.abut -width 11 -text [get_indep String\ IDEBRAddPath] -under [get_indep Pos IDEBRAddPath] -command " ${this}\ cb_addincpath "] grid x $AutoGenLabel - x x x -sticky w grid x $AutoGen - x $GenButt x -sticky we grid x $UserGenLabel - x $DelButt x -sticky w grid x $UserGen - x $AddButt x -sticky we grid rowconfigure ${leaffr} 1 -minsize 10 grid columnconfigure $leaffr 0 -minsize 10 grid columnconfigure $leaffr 1 -weight 10 -minsize 10 grid columnconfigure $leaffr 2 -weight 20 grid columnconfigure $leaffr 3 -minsize 10 grid columnconfigure $leaffr 5 -minsize 10 -weight 0 # Pull the includes leaf in the notebook. grid ${leaffr} -column 1 -row 1 -rowspan 3 -sticky we grid columnconfigure ${leaf} 2 -weight 1 grid columnconfigure ${leaf} 3 -minsize 10 } method generate_cb {} { set includeslist [GenerateIncludesList] SetGeneratedIncludes ${includeslist} $itk_option(-buildtarget) SetAutoIncludes $itk_option(-rule) ${includeslist} } method cb_deletepath {} { # Get the auto gen list selection set selected [${AutoGenList} curselect] if {${selected}==""} { # Nothing selected, check the User list set selected [${UserGenList} curselect] if {${selected}==""} { # Nothing selected return } ${UserGenList} delete ${selected} } else { ${AutoGenList} delete ${selected} } } method GenerateIncludesList {} { set srcfiles [$itk_option(-buildtarget) GetSourceFiles] set includepaths [GenerateIncludePaths ${srcfiles}] return ${includepaths} } method SetGeneratedIncludes {{includes ""}} { if {${includes}==""} { set includes [$itk_option(-buildtarget) GetAutoIncludes $itk_option(-rule)] } else { $itk_option(-buildtarget) SetAutoIncludes $itk_option(-rule) ${includes} } # Clear old entries. ${AutoGenList} delete 0 end # Set new entries. set tmpcmd "${AutoGenList} insert end ${includes}" eval ${tmpcmd} } method SetUserIncludes {{includes ""}} { if {${includes}==""} { set includes [$itk_option(-buildtarget) GetUserIncludes $itk_option(-rule)] } else { if {${includes}=="<%none%>"} { set includes "" } $itk_option(-buildtarget) SetUserIncludes $itk_option(-rule) ${includes} } if {${includes}!=""} { # Clear old entries.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -