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

📄 faxmail.tcl

📁 使用Mail发送传真的程序
💻 TCL
📖 第 1 页 / 共 5 页
字号:
  if {![IsADir $fsBox(internalPath)]} {    set $fsBox(internalPath) [pwd]  }  .fsBox.path.path insert 0 $fsBox(internalPath)  frame .fsBox.pattern  -borderwidth 0  -relief raised  catch ".fsBox.pattern config $tmpFrameOpt"  frame .fsBox.pattern.patterns  -borderwidth 2  -relief raised  catch ".fsBox.pattern.patterns config $tmpFrameOpt"  menubutton .fsBox.pattern.patterns.patterns  -borderwidth 0  -menu ".fsBox.pattern.patterns.patterns.menu"  -relief flat  -text "Selection pattern:"  catch ".fsBox.pattern.patterns.patterns config $tmpButtonOpt"  menu .fsBox.pattern.patterns.patterns.menu -tearoff 0  catch ".fsBox.pattern.patterns.patterns.menu config $tmpButtonOpt"  .fsBox.pattern.patterns.patterns.menu add checkbutton  -label "Scan extensions"  -variable fsBox(extensions)  -command {      global fsBox      FSBoxFSShow [.fsBox.path.path get]  [.fsBox.pattern.pattern get] $fsBox(all)}  entry .fsBox.pattern.pattern  -relief sunken  catch ".fsBox.pattern.pattern config $tmpMessageOpt"  .fsBox.pattern.pattern insert 0 $fsBox(pattern)    frame .fsBox.files  -borderwidth 0  -relief raised  catch ".fsBox.files config $tmpFrameOpt"  scrollbar .fsBox.files.vscroll  -relief raised  -command ".fsBox.files.files yview"  catch ".fsBox.files.vscroll config $tmpScrollOpt"  scrollbar .fsBox.files.hscroll  -orient horiz  -relief raised  -command ".fsBox.files.files xview"  catch ".fsBox.files.hscroll config $tmpScrollOpt"  listbox .fsBox.files.files  -exportselection false  -relief raised  -xscrollcommand ".fsBox.files.hscroll set"  -yscrollcommand ".fsBox.files.vscroll set"  catch ".fsBox.files.files config $tmpMessageOpt"  frame .fsBox.file  -borderwidth 0  -relief raised  catch ".fsBox.file config $tmpFrameOpt"  label .fsBox.file.labelfile  -relief raised  -text "Filename:"  catch ".fsBox.file.labelfile config $tmpMessageOpt"  entry .fsBox.file.file  -relief sunken  catch ".fsBox.file.file config $tmpMessageOpt"  .fsBox.file.file delete 0 end  .fsBox.file.file insert 0 $fsBox(name)    checkbutton .fsBox.pattern.all  -offvalue 0  -onvalue 1  -text "Show all files"  -variable fsBox(all)  -command {      global fsBox      FSBoxFSShow [.fsBox.path.path get]  [.fsBox.pattern.pattern get] $fsBox(all)}  catch ".fsBox.pattern.all config $tmpButtonOpt"  FSBoxFSShow $fsBox(internalPath) $fsBox(pattern) $fsBox(all)  # bindings  bindtags .fsBox.files.files {.fsBox.files.files "" "" "" }  bind .fsBox.files.files <Double-Button-1> "    FSBoxFSFileSelectDouble %W $fsBox(showPixmap) \{$fsBoxActionOk\} %y"  bind .fsBox.files.files <ButtonPress-1> "    FSBoxFSFileSelect %W $fsBox(showPixmap) %y"  bind .fsBox.files.files <Button1-Motion> "    FSBoxFSFileSelect %W $fsBox(showPixmap) %y"  bind .fsBox.files.files <Shift-Button1-Motion> "    FSBoxFSFileSelect %W $fsBox(showPixmap) %y"  bind .fsBox.files.files <Shift-ButtonPress-1> "    FSBoxFSFileSelect %W $fsBox(showPixmap) %y"  bind .fsBox.path.path <Tab> {    FSBoxFSNameComplete path}  bind .fsBox.path.path <Return> {    global fsBox    FSBoxFSShow [.fsBox.path.path get]  [.fsBox.pattern.pattern get] $fsBox(all)    FSBoxFSInsertPath    .fsBox.file.file icursor end    focus .fsBox.file.file}  catch "bind .fsBox.path.path <Up> {}"  bind .fsBox.path.path <Down> {    .fsBox.file.file icursor end    focus .fsBox.file.file}  bind .fsBox.file.file <Tab> {    FSBoxFSNameComplete file}  bind .fsBox.file.file <Return> "    global fsBox    set fsBox(name) \[.fsBox.file.file get\]    if {$fsBox(showPixmap)} {      set fsBox(path) @\[.fsBox.path.path get\]    } {      set fsBox(path) \[.fsBox.path.path get\]    }    set fsBox(internalPath) \[.fsBox.path.path get\]    $fsBoxActionOk    if {\"\[info commands XFDestroy\]\" != \"\"} {      catch {XFDestroy .fsBox}    } {      catch {destroy .fsBox}    }"  bind .fsBox.file.file <Up> {    .fsBox.path.path icursor end    focus .fsBox.path.path}  bind .fsBox.file.file <Down> {    .fsBox.pattern.pattern icursor end    focus .fsBox.pattern.pattern}  bind .fsBox.pattern.pattern <Return> {    global fsBox    FSBoxFSShow [.fsBox.path.path get]  [.fsBox.pattern.pattern get] $fsBox(all)}  bind .fsBox.pattern.pattern <Up> {    .fsBox.file.file icursor end    focus .fsBox.file.file}  catch "bind .fsBox.pattern.pattern <Down> {}"  # packing  pack append .fsBox.files  .fsBox.files.vscroll "$fsBox(scrollSide) filly"  .fsBox.files.hscroll {bottom fillx}  .fsBox.files.files {left fill expand}  pack append .fsBox.file  .fsBox.file.labelfile {left}  .fsBox.file.file {left fill expand}  pack append .fsBox.frame1  .fsBox.frame1.ok {left fill expand}  .fsBox.frame1.rescan {left fill expand}  .fsBox.frame1.cancel {left fill expand}  pack append .fsBox.path.paths  .fsBox.path.paths.paths {left}  pack append .fsBox.pattern.patterns  .fsBox.pattern.patterns.patterns {left}  pack append .fsBox.path  .fsBox.path.paths {left}  .fsBox.path.path {left fill expand}  pack append .fsBox.pattern  .fsBox.pattern.patterns {left}  .fsBox.pattern.all {right fill}  .fsBox.pattern.pattern {left fill expand}  if {$fsBox(showPixmap)} {    pack append .fsBox.frame2  .fsBox.frame2.scrollbar1 {left filly}  .fsBox.frame2.canvas2 {top expand fill}  .fsBox.frame2.scrollbar3 {top fillx}     pack append .fsBox  .fsBox.message1 {top fill}  .fsBox.frame1 {bottom fill}  .fsBox.pattern {bottom fill}  .fsBox.file {bottom fill}  .fsBox.path {bottom fill}  .fsBox.frame2 {right fill}  .fsBox.files {left fill expand}  } {    pack append .fsBox  .fsBox.message1 {top fill}  .fsBox.frame1 {bottom fill}  .fsBox.pattern {bottom fill}  .fsBox.file {bottom fill}  .fsBox.path {bottom fill}  .fsBox.files {left fill expand}  }  if {"$fsBoxActionOk" == "" && "$fsBoxActionCancel" == ""} {    # wait for the box to be destroyed    update idletask    grab .fsBox    tkwait window .fsBox    if {"[string trim $fsBox(path)]" != "" ||        "[string trim $fsBox(name)]" != ""} {      if {"[string trimleft [string trim $fsBox(name)] /]" == ""} {        return [string trimright [string trim $fsBox(path)] /]      } {        return [string trimright [string trim $fsBox(path)] /]/[string trimleft [string trim $fsBox(name)] /]      }    }  }}# Procedure: FSBoxBindSelectOneproc FSBoxBindSelectOne { fsBoxW fsBoxY} {# xf ignore me 6  set fsBoxNearest [$fsBoxW nearest $fsBoxY]  if {$fsBoxNearest >= 0} {    $fsBoxW select clear 0 end    $fsBoxW select set $fsBoxNearest  }}# Procedure: FSBoxFSFileSelectproc FSBoxFSFileSelect { fsBoxW fsBoxShowPixmap fsBoxY} {# xf ignore me 6  global fsBox  FSBoxBindSelectOne $fsBoxW $fsBoxY  set fsBoxNearest [$fsBoxW nearest $fsBoxY]  if {$fsBoxNearest >= 0} {    set fsBoxTmpEntry [$fsBoxW get $fsBoxNearest]    if {"[string index $fsBoxTmpEntry  [expr [string length $fsBoxTmpEntry]-1]]" == "/" ||        "[string index $fsBoxTmpEntry  [expr [string length $fsBoxTmpEntry]-1]]" == "@"} {      set fsBoxFileName [string range $fsBoxTmpEntry 0  [expr [string length $fsBoxTmpEntry]-2]]      if {![IsADir [string trimright $fsBox(internalPath)/$fsBoxFileName @]] &&          ![IsASymlink [string trimright $fsBox(internalPath)/$fsBoxFileName @]]} {        set fsBoxFileName $fsBoxTmpEntry      }    } {      if {"[string index $fsBoxTmpEntry  [expr [string length $fsBoxTmpEntry]-1]]" == "*"} {        set fsBoxFileName [string range $fsBoxTmpEntry 0  [expr [string length $fsBoxTmpEntry]-2]]        if {![file executable $fsBox(internalPath)/$fsBoxFileName]} {          set fsBoxFileName $fsBoxTmpEntry        }      } {        set fsBoxFileName $fsBoxTmpEntry      }    }    if {![IsADir [string trimright $fsBox(internalPath)/$fsBoxFileName @]]} {      set fsBox(name) $fsBoxFileName      .fsBox.file.file delete 0 end      .fsBox.file.file insert 0 $fsBox(name)      if {$fsBoxShowPixmap} {        catch ".fsBox.frame2.canvas2 itemconfigure currentBitmap -bitmap \"@$fsBox(internalPath)/$fsBox(name)\""      }    }  }}# Procedure: FSBoxFSFileSelectDoubleproc FSBoxFSFileSelectDouble { fsBoxW fsBoxShowPixmap fsBoxAction fsBoxY} {# xf ignore me 6  global fsBox  FSBoxBindSelectOne $fsBoxW $fsBoxY  set fsBoxNearest [$fsBoxW nearest $fsBoxY]  if {$fsBoxNearest >= 0} {    set fsBoxTmpEntry [$fsBoxW get $fsBoxNearest]    if {"$fsBoxTmpEntry" == "../"} {      set fsBoxTmpEntry [string trimright [string trim $fsBox(internalPath)] "@/"]      if {"$fsBoxTmpEntry" == ""} {        return      }      FSBoxFSShow [file dirname $fsBoxTmpEntry]  [.fsBox.pattern.pattern get] $fsBox(all)      .fsBox.path.path delete 0 end      .fsBox.path.path insert 0 $fsBox(internalPath)    } {      if {"[string index $fsBoxTmpEntry  [expr [string length $fsBoxTmpEntry]-1]]" == "/" ||          "[string index $fsBoxTmpEntry  [expr [string length $fsBoxTmpEntry]-1]]" == "@"} {        set fsBoxFileName [string range $fsBoxTmpEntry 0  [expr [string length $fsBoxTmpEntry]-2]]        if {![IsADir [string trimright $fsBox(internalPath)/$fsBoxFileName @]] &&            ![IsASymlink [string trimright $fsBox(internalPath)/$fsBoxFileName @]]} {          set fsBoxFileName $fsBoxTmpEntry        }      } {        if {"[string index $fsBoxTmpEntry  [expr [string length $fsBoxTmpEntry]-1]]" == "*"} {          set fsBoxFileName [string range $fsBoxTmpEntry 0  [expr [string length $fsBoxTmpEntry]-2]]          if {![file executable $fsBox(internalPath)/$fsBoxFileName]} {            set fsBoxFileName $fsBoxTmpEntry          }        } {          set fsBoxFileName $fsBoxTmpEntry        }      }      if {[IsADir [string trimright $fsBox(internalPath)/$fsBoxFileName @]]} {        set fsBox(internalPath) "[string trimright $fsBox(internalPath) {/@}]/$fsBoxFileName"        FSBoxFSShow $fsBox(internalPath)  [.fsBox.pattern.pattern get] $fsBox(all)        .fsBox.path.path delete 0 end        .fsBox.path.path insert 0 $fsBox(internalPath)      } {        set fsBox(name) $fsBoxFileName        if {$fsBoxShowPixmap} {          set fsBox(path) @$fsBox(internalPath)        } {          set fsBox(path) $fsBox(internalPath)        }        if {"$fsBoxAction" != ""} {          eval "global fsBox; $fsBoxAction"        }        if {"[info commands XFDestroy]" != ""} {          catch {XFDestroy .fsBox}        } {          catch {destroy .fsBox}        }      }    }  }}# Procedure: FSBoxFSInsertPathproc FSBoxFSInsertPath {} {# xf ignore me 6  global fsBox  set fsBoxLast [.fsBox.path.paths.paths.menu index last]  set fsBoxNewEntry [string trimright [.fsBox.path.path get] "/@"]  for {set fsBoxCounter 0} {$fsBoxCounter <= $fsBoxLast} {incr fsBoxCounter 1} {    if {"$fsBoxNewEntry" ==  "[lindex [.fsBox.path.paths.paths.menu entryconfigure  $fsBoxCounter -label] 4]"} {      return    }  }  if {$fsBoxLast < 9} {    .fsBox.path.paths.paths.menu add command  -label "$fsBoxNewEntry"  -command "        global fsBox        FSBoxFSShow $fsBoxNewEntry  \[.fsBox.pattern.pattern get\] \$fsBox(all)        .fsBox.path.path delete 0 end        .fsBox.path.path insert 0 $fsBoxNewEntry"  } {    for {set fsBoxCounter 0} {$fsBoxCounter < $fsBoxLast} {incr fsBoxCounter 1} {      .fsBox.path.paths.paths.menu entryconfigure  $fsBoxCounter -label  [lindex [.fsBox.path.paths.paths.menu entryconfigure  [expr $fsBoxCounter+1] -label] 4]      .fsBox.path.paths.paths.menu entryconfigure $fsBoxCounter  -command "          global fsBox          FSBoxFSShow [lindex [.fsBox.path.paths.paths.menu entryconfigure  [expr $fsBoxCounter+1] -label] 4]  \[.fsBox.pattern.pattern get\] \$fsBox(all)          .fsBox.path.path delete 0 end          .fsBox.path.path insert 0 [lindex  [.fsBox.path.paths.paths.menu entryconfigure  [expr $fsBoxCounter+1] -label] 4]"    }    .fsBox.path.paths.paths.menu entryconfigure $fsBoxLast  -label "$fsBoxNewEntry"    .fsBox.path.paths.paths.menu entryconfigure $fsBoxCounter  -command "        global fsBox        FSBoxFSShow \[.fsBox.path.path get\]  \[.fsBox.pattern.pattern get\] \$fsBox(all)        .fsBox.path.path delete 0 end        .fsBox.path.path insert 0 $fsBoxNewEntry"  }}# Procedure: FSBoxFSNameCompleteproc FSBoxFSNameComplete { fsBoxType} {# xf ignore me 6  global fsBox  set fsBoxNewFile ""  if {"$fsBoxType" == "path"} {    set fsBoxDirName [file dirname [.fsBox.path.path get]]    set fsBoxFileName [file tail [.fsBox.path.path get]]  } {    set fsBoxDirName [file dirname [.fsBox.path.path get]/]    set fsBoxFileName [file tail [.fsBox.file.file get]]  }  set fsBoxNewFile ""  if {[IsADir [string trimright $fsBoxDirName @]]} {    catch "glob -nocomplain $fsBoxDirName/${fsBoxFileName}*" fsBoxResult    foreach fsBoxCounter $fsBoxResult {      if {"$fsBoxNewFile" == ""} {        set fsBoxNewFile [file tail $fsBoxCounter]      } {        if {"[string index [file tail $fsBoxCounter] 0]" !=            "[string index $fsBoxNewFile 0]"} {          set fsBoxNewFile ""          break        }        set fsBoxCounter1 0        set fsBoxTmpFile1 $fsBoxNewFile        set fsBoxTmpFile2 [file tail $fsBoxCounter]        set fsBoxLength1 [string length $fsBoxTmpFile1]        set fsBoxLength2 [string length $fsBoxTmpFile2]        set fsBoxNewFile ""        if {$fsBoxLength1 > $fsBoxLength2} {          set fsBoxLength1 $fsBoxLength2        }        while {$fsBoxCounter1 < $fsBoxLength1} {          if {"[string index $fsBoxTmpFile1 $fsBoxCounter1]" ==  "[string index $fsBoxTmpFile2 $fsBoxCounter1]"} {            append fsBoxNewFile [string index $fsBoxTmpFile1 $fsBoxCounter1]          } {            break          }          incr fsBoxCounter1 1        }      }    }  }  if {"$fsBoxNewFile" != ""} {    if {[IsADir [string trimright $fsBoxDirName/$fsBoxNewFile @]] ||        ![IsAFile [string trimright $fsBoxDirName/$fsBoxNewFile @]]} {      if {[IsADir [string trimright $fsBoxDirName/$fsBoxNewFile @]]} {        if {"$fsBoxDirName" == "/"} {          .fsBox.path.path delete 0 end          .fsBox.path.path insert 0 "/[string trimright [string trim $fsBoxNewFile /] @]/"        } {          .fsBox.path.path delete 0 end          .fsBox.path.path insert 0 "[string trimright $fsBoxDirName /]/[string trimright [string trim $fsBoxNewFile /] @]/"        }        FSBoxFSShow [.fsBox.path.path get]  [.fsBox.pattern.pattern get] $fsBox(all)        FSBoxFSInsertPath      } {        .fsBox.path.path delete 0 end        .fsBox.path.path insert 0 "[string trimright $fsBoxDirName /]/[string trimright [string trim $fsBoxNewFile /] @]"      }    } {      .fsBox.path.path delete 0 end      .fsBox.path.path insert 0 "[string trimright $fsBoxDirName {@/}]/"      .fsBox.file.file delete 0 end      .fsBox.file.file insert 0 $fsBoxNewFile      .fsBox.file.file icursor end      focus .fsBox.file.file    }  }}# Procedure: FSBoxFSShowproc FSBoxFSShow { fsBoxPath fsBoxPattern fsBoxAll} {# xf ignore me 6  global fsBox  set tmpButtonOpt ""  if {"$fsBox(activeBackground)" != ""} {    append tmpButtonOpt "-activebackground \"$fsBox(activeBackground)\" "  }  if {"$fsBox(activeForeground)" != ""} {    append tmpButtonOpt "-activeforeground \"$fsBox(activeForeground)\" "  }  if {"$fsBox(background)" != ""} {    append tmpButtonOpt "-background \"$fsBox(background)\" "  }  if {"$fsBox(font)" != ""} {    append tmpButtonOpt "-font \"$fsBox(font)\" "  }  if {"$fsBox(foreground)" != ""} {    append tmpButtonOpt "-foreground \"$fsBox(foreground)\" "  }  set fsBox(pattern) $fsBoxPattern  if {[file exists $fsBoxPath] && [file readable $fsBoxPath] &&      [IsADir $fsBoxPath]} {    set fsBox(internalPath) $fsBoxPath  } {    if {[file exists $fsBoxPath] && [file readable $fsBoxPath] &&        [IsAFile $fsBoxPath]} {      set fsBox(internalPath) [file dirname $fsBoxPath]      .fsBox.file.file delete 0 end      .fsBox.file.file insert 0 [file tail $fsBoxPath]      set fsBoxPath $fsBox(internalPath)    } {      while {"$fsBoxPath" != "" && "$fsBoxPath" != "/" &&             ![file isdirectory $fsBoxPath]} {        set fsBox(internalPath) [file dirname $fsBoxPath]         set fsBoxPath $fsBox(internalPath)      }    }  }  if {"$fsBoxPath" == ""} {    set fsBoxPath "/"    set fsBox(internalPath) "/"  }  .fsBox.path.path delete 0 end  .fsBox.path.path insert 0 $fsBox(internalPath)  if {[.fsBox.files.files size] > 0} {    .fsBox.files.files delete 0 end  }  if {$fsBoxAll} {    if {[catch "Ls -F -a $fsBoxPath" fsBoxResult]} {      puts stderr "$fsBoxResult"    }  } {    if {[catch "Ls -F $fsBoxPath" fsBoxResult]} {

⌨️ 快捷键说明

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