📄 targetedit.tcl
字号:
$itk_component(srctree2) insert 0 -text Files fill_file_tree -widget $itk_component(srctree2) \ -contents ${AllProjectFiles} -parent 0 itk_component add arf { button $itk_component(sourcepage).arf \ -width 11 \ -command "${this} AddSourceFiles" \ -text [get_indep String IDETEAddFiles] \ -under [get_indep Pos IDETEAddFiles] } itk_component add pfs { label $itk_component(sourcepage).pfs \ -text [get_indep String IDETEProjectFiles] } itk_component add tfs { label $itk_component(sourcepage).tfs \ -text [get_indep String IDETETargetFile] } itk_component add clbut { button $itk_component(sourcepage).clbut \ -width 11 \ -command "${this} RemoveSourceFiles" \ -text [get_indep String IDETEClearFile] \ -under [get_indep Pos IDETEClearFile] } itk_component add clallbut { button $itk_component(sourcepage).clallbut \ -width 11 \ -command "${this} RemoveAllSourceFiles" \ -text [get_indep String IDETEClearAllFiles] } itk_component add impfbut { button $itk_component(sourcepage).impfbut \ -width 11 \ -command "${this} import_files" \ -text [get_indep String IDETEImportFiles] } itk_component add impdbut { button $itk_component(sourcepage).impdbut \ -width 11 \ -command "${this} import_dir" \ -text [get_indep String IDETEImportDir] } itk_component add implbl { label $itk_component(sourcepage).implbl \ -text [get_indep String IDETEImportLabel] }# FIXME : this could really stand to be redone from scratch grid columnconfigure $itk_component(sourcepage) 0 -minsize 10 grid rowconfigure $itk_component(sourcepage) 11 -minsize 10 grid rowconfigure $itk_component(sourcepage) 10 -weight 10 grid $itk_component(pfs) -column 1 -row 2 -sticky w grid $itk_component(trfr2) -column 1 -row 3 -rowspan 8 -sticky news grid columnconfigure $itk_component(sourcepage) 2 -minsize 10 grid $itk_component(arf) -column 3 -row 3 -pady 4 grid $itk_component(clbut) -column 3 -row 4 -pady 4 grid $itk_component(clallbut) -column 3 -row 5 -pady 4 grid rowconfigure $itk_component(sourcepage) 6 -minsize 20 grid $itk_component(implbl) -column 3 -row 7 -pady 4 grid $itk_component(impfbut) -column 3 -row 8 -pady 4 grid $itk_component(impdbut) -column 3 -row 9 -pady 4 grid columnconfigure $itk_component(sourcepage) 4 -minsize 10 grid $itk_component(tfs) -column 5 -row 2 -sticky w grid $itk_component(trfr1) -column 5 -row 3 -rowspan 8 -sticky news grid columnconfigure $itk_component(sourcepage) 5 -weight 10 grid columnconfigure $itk_component(sourcepage) 1 -weight 10 grid columnconfigure $itk_component(sourcepage) 6 -minsize 10 } public method AddSourceFiles {} { set sels [$itk_component(srctree2) curselection] set newfiles [build_file_list $itk_component(srctree2) tree ${sels}] ${b_target} AddSourceFiles ${newfiles} # Delete old entries $itk_component(srctree) delete 0 end $itk_component(srctree) insert 0 -text Files fill_file_tree -widget $itk_component(srctree) \ -contents [${b_target} GetSourceFiles] -parent end # Make sure the command lines are upto date. UpdateCmdLine } public method RemoveSourceFiles {} { set sels [$itk_component(srctree) curselection] set deadfiles [build_file_list $itk_component(srctree) tree ${sels}] ${b_target} RemoveSourceFiles ${deadfiles} # Delete old entries $itk_component(srctree) delete 0 end $itk_component(srctree) insert 0 -text Files fill_file_tree -widget $itk_component(srctree) \ -contents [${b_target} GetSourceFiles] -parent end # Make sure the command lines are upto date. UpdateCmdLine } public method RemoveAllSourceFiles {} { ${b_target} SetSourceFiles "" # Delete old entries $itk_component(srctree) delete 0 end $itk_component(srctree) insert 0 -text Files fill_file_tree -widget $itk_component(srctree) \ -contents [${b_target} GetSourceFiles] -parent end # Make sure the command lines are upto date. UpdateCmdLine } private method AddLibPage {} { # Add leafs for libraries files. itk_component add libpage { $itk_component(notebook) add lib \ -label [get_indep String IDETELibraryFileTab] \ -under [get_indep Pos IDETELibraryFileTab] }# FIXME: change all these widget and component names to something more readable itk_component add liblbl { label $itk_component(libpage).liblbl \ -text [get_indep String IDETELibraryLabel] } itk_component add liblbxfr { frame $itk_component(libpage).liblbxfr \ -relief sunken -borderwidth 2 } itk_component add liblbx { listbox $itk_component(liblbxfr).liblbx \ -relief flat \ -yscrollcommand [list $itk_component(liblbxfr).scrolly set] \ -xscrollcommand [list $itk_component(liblbxfr).scrollx set] } {} itk_component add liblbxfr_scrolly { scrollbar $itk_component(liblbxfr).scrolly \ -orient vertical \ -command [list $itk_component(liblbx) yview] } itk_component add liblbxfr_scrollx { scrollbar $itk_component(liblbxfr).scrollx \ -orient horizontal \ -command [list $itk_component(liblbx) xview] } grid $itk_component(liblbx) -row 0 -column 0 -sticky news grid $itk_component(liblbxfr_scrolly) -row 0 -column 1 -sticky ns grid $itk_component(liblbxfr_scrollx) -row 1 -column 0 -sticky we grid rowconfigure $itk_component(liblbxfr) 0 -weight 1 grid columnconfigure $itk_component(liblbxfr) 0 -weight 1 itk_component add libadd { button $itk_component(libpage).libadd \ -width 11 \ -command "${this} cb_add_lib" \ -text [get_indep String IDETEAddLib] \ -under [get_indep Pos IDETEAddLib] } itk_component add libdel { button $itk_component(libpage).libdel \ -width 11 \ -command "${this} cb_del_lib" \ -text [get_indep String IDETERemoveLib] \ -under [get_indep Pos IDETERemoveLib] } itk_component add libup { button $itk_component(libpage).libup \ -width 11 \ -command "${this} cb_up_lib" \ -text [get_indep String IDETEMoveUp] \ -under [get_indep Pos IDETEMoveUp] } itk_component add libdown { button $itk_component(libpage).libdown \ -width 11 \ -command "${this} cb_down_lib" \ -text [get_indep String IDETEMoveDown] \ -under [get_indep Pos IDETEMoveDown] } grid $itk_component(liblbl) -column 1 -row 2 -sticky w grid $itk_component(liblbxfr) -column 1 -row 3 -rowspan 5 -sticky news bind $itk_component(liblbx) <ButtonRelease> "${this} cb_double_click_lib" grid $itk_component(libadd) -column 4 -row 3 -pady 3 grid $itk_component(libdel) -column 4 -row 4 -pady 3 grid $itk_component(libup) -column 4 -row 5 -pady 3 grid $itk_component(libdown) -column 4 -row 6 -pady 3 grid rowconfigure $itk_component(libpage) 7 -weight 10 grid columnconfigure $itk_component(libpage) 1 -weight 10 grid rowconfigure $itk_component(libpage) 1 -minsize 10 grid rowconfigure $itk_component(libpage) 8 -minsize 10 grid columnconfigure $itk_component(libpage) 0 -minsize 10 grid columnconfigure $itk_component(libpage) 3 -minsize 10 grid columnconfigure $itk_component(libpage) 5 -minsize 10 } public method import_dir {} { set dir [Editor&::DirDialog $itk_component(hull) -title "Import Directory"] set importedSrcFiles [sn_glob ${dir}] if {${importedSrcFiles} != ""} { ${b_target} AddSourceFiles ${importedSrcFiles} # Delete old entries $itk_component(srctree) delete 0 end $itk_component(srctree) insert 0 -text Files fill_file_tree -widget $itk_component(srctree) -contents\ [${b_target} GetSourceFiles] -parent end # Make sure the command lines are upto date. UpdateCmdLine } } public method import_files {} { set importedSrcFiles [Editor&::FileDialog $itk_component(hull)] if {${importedSrcFiles} != ""} { ${b_target} AddSourceFiles ${importedSrcFiles} # Delete old entries $itk_component(srctree) delete 0 end $itk_component(srctree) insert 0 -text Files fill_file_tree -widget $itk_component(srctree) -contents\ [${b_target} GetSourceFiles] -parent end # Make sure the command lines are upto date. UpdateCmdLine } } private method AddRulesPage {} { # Add page for build rules. itk_component add buildpage { $itk_component(notebook) add buildpage \ -label [get_indep String IDETEBuildRulesTab] \ -under [get_indep Pos IDETEBuildRulesTab] } itk_component add buildruletable { # We use Tree here, but in other places we use sn_treetable. What gives? Tree $itk_component(buildpage).buildruletable \ -tabs {70 100 420} \ -filter {} \ -indentwidth 20 -tabsize 2 \ -labels "{Status} {File Type} {Description}" } {} $itk_component(buildruletable) treebind <Double-1> "${this} ruletable_double_cb" $itk_component(buildruletable) treebind <ButtonRelease-1> "${this} UpdateCmdLine" $itk_component(buildruletable) treebind <KeyRelease> "${this} UpdateCmdLine" $itk_component(buildruletable) treebind <Expose> "${this} rules_tab_selected_hack" itk_component add buildruleedit { button $itk_component(buildpage).buildruleedit \ -width 11 \ -command "${this} ruletable_double_cb" \ -text [get_indep String IDETEBuildRuleEdit] \ -under [get_indep Pos IDETEBuildRuleEdit] } itk_component add buildruledisable { button $itk_component(buildpage).buildruledisable \ -width 11 \ -command "${this} cb_rule_togle" \ -text [get_indep String IDETEBuildRuleDisable] \ -under [get_indep Pos IDETEBuildRuleDisable] } itk_component add displaycmdline { text $itk_component(buildpage).displaycmdline \ -width 1 } # Grid into a 5x3 array so we can center the buttons grid $itk_component(buildruletable) -row 0 -column 0 \ -columnspan 5 -sticky news grid $itk_component(buildruleedit) -row 1 -column 1 -pady 10 grid $itk_component(buildruledisable) -row 1 -column 3 -pady 10 grid $itk_component(displaycmdline) -row 2 -column 0 \ -columnspan 5 -sticky news # Expand the height of the third row when resized grid rowconfigure $itk_component(buildpage) 2 -weight 1 # All the columns need to be equally weighted for {set col 0} {$col < 5} {incr col} { grid columnconfigure $itk_component(buildpage) $col -weight 1 } # Make a nice border around the whole page $itk_component(buildpage) configure -borderwidth 10 } private method AddLinkPage {} { # Add leafs for linking rules itk_component add linkpage { $itk_component(notebook) add link \ -label [get_indep String IDETELinkRulesTab] \ -under [get_indep Pos IDETELinkRulesTab] } # Binary output file name itk_component add lfilelbl { label $itk_component(linkpage).lfilelbl \ -text [get_indep String IDETELinkOutputFile] }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -