home *** CD-ROM | disk | FTP | other *** search
/ PC World 1998 October / PCWorld_1998-10_cd.bin / software / prehled / komix / DATA.Z / newobjentr.tcl < prev    next >
Text File  |  1996-06-12  |  2KB  |  83 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cadre Technologies Inc.    1996
  4. #
  5. #      File:           @(#)newobjentr.tcl    /main/2
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)newobjentr.tcl    /main/2   12 Jun 1996 Copyright 1996 Cadre Technologies Inc.
  10.  
  11. # Start user added include file section
  12. require "wmt_util.tcl"
  13. # End user added include file section
  14.  
  15.  
  16. Class NewObjEntryDlg : {TemplateDialog} {
  17.     constructor
  18.     method destructor
  19.     method handleHelp
  20.     method handleTextModified
  21.     method popUp
  22.     attribute message
  23.     attribute entry
  24.     attribute createdObj
  25.     attribute dbObj
  26. }
  27.  
  28. constructor NewObjEntryDlg {class this name} {
  29.     set this [TemplateDialog::constructor $class $this $name]
  30.     # Start constructor user section
  31.  
  32.     interface DlgColumn $this.top {
  33.         Label nameLab {}
  34.         SingleLineText name {}
  35.     }
  36.     $this config \
  37.         -modal yes \
  38.         -helpPressed "$this handleHelp"
  39.     $this.top.name textModified "$this handleTextModified"
  40.  
  41.     # End constructor user section
  42.     return $this
  43. }
  44.  
  45. method NewObjEntryDlg::destructor {this} {
  46.     # Start destructor user section
  47.     # End destructor user section
  48. }
  49.  
  50. method NewObjEntryDlg::handleHelp {this} {
  51.     [getParent $this] helpOnName [nt_get_type $this]
  52. }
  53.  
  54. method NewObjEntryDlg::handleTextModified {this} {
  55.     if [isCommand $this.top.name] {
  56.     $this entry [$this.top.name text]
  57.     if {"[rmWhiteSpace [$this entry]]" == ""} {
  58.         set selected 0
  59.     } else {
  60.         set selected 1
  61.     }
  62.     } else {
  63.     set selected 1
  64.     }
  65.     $this okSensitive $selected
  66.     $this okDefault $selected
  67.     $this cancelDefault [expr 1 - $selected]
  68. }
  69.  
  70. method NewObjEntryDlg::popUp {this} {
  71.     if [isCommand $this.top.nameLab] {
  72.     $this.top.nameLab text [$this message]
  73.     }
  74.     if [isCommand $this.top.name] {
  75.     $this.top.name text [$this entry]
  76.     }
  77.     $this handleTextModified
  78.     $this TemplateDialog::popUp
  79. }
  80.  
  81. # Do not delete this line -- regeneration end marker
  82.  
  83.