home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Freeware 31 / FreelogHS31.iso / Texte / scribus / scribus-1.3.3.9-win32-install.exe / tcl / tix8.1 / FileDlg.tcl < prev    next >
Text File  |  2001-11-03  |  2KB  |  76 lines

  1. # -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
  2. #
  3. #    $Id: FileDlg.tcl,v 1.2.2.1 2001/11/03 06:43:50 idiscovery Exp $
  4. #
  5. # FileDlg.tcl --
  6. #
  7. #    Implements the File Selection Dialog widget.
  8. #
  9. # Copyright (c) 1993-1999 Ioi Kim Lam.
  10. # Copyright (c) 2000-2001 Tix Project Group.
  11. #
  12. # See the file "license.terms" for information on usage and redistribution
  13. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  14. #
  15.  
  16. tixWidgetClass tixFileSelectDialog {
  17.     -classname TixFileSelectDialog
  18.     -superclass tixStdDialogShell
  19.     -method {
  20.     }
  21.     -flag {
  22.     -command
  23.     }
  24.     -configspec {
  25.     {-command command Command ""}
  26.  
  27.     {-title title Title "Select A File"}
  28.     }
  29. }
  30.  
  31. proc tixFileSelectDialog:ConstructTopFrame {w frame} {
  32.     upvar #0 $w data
  33.  
  34.     tixChainMethod $w ConstructTopFrame $frame
  35.  
  36.     set data(w:fsbox) [tixFileSelectBox $frame.fsbox \
  37.     -command [list tixFileSelectDialog:Invoke $w]]
  38.     pack $data(w:fsbox) -expand yes -fill both
  39. }
  40.  
  41. proc tixFileSelectDialog:SetBindings {w} {
  42.     upvar #0 $w data
  43.  
  44.     tixChainMethod $w SetBindings
  45.  
  46.     $data(w:btns) subwidget ok     config -command "$data(w:fsbox) invoke" \
  47.     -underline 0
  48.     $data(w:btns) subwidget apply  config -command "$data(w:fsbox) filter" \
  49.     -text Filter -underline 0
  50.     $data(w:btns) subwidget cancel config -command "wm withdraw $w" \
  51.     -underline 0
  52.     $data(w:btns) subwidget help config -underline 0
  53.  
  54.  
  55.     bind $w <Alt-Key-l> "focus [$data(w:fsbox) subwidget filelist]"
  56.     bind $w <Alt-Key-d> "focus [$data(w:fsbox) subwidget dirlist]"
  57.     bind $w <Alt-Key-s> "focus [$data(w:fsbox) subwidget selection]"
  58.     bind $w <Alt-Key-t> "focus [$data(w:fsbox) subwidget filter]"
  59.     bind $w <Alt-Key-o> "tkButtonInvoke [$data(w:btns) subwidget ok]"
  60.     bind $w <Alt-Key-f> "tkButtonInvoke [$data(w:btns) subwidget apply]"
  61.     bind $w <Alt-Key-c> "tkButtonInvoke [$data(w:btns) subwidget cancel]"
  62.     bind $w <Alt-Key-h> "tkButtonInvoke [$data(w:btns) subwidget help]"
  63. }
  64.  
  65. proc tixFileSelectDialog:Invoke {w filename} {
  66.     upvar #0 $w data
  67.  
  68.     wm withdraw $w
  69.  
  70.     if {$data(-command) != ""} {
  71.     set bind(specs) "%V"
  72.     set bind(%V) $filename
  73.     tixEvalCmdBinding $w $data(-command) bind $filename
  74.     }
  75. }
  76.