home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / browseentr.tcl < prev    next >
Encoding:
Text File  |  1996-08-27  |  2.4 KB  |  92 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cayenne Software Inc.    1996
  4. #
  5. #      File:           @(#)browseentr.tcl    /main/hindenburg/1
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)browseentr.tcl    /main/hindenburg/1   27 Aug 1996 Copyright 1996 Cayenne Software Inc.
  10.  
  11. # Start user added include file section
  12. require classmaker.tcl
  13. require wmt_util.tcl
  14. # End user added include file section
  15.  
  16.  
  17. Class BrowseEntryDlg : {TemplateDialog} {
  18.     constructor
  19.     method destructor
  20.     method handleBrowse
  21.     method handleHelp
  22.     method popUp
  23.     attribute message
  24.     attribute entry
  25. }
  26.  
  27. constructor BrowseEntryDlg {class this name} {
  28.     set this [TemplateDialog::constructor $class $this $name]
  29.     # Start constructor user section
  30.  
  31.     interface DlgColumn $this.top {
  32.         Label nameLab {}
  33.         SingleLineText name {}
  34.     }
  35.     PushButton new $this.browse \
  36.         -label "Browse..." \
  37.         -activated "$this handleBrowse"
  38.     $this config \
  39.         -modal yes \
  40.         -helpPressed "$this handleHelp"
  41.     $this.top.name textModified {
  42.         [getParent [getParent %this]] entry [%this text]
  43.     }
  44.  
  45.     # End constructor user section
  46.     return $this
  47. }
  48.  
  49. method BrowseEntryDlg::destructor {this} {
  50.     # Start destructor user section
  51.     # End destructor user section
  52. }
  53.  
  54. method BrowseEntryDlg::handleBrowse {this} {
  55.     set fileChooser .main.Browse[nt_get_type $this]
  56.     if {! [isCommand $fileChooser]} {
  57.     ClassMaker::extend FileChooser BrowseEntryDlgFileChooser dialog
  58.     BrowseEntryDlgFileChooser new $fileChooser \
  59.         -title "Command(s)" \
  60.         -selectionPolicy EXTENDED \
  61.         -filter "*" \
  62.         -dialog $this \
  63.         -okPressed {
  64.         set cmdLine ""
  65.         foreach command [%this selectedSet] {
  66.             if {"$cmdLine" != ""} {
  67.             append cmdLine " [SystemUtilities::cmdSeparator] "
  68.             }
  69.             append cmdLine $command
  70.         }
  71.         set dialog [%this dialog]
  72.         $dialog entry $cmdLine
  73.         $dialog.top.name text [$dialog entry]
  74.         }
  75.     $fileChooser delHelpButton
  76.     }
  77.     $fileChooser popUp
  78. }
  79.  
  80. method BrowseEntryDlg::handleHelp {this} {
  81.     [getParent $this] helpOnName [nt_get_type $this]
  82. }
  83.  
  84. method BrowseEntryDlg::popUp {this} {
  85.     $this.top.nameLab text [$this message]
  86.     $this.top.name text [$this entry]
  87.     $this TemplateDialog::popUp
  88. }
  89.  
  90. # Do not delete this line -- regeneration end marker
  91.  
  92.