DirectoryView.st
changeset 607 8b6cd53f93b8
parent 593 17f3d679fa72
child 614 41cd940faa45
equal deleted inserted replaced
606:bf51357a8917 607:8b6cd53f93b8
    87      
    87      
    88        #(#FullSpec
    88        #(#FullSpec
    89           #'window:' 
    89           #'window:' 
    90            #(#WindowSpec
    90            #(#WindowSpec
    91               #'name:' 'Directory View'
    91               #'name:' 'Directory View'
    92               #'layout:' #(#LayoutFrame 194 0 152 0 593 0 451 0)
    92               #'layout:' #(#LayoutFrame 64 0 703 0 463 0 1002 0)
    93               #'label:' 'Directory View'
    93               #'label:' 'Directory View'
    94               #'min:' #(#Point 10 10)
    94               #'min:' #(#Point 10 10)
    95               #'max:' #(#Point 1152 900)
    95               #'max:' #(#Point 1152 900)
    96               #'bounds:' #(#Rectangle 194 152 594 452)
    96               #'bounds:' #(#Rectangle 64 703 464 1003)
    97               #'usePreferredExtent:' false
    97               #'usePreferredExtent:' false
    98           )
    98           )
    99           #'component:' 
    99           #'component:' 
   100            #(#SpecCollection
   100            #(#SpecCollection
   101               #'collection:' 
   101               #'collection:' 
   102                #(
   102                #(
   103                  #(#DataSetSpec
   103                  #(#DataSetSpec
   104                     #'name:' 'filesDataSetView'
   104                     #'name:' 'filesDataSetView'
   105                     #'layout:' #(#LayoutFrame 0 0.0 22 0.0 0 1.0 0 1.0)
   105                     #'layout:' #(#LayoutFrame 0 0.0 24 0.0 -2 1.0 0 1.0)
   106                     #'model:' #selectionOfFile
   106                     #'model:' #selectionOfFile
   107                     #'hasHorizontalScrollBar:' true
   107                     #'hasHorizontalScrollBar:' true
   108                     #'hasVerticalScrollBar:' true
   108                     #'hasVerticalScrollBar:' true
   109                     #'miniScrollerHorizontal:' true
   109                     #'miniScrollerHorizontal:' true
   110                     #'dataList:' #listOfFiles
   110                     #'dataList:' #listOfFiles
   123                     #'comboList:' #listOfFileFilters
   123                     #'comboList:' #listOfFileFilters
   124                 )
   124                 )
   125               )
   125               )
   126           )
   126           )
   127       )
   127       )
       
   128 
       
   129     "Modified: / 6.2.1998 / 03:42:15 / cg"
   128 !
   130 !
   129 
   131 
   130 windowSpecOfFileAttributeColumns
   132 windowSpecOfFileAttributeColumns
   131 
   133 
   132     ^
   134     ^
   139           #'canSelect:' false
   141           #'canSelect:' false
   140       )
   142       )
   141        #(#DataSetColumnSpec
   143        #(#DataSetColumnSpec
   142           #'label:' 'File name'
   144           #'label:' 'File name'
   143           #'labelAlignment:' #left
   145           #'labelAlignment:' #left
   144           #'minWidth:' 100
   146           #'minWidth:' 150
   145           #'model:' #baseName
   147           #'model:' #baseName
   146           #'canSelect:' false
   148           #'canSelect:' false
   147       )
   149       )
   148        #(#DataSetColumnSpec
   150        #(#DataSetColumnSpec
   149           #'label:' 'Size'
   151           #'label:' 'Size'
   150           #'labelAlignment:' #left
   152           #'labelAlignment:' #left
   151           #'width:' 50
   153           #'width:' 70
   152           #'model:' #size
   154           #'model:' #size
   153           #'canSelect:' false
   155           #'canSelect:' false
   154       )
   156       )
   155        #(#DataSetColumnSpec
   157        #(#DataSetColumnSpec
   156           #'label:' 'Modified'
   158           #'label:' 'Modified'
   179           #'model:' #group
   181           #'model:' #group
   180           #'canSelect:' false
   182           #'canSelect:' false
   181       )
   183       )
   182     )
   184     )
   183 
   185 
       
   186     "Modified: / 6.2.1998 / 03:40:16 / cg"
   184 ! !
   187 ! !
   185 
   188 
   186 !DirectoryView methodsFor:'accessing'!
   189 !DirectoryView methodsFor:'accessing'!
   187 
   190 
   188 directory: aDirectory
   191 directory: aDirectory
   712 
   715 
   713     ^permissions
   716     ^permissions
   714 !
   717 !
   715 
   718 
   716 size
   719 size
   717 
   720     size isNumber ifFalse:[^ size].
   718     size < 1024    ifTrue: [^size printString, ' B'].
   721     size < 1000        ifTrue: [^ size printString].
   719     size < 1048576 ifTrue: [^(((size/1024) * 10) asInteger/10) asFloat printString, ' KB'].
   722     size < (100*1024)  ifTrue: [^(((size/1024) * 10) asInteger/10) asFloat printString, ' Kb'].
   720     ^(((size/1048576) * 10) asInteger/10) asFloat printString, ' MB'
   723     size < (1000*1024) ifTrue: [^(((size/1024)) asInteger) printString, ' Kb'].
   721 
   724     ^(((size/1048576) * 10) asInteger/10) asFloat printString, ' Mb'
   722 
   725 
   723 
   726     "Modified: / 6.2.1998 / 03:38:45 / cg"
   724 
       
   725 ! !
   727 ! !
   726 
   728 
   727 !DirectoryView::FileRow methodsFor:'private'!
   729 !DirectoryView::FileRow methodsFor:'private'!
   728 
   730 
   729 validateAttributes
   731 validateAttributes