FileDialog.st
changeset 8191 1779a8c3730d
parent 8183 ff8c8d68267e
child 8250 60e3fd1433b3
equal deleted inserted replaced
8190:03bd8b8b214f 8191:1779a8c3730d
     7  inclusion of the above copyright notice.   This software may not
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 "{ Package: 'stx:libtool' }"
       
    13 
       
    14 SimpleDialog subclass:#FileDialog
    12 SimpleDialog subclass:#FileDialog
    15 	instanceVariableNames:'aspects treeBrowser directory pattern filterHolder initialText
    13 	instanceVariableNames:'aspects treeBrowser directory pattern filterHolder initialText
    16 		multipleSelect doubleClickAction cancelLabelHolder okLabelHolder
    14 		multipleSelect doubleClickAction cancelLabelHolder okLabelHolder
    17 		startFilename result filterField filenameField viewFiles
    15 		startFilename result filterField filenameField viewFiles
    18 		filenameLabelHolder isLoadDialog newDirectoryVisibilityHolder
    16 		filenameLabelHolder isLoadDialog newDirectoryVisibilityHolder
    19 		appendButtonVisibleHolder appendWasPressed
    17 		appendButtonVisibleHolder appendWasPressed
    20 		buttonPanelVisibleHolder appendLabelHolder browseVisibleHolder
    18 		buttonPanelVisibleHolder appendLabelHolder browseVisibleHolder
    21 		selectedDeviceDrive listOfDeviceDrives'
    19 		selectedDeviceDrive listOfDeviceDrives rootDirectoryHolder'
    22 	classVariableNames:'LastExtent'
    20 	classVariableNames:'LastExtent'
    23 	poolDictionaries:''
    21 	poolDictionaries:''
    24 	category:'Interface-Tools-File'
    22 	category:'Interface-Tools-File'
    25 !
    23 !
    26 
    24 
   733                     layout: (LayoutFrame 0 0.0 62 0 0 1.0 -30 1)
   731                     layout: (LayoutFrame 0 0.0 62 0 0 1.0 -30 1)
   734                     tabable: true
   732                     tabable: true
   735                     hasHorizontalScrollBar: false
   733                     hasHorizontalScrollBar: false
   736                     hasVerticalScrollBar: false
   734                     hasVerticalScrollBar: false
   737                     majorKey: DirectoryTreeBrowser
   735                     majorKey: DirectoryTreeBrowser
       
   736                     subAspectHolders: 
       
   737                    (Array
       
   738                       
       
   739                      (SubChannelInfoSpec
       
   740                         subAspect: filterModel
       
   741                         aspect: filterHolder
       
   742                       ) 
       
   743                      (SubChannelInfoSpec
       
   744                         subAspect: rootHolder
       
   745                         aspect: rootDirectoryHolder
       
   746                       )
       
   747                     )
   738                     createNewApplication: true
   748                     createNewApplication: true
   739                     createNewBuilder: true
   749                     createNewBuilder: true
   740                     postBuildCallback: postBuildTreeBrowser:
   750                     postBuildCallback: postBuildTreeBrowser:
   741                   )
   751                   )
   742                  (VariableHorizontalPanelSpec
   752                  (VariableHorizontalPanelSpec
   997      (if this app is embedded in a subCanvas)."
  1007      (if this app is embedded in a subCanvas)."
   998 
  1008 
   999     ^ #(
  1009     ^ #(
  1000         #filenameHolder
  1010         #filenameHolder
  1001         #filterHolder
  1011         #filterHolder
       
  1012         #rootDirectoryHolder
  1002       ).
  1013       ).
  1003 
  1014 
  1004 ! !
  1015 ! !
  1005 
  1016 
  1006 !FileDialog methodsFor:'accessing'!
  1017 !FileDialog methodsFor:'accessing'!
  1296 
  1307 
  1297 filterHolder
  1308 filterHolder
  1298     "Return a value holder for filter"
  1309     "Return a value holder for filter"
  1299 
  1310 
  1300     filterHolder isNil ifTrue:[
  1311     filterHolder isNil ifTrue:[
  1301         filterHolder := treeBrowser filterModel.
  1312         filterHolder := (self pattern ? '*') asValue.
  1302         self pattern notNil ifTrue:[
       
  1303             filterHolder value:pattern.
       
  1304         ]
       
  1305     ].
  1313     ].
  1306     ^ filterHolder
  1314     ^ filterHolder
  1307 !
  1315 !
  1308 
  1316 
  1309 filterHolder:aHolder
  1317 filterHolder:aHolder
  1310     "needed when used as subcanvas"
  1318     "needed when used as subcanvas"
  1311 
  1319 
  1312     filterHolder notNil ifTrue:[
       
  1313         filterHolder removeDependent:self
       
  1314     ].
       
  1315     filterHolder := aHolder.
  1320     filterHolder := aHolder.
  1316     aHolder addDependent:self
       
  1317 !
  1321 !
  1318 
  1322 
  1319 gotoBookmarksMenuSpec
  1323 gotoBookmarksMenuSpec
  1320     <resource: #programMenu>
  1324     <resource: #programMenu>
  1321 
  1325 
  1360 
  1364 
  1361     okLabelHolder isNil ifTrue:[
  1365     okLabelHolder isNil ifTrue:[
  1362         okLabelHolder := 'OK' asValue.
  1366         okLabelHolder := 'OK' asValue.
  1363     ].
  1367     ].
  1364     ^ okLabelHolder.
  1368     ^ okLabelHolder.
       
  1369 !
       
  1370 
       
  1371 rootDirectoryHolder
       
  1372     "Return a value holder for filter"
       
  1373 
       
  1374     rootDirectoryHolder isNil ifTrue:[
       
  1375         rootDirectoryHolder := self initialRootDirectory asValue.
       
  1376     ].
       
  1377     ^ rootDirectoryHolder
       
  1378 !
       
  1379 
       
  1380 rootDirectoryHolder:aHolder
       
  1381     "Return a value holder for filter"
       
  1382 
       
  1383     rootDirectoryHolder := aHolder.
  1365 !
  1384 !
  1366 
  1385 
  1367 selectedDeviceDrive
  1386 selectedDeviceDrive
  1368 
  1387 
  1369     selectedDeviceDrive isNil ifTrue:[
  1388     selectedDeviceDrive isNil ifTrue:[
  1570 
  1589 
  1571 postOpenAsSubcanvasWith:aBuilder
  1590 postOpenAsSubcanvasWith:aBuilder
  1572     super postOpenAsSubcanvasWith:aBuilder.
  1591     super postOpenAsSubcanvasWith:aBuilder.
  1573 
  1592 
  1574     "No ok and cancel buttons, when dialog is part of a larger dialog"
  1593     "No ok and cancel buttons, when dialog is part of a larger dialog"
  1575     self hideButtonPanel
  1594     self hideButtonPanel.
  1576 
  1595 
  1577     "filenameHolder contains the initial file name"
  1596     "filenameHolder contains the initial file name"
       
  1597     self startFilename:self filenameHolder value.
  1578     treeBrowser currentFileNameHolder value:(Array with:self filenameHolder value).
  1598     treeBrowser currentFileNameHolder value:(Array with:self filenameHolder value).
  1579 !
  1599 !
  1580 
  1600 
  1581 postOpenWith:aBuilder
  1601 postOpenWith:aBuilder
  1582     |lastExtent|
  1602     |lastExtent|
  1722 ! !
  1742 ! !
  1723 
  1743 
  1724 !FileDialog class methodsFor:'documentation'!
  1744 !FileDialog class methodsFor:'documentation'!
  1725 
  1745 
  1726 version
  1746 version
  1727     ^ '$Header: /cvs/stx/stx/libtool/FileDialog.st,v 1.98 2008-06-05 14:31:41 stefan Exp $'
  1747     ^ '$Header: /cvs/stx/stx/libtool/FileDialog.st,v 1.99 2008-06-09 12:11:55 stefan Exp $'
  1728 ! !
  1748 ! !