home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / fdlg.zip / SAS_S.CLS < prev    next >
Text File  |  1996-02-02  |  2KB  |  74 lines

  1. "  ---- Ronald Brill 1995, 1996 ---- "
  2. "  ---- Extended File Dialogs Version 2.1 ---- "
  3.  
  4.  
  5. SaveAsDialogController SecondaryFile !
  6.  
  7.  
  8. ! SaveAsDialogController methods!
  9.  
  10.  
  11. makeDir
  12. | dir |
  13.    dir := (cItemDict at: #makeDirNewDir) getValue stripBlanks.
  14.    [ dir first == $\ ]
  15.    whileTrue:
  16.    [  dir := dir cdr.
  17.    ].
  18.    dir isEmpty
  19.    ifTrue:
  20.    [  ^ self.
  21.    ].
  22.    (dir cdr indexOf: $\) > 1
  23.    ifTrue:
  24.    [  ModalMessageBox
  25.          title: 'Error'
  26.          text:    'Can''t create subdirectorys'
  27.          icon:    #StopSign
  28.          buttons: {#Ok}
  29.          action:  nil
  30.          controller: self.
  31.          (cItemDict at: #makeDirNewDir) setFocus.
  32.          ^ self.
  33.    ].
  34.    dir := FileNameString newDriveName: drive dirName: (directory + $\ + dir) baseName: nil.
  35.    dir createDirectoryOnError:
  36.                [  ModalMessageBox
  37.                      title:   'Error'
  38.                      text:    'Can''t create directory' ++ dir
  39.                      icon:    #StopSign
  40.                      buttons: {#Ok}
  41.                      action:  nil
  42.                      controller: self.
  43.                      (cItemDict at: #makeDirNewDir) setFocus.
  44.                      ^ self.
  45.                ].
  46.    self walkTo: dir + $\.
  47.    self makeDirClose.
  48. !"end makeDir"
  49.  
  50.  
  51. makeDirClose
  52.    (cItemDict at: #vFileName) setFocus.
  53.    (formDict at: #MakeDirectory) close.
  54. !"end makeDirClose"
  55.  
  56.  
  57. makeDirOpen
  58.    (cItemDict at: #makeDirCurrentDir) put:
  59.          ((FileNameString newDriveName: drive dirName: directory baseName: nil) abbreviate: 26).
  60.    (cItemDict at: #makeDirNewDir) put: String new.
  61.    (formDict at: #MakeDirectory) open.
  62.    (cItemDict at: #makeDirNewDir) setFocus.
  63.    (cItemDict at: #makeDirMakeButt) highlightOn.
  64. !"end makeDirOpen"
  65.  
  66.  
  67. openInitialization
  68.     vOk display: '~Save'.
  69.     super openInitialization.
  70. !"end openInitialization"
  71.  
  72.  
  73. !"End of methods block"
  74.