FileSelectionBox.st
changeset 2354 373ee1f525e3
parent 2231 48ab82d819bc
child 2375 1e3b7281d4ac
equal deleted inserted replaced
2353:0d373c7046f7 2354:373ee1f525e3
   298 
   298 
   299     "Do not manually edit this!! If it is corrupted,
   299     "Do not manually edit this!! If it is corrupted,
   300      the MenuEditor may not be able to read the specification."
   300      the MenuEditor may not be able to read the specification."
   301 
   301 
   302     "
   302     "
   303      MenuEditor new openOnClass:FileSelectionBox andSelector:#menu
   303      MenuEditor new openOnClass:FileSelectionBox andSelector:#fileListMenu
   304      (Menu new fromLiteralArrayEncoding:(FileSelectionBox menu)) startUp
   304      (Menu new fromLiteralArrayEncoding:(FileSelectionBox fileListMenu)) startUp
   305     "
   305     "
   306 
   306 
   307     <resource: #menu>
   307     <resource: #menu>
   308 
   308 
   309     ^ 
   309     ^ 
   311         #(
   311         #(
   312          #(#MenuItem
   312          #(#MenuItem
   313             #label: 'New Folder...'
   313             #label: 'New Folder...'
   314             #translateLabel: true
   314             #translateLabel: true
   315             #value: #fileListMenuNewFolder
   315             #value: #fileListMenuNewFolder
       
   316           )
       
   317          #(#MenuItem
       
   318             #label: '-'
       
   319           )
       
   320          #(#MenuItem
       
   321             #label: 'Remove...'
       
   322             #translateLabel: true
       
   323             #value: #fileListMenuRemove
   316           )
   324           )
   317          )
   325          )
   318         nil
   326         nil
   319         nil
   327         nil
   320       )
   328       )
   565     self updateList.
   573     self updateList.
   566 
   574 
   567     "
   575     "
   568      self open
   576      self open
   569     "
   577     "
       
   578 !
       
   579 
       
   580 fileListMenuRemove
       
   581     |selectedFilename baseName|
       
   582 
       
   583     selectedFilename := self pathName asFilename.
       
   584     baseName := selectedFilename baseName.
       
   585 
       
   586     (Dialog confirm:(resources string:'Really remove ''%1'' ?' with:baseName allBold)) ifFalse:[
       
   587         ^ self.
       
   588     ].
       
   589 
       
   590     selectedFilename isDirectory ifTrue:[
       
   591         self warn:(resources string:'%1 is a directory..' with:baseName).
       
   592         ^ self.
       
   593     ].
       
   594 
       
   595     selectedFilename delete.
       
   596     self updateList.
   570 ! !
   597 ! !
   571 
   598 
   572 !FileSelectionBox methodsFor:'private'!
   599 !FileSelectionBox methodsFor:'private'!
   573 
   600 
   574 updateList
   601 updateList
   714 ! !
   741 ! !
   715 
   742 
   716 !FileSelectionBox class methodsFor:'documentation'!
   743 !FileSelectionBox class methodsFor:'documentation'!
   717 
   744 
   718 version
   745 version
   719     ^ '$Header: /cvs/stx/stx/libwidg/FileSelectionBox.st,v 1.57 2000-08-23 12:57:40 cg Exp $'
   746     ^ '$Header: /cvs/stx/stx/libwidg/FileSelectionBox.st,v 1.58 2001-04-22 11:34:23 cg Exp $'
   720 ! !
   747 ! !