FileDialog.st
author Claus Gittinger <cg@exept.de>
Thu, 10 Feb 2011 16:58:13 +0100
changeset 9756 5a1787bbf85e
parent 9683 83fb945b7a5a
child 9765 4ef52da2b6d4
permissions -rw-r--r--
added: #classMenuGenerateSingletonPatternInstanceCreationMethods
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
     1
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
     2
 COPYRIGHT (c) 2002 by eXept Software AG
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
     3
              All Rights Reserved
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
     4
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
     5
 This software is furnished under a license and may be used
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
     6
 only in accordance with the terms of that license and with the
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
     8
 be provided or otherwise made available to, or used by, any
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
     9
 other person.  No title to or ownership of the software is
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    10
 hereby transferred.
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    11
"
8250
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
    12
"{ Package: 'stx:libtool' }"
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
    13
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    14
SimpleDialog subclass:#FileDialog
5220
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
    15
	instanceVariableNames:'aspects treeBrowser directory pattern filterHolder initialText
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
    16
		multipleSelect doubleClickAction cancelLabelHolder okLabelHolder
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
    17
		startFilename result filterField filenameField viewFiles
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
    18
		filenameLabelHolder isLoadDialog newDirectoryVisibilityHolder
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
    19
		appendButtonVisibleHolder appendWasPressed
6065
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
    20
		buttonPanelVisibleHolder appendLabelHolder browseVisibleHolder
9678
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
    21
		selectedDeviceDrive listOfDeviceDrives rootDirectoryHolder
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
    22
		initialRoot'
5931
penk
parents: 5930
diff changeset
    23
	classVariableNames:'LastExtent'
5220
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
    24
	poolDictionaries:''
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
    25
	category:'Interface-Tools-File'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    26
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    27
321c1729db5b initial checkin
penk
parents:
diff changeset
    28
!FileDialog class methodsFor:'documentation'!
321c1729db5b initial checkin
penk
parents:
diff changeset
    29
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    30
copyright
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    31
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    32
 COPYRIGHT (c) 2002 by eXept Software AG
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    33
              All Rights Reserved
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    34
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    35
 This software is furnished under a license and may be used
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    36
 only in accordance with the terms of that license and with the
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    37
 inclusion of the above copyright notice.   This software may not
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    38
 be provided or otherwise made available to, or used by, any
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    39
 other person.  No title to or ownership of the software is
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    40
 hereby transferred.
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    41
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    42
!
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    43
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    44
documentation
321c1729db5b initial checkin
penk
parents:
diff changeset
    45
"
321c1729db5b initial checkin
penk
parents:
diff changeset
    46
    documentation to be added.
321c1729db5b initial checkin
penk
parents:
diff changeset
    47
321c1729db5b initial checkin
penk
parents:
diff changeset
    48
    [author:]
321c1729db5b initial checkin
penk
parents:
diff changeset
    49
        Martin Walser (martin@vercingetorix)
321c1729db5b initial checkin
penk
parents:
diff changeset
    50
321c1729db5b initial checkin
penk
parents:
diff changeset
    51
    [instance variables:]
321c1729db5b initial checkin
penk
parents:
diff changeset
    52
321c1729db5b initial checkin
penk
parents:
diff changeset
    53
    [class variables:]
321c1729db5b initial checkin
penk
parents:
diff changeset
    54
321c1729db5b initial checkin
penk
parents:
diff changeset
    55
    [see also:]
321c1729db5b initial checkin
penk
parents:
diff changeset
    56
321c1729db5b initial checkin
penk
parents:
diff changeset
    57
"
321c1729db5b initial checkin
penk
parents:
diff changeset
    58
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    59
321c1729db5b initial checkin
penk
parents:
diff changeset
    60
examples
321c1729db5b initial checkin
penk
parents:
diff changeset
    61
"
321c1729db5b initial checkin
penk
parents:
diff changeset
    62
                                                                [exBegin]
321c1729db5b initial checkin
penk
parents:
diff changeset
    63
    FileDialog open
321c1729db5b initial checkin
penk
parents:
diff changeset
    64
                                                                [exEnd]
321c1729db5b initial checkin
penk
parents:
diff changeset
    65
321c1729db5b initial checkin
penk
parents:
diff changeset
    66
                                                                [exBegin]
5188
283a77f6efe2 care for non-existing initial dir.
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
    67
    FileDialog 
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    68
        requestFileName:'enter a fileName:'
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    69
        default:''
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    70
        version:nil
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    71
        ifFail:['none']
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    72
        pattern:'*.conf'
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    73
        fromDirectory:'/etc'
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    74
        whenBoxCreatedEvaluate:nil.
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    75
                                                                [exEnd]
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    76
                                                                [exBegin]
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    77
    |fd|
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    78
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    79
    fd := FileDialog new.
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    80
    fd multipleSelect:true.
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    81
    fd open
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    82
                                                                [exEnd]
321c1729db5b initial checkin
penk
parents:
diff changeset
    83
"
5062
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    84
!
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    85
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    86
todo
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    87
"
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    88
    - make the filedialog windows like f
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    89
      filename entry field shows only the filename not the whole directory 
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    90
      the tree allways starts in currrent directory
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    91
      the parent tree is shown in a compobox where the perents are selectable
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    92
    - do not expand the ~ or relative pathnames to absolute pathnames        
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    93
"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    94
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
    95
321c1729db5b initial checkin
penk
parents:
diff changeset
    96
!FileDialog class methodsFor:'instance creation'!
321c1729db5b initial checkin
penk
parents:
diff changeset
    97
321c1729db5b initial checkin
penk
parents:
diff changeset
    98
requestDirectoryName:title default:aFileName ifFail:failBlock
321c1729db5b initial checkin
penk
parents:
diff changeset
    99
    "same as requestFileName, but only show directories"
321c1729db5b initial checkin
penk
parents:
diff changeset
   100
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   101
    ^ self  
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   102
        requestDirectoryName:title 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   103
        default:aFileName 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   104
        ok:nil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   105
        abort:nil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   106
        version:nil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   107
        pattern:nil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   108
        fromDirectory:nil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   109
        ifFail:failBlock 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   110
        whenBoxCreatedEvaluate:nil
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   111
        asLoadDialog:nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   112
321c1729db5b initial checkin
penk
parents:
diff changeset
   113
    "
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   114
     FileDialog
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   115
        requestDirectoryName:'which directory ?' 
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   116
        default:Filename currentDirectory pathName
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   117
        ifFail:'none'
321c1729db5b initial checkin
penk
parents:
diff changeset
   118
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   119
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   120
5336
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   121
requestDirectoryName:title default:aFileName ok:okText abort:abortText ifFail:failBlock
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   122
    "same as requestFileName, but only show directories"
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   123
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   124
    ^ self  
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   125
        requestDirectoryName:title 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   126
        default:aFileName 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   127
        ok:okText 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   128
        abort:abortText 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   129
        version:nil 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   130
        pattern:nil 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   131
        fromDirectory:nil 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   132
        ifFail:failBlock 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   133
        whenBoxCreatedEvaluate:nil
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   134
        asLoadDialog:nil.
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   135
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   136
    "
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   137
     FileDialog
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   138
        requestDirectoryName:'which directory ?' 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   139
        default:Filename currentDirectory pathName
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   140
        ok:'Yes'
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   141
        abort:'No'
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   142
        ifFail:'none'
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   143
    "
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   144
!
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   145
5823
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   146
requestDirectoryName:title default:aFileName ok:okText abort:abortText ifFail:failBlock acceptReturnAsOK:aBoolean
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   147
    "same as requestFileName, but only show directories"
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   148
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   149
    ^ self  
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   150
        requestDirectoryName:title 
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   151
        default:aFileName 
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   152
        ok:okText 
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   153
        abort:abortText 
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   154
        version:nil 
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   155
        pattern:nil 
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   156
        fromDirectory:nil 
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   157
        ifFail:failBlock 
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   158
        whenBoxCreatedEvaluate:[:box|box doubleClickAction:[:index|box doAccept]]
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   159
        asLoadDialog:nil.
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   160
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   161
    "
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   162
     FileDialog
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   163
        requestDirectoryName:'which directory ?' 
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   164
        default:Filename currentDirectory pathName
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   165
        ok:'Yes'
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   166
        abort:'No'
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   167
        ifFail:'none'
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   168
    "
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   169
!
79a3ac980853 *** empty log message ***
martin
parents: 5790
diff changeset
   170
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   171
requestDirectoryName:titleString default:aFileName ok:okText abort:abortText version:versionSymbol pattern:pattern fromDirectory:aDirectoryPath ifFail:failBlock whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   172
    "same as requestFileName, but only show directories"
321c1729db5b initial checkin
penk
parents:
diff changeset
   173
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   174
    |enteredFileName instance enteredFileNameString|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   175
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   176
    instance := self    
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   177
        startApplicationFor:titleString 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   178
        default:aFileName 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   179
        ok:okText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   180
        abort:abortText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   181
        ifFail:failBlock 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   182
        pattern:pattern 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   183
        fromDirectory:aDirectoryPath 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   184
        whenBoxCreatedEvaluate:boxCreatedCallback
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   185
        asLoadDialog:aBoolean
5329
022b6631df6f checkin from browser
Michael Beyl <mb@exept.de>
parents: 5230
diff changeset
   186
        viewFiles:false
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   187
        multipleSelect:false.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   188
321c1729db5b initial checkin
penk
parents:
diff changeset
   189
    enteredFileNameString := instance result.
321c1729db5b initial checkin
penk
parents:
diff changeset
   190
    enteredFileNameString isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   191
        ^ failBlock value
321c1729db5b initial checkin
penk
parents:
diff changeset
   192
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   193
    enteredFileName := enteredFileNameString asFilename.
321c1729db5b initial checkin
penk
parents:
diff changeset
   194
    enteredFileNameString := enteredFileName asString.
321c1729db5b initial checkin
penk
parents:
diff changeset
   195
    (enteredFileName notNil 
321c1729db5b initial checkin
penk
parents:
diff changeset
   196
    and:[enteredFileNameString notEmpty]) ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   197
        versionSymbol isNil ifTrue:[ ^ enteredFileNameString].
321c1729db5b initial checkin
penk
parents:
diff changeset
   198
        versionSymbol == #mustBeNew ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   199
            "/ file may not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   200
            enteredFileName exists ifTrue:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   201
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   202
        versionSymbol == #new ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   203
            "/ file may not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   204
            enteredFileName exists ifTrue:[
6356
cff12ff7dc25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   205
                (Dialog confirm:(self classResources stringWithCRs:'''%1'' exists.\\Continue anyway ?' with:enteredFileNameString))
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   206
                    ifFalse:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   207
            ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   208
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   209
        versionSymbol == #mustBeOld ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   210
            enteredFileName exists ifFalse:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   211
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   212
        versionSymbol == #old ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   213
            "/ file may not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   214
            enteredFileName exists ifFalse:[
6356
cff12ff7dc25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   215
                (self confirm:(self classResources stringWithCRs:'''%1'' does not exist yet.\\Continue anyway ?' with:enteredFileNameString))
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   216
                ifFalse:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   217
            ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   218
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   219
        FileSelectionBox lastFileSelectionDirectory:(enteredFileNameString).
321c1729db5b initial checkin
penk
parents:
diff changeset
   220
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   221
    ^ enteredFileNameString
321c1729db5b initial checkin
penk
parents:
diff changeset
   222
321c1729db5b initial checkin
penk
parents:
diff changeset
   223
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   224
     FileDialog
321c1729db5b initial checkin
penk
parents:
diff changeset
   225
        requestDirectoryName:'which directory ?' 
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   226
        default:Filename currentDirectory pathName
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   227
        ifFail:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   228
    "
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   229
    "
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   230
     FileDialog
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   231
        requestDirectoryName:'which directory ?' 
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   232
        default:Filename currentDirectory pathName 
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   233
        ok:nil
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   234
        abort:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   235
        version:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   236
        pattern:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   237
        fromDirectory:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   238
        ifFail:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   239
        whenBoxCreatedEvaluate:nil
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   240
        asLoadDialog:true
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   241
    "
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   242
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   243
5336
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   244
requestDirectoryName:title default:aFileName ok:okText ifFail:failBlock
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   245
    "same as requestFileName, but only show directories"
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   246
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   247
    ^ self  
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   248
        requestDirectoryName:title 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   249
        default:aFileName 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   250
        ok:okText 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   251
        abort:nil 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   252
        version:nil 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   253
        pattern:nil 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   254
        fromDirectory:nil 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   255
        ifFail:failBlock 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   256
        whenBoxCreatedEvaluate:nil
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   257
        asLoadDialog:nil.
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   258
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   259
    "
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   260
     FileDialog
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   261
        requestDirectoryName:'which directory ?' 
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   262
        default:Filename currentDirectory pathName
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   263
        ok:'Yes'
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   264
        ifFail:'none'
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   265
    "
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   266
!
6a28518b52a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5329
diff changeset
   267
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   268
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil whenBoxCreatedEvaluate:boxCreatedCallback
321c1729db5b initial checkin
penk
parents:
diff changeset
   269
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   270
    ^ self  
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   271
        requestFileName:titleString 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   272
        default:defaultName 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   273
        ok:okText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   274
        abort:abortText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   275
        version:nil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   276
        ifFail:nil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   277
        pattern:pattern 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   278
        fromDirectory:aDirectoryPathOrNil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   279
        whenBoxCreatedEvaluate:boxCreatedCallback
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   280
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   281
321c1729db5b initial checkin
penk
parents:
diff changeset
   282
requestFileName:titleString default:defaultName ok:okText abort:abortText version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback
321c1729db5b initial checkin
penk
parents:
diff changeset
   283
    "launch a Dialog, which allows user to enter a filename.
321c1729db5b initial checkin
penk
parents:
diff changeset
   284
     The files presented initially are those in aDirectoryPathOrNil, or the
321c1729db5b initial checkin
penk
parents:
diff changeset
   285
     last fileBox directory (default: current directory) (if a nil path is given).
321c1729db5b initial checkin
penk
parents:
diff changeset
   286
     The box will show okText in its okButton, abortText in the abortButton.
321c1729db5b initial checkin
penk
parents:
diff changeset
   287
     The matchPattern is set to pattern initially.
321c1729db5b initial checkin
penk
parents:
diff changeset
   288
     Return the string, or nil if cancel was pressed
321c1729db5b initial checkin
penk
parents:
diff changeset
   289
     The version argument allows validation of the files existance;
321c1729db5b initial checkin
penk
parents:
diff changeset
   290
     it may be any of:
321c1729db5b initial checkin
penk
parents:
diff changeset
   291
        #mustBeNew      - fail (return empty string) if the file exists
321c1729db5b initial checkin
penk
parents:
diff changeset
   292
        #new            - confirm if the file exists
321c1729db5b initial checkin
penk
parents:
diff changeset
   293
        #mustBeOld      - fail if the file does not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   294
        #old            - confirm if the file does not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   295
        #any (other)    - no validation
321c1729db5b initial checkin
penk
parents:
diff changeset
   296
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   297
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   298
    ^ self  
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   299
        requestFileName:titleString 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   300
        default:defaultName 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   301
        ok:okText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   302
        abort:abortText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   303
        version:versionSymbol 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   304
        ifFail:failBlock 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   305
        pattern:pattern 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   306
        fromDirectory:aDirectoryPath 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   307
        whenBoxCreatedEvaluate:boxCreatedCallback 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   308
        asLoadDialog:nil
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   309
!
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   310
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   311
requestFileName:titleString default:defaultName ok:okText abort:abortText version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   312
    "launch a Dialog, which allows user to enter a filename.
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   313
     The files presented initially are those in aDirectoryPathOrNil, or the
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   314
     last fileBox directory (default: current directory) (if a nil path is given).
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   315
     The box will show okText in its okButton, abortText in the abortButton.
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   316
     The matchPattern is set to pattern initially.
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   317
     Return the string, or nil if cancel was pressed
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   318
     The version argument allows validation of the files existance;
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   319
     it may be any of:
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   320
        #mustBeNew      - fail (return empty string) if the file exists
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   321
        #new            - confirm if the file exists
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   322
        #mustBeOld      - fail if the file does not exist
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   323
        #old            - confirm if the file does not exist
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   324
        #any (other)    - no validation
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   325
    "
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   326
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   327
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   328
    | instance enteredFileName enteredFileNameString|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   329
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   330
    instance := self    
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   331
        startApplicationFor:titleString 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   332
        default:defaultName 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   333
        ok:okText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   334
        abort:abortText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   335
        ifFail:failBlock 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   336
        pattern:pattern 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   337
        fromDirectory:aDirectoryPath 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   338
        whenBoxCreatedEvaluate:boxCreatedCallback
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   339
        asLoadDialog:aBoolean
5329
022b6631df6f checkin from browser
Michael Beyl <mb@exept.de>
parents: 5230
diff changeset
   340
        viewFiles:true
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   341
        multipleSelect:false.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   342
321c1729db5b initial checkin
penk
parents:
diff changeset
   343
    enteredFileNameString := instance result.
6482
00207f456339 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 6462
diff changeset
   344
    (enteredFileNameString isEmptyOrNil) ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   345
        ^ failBlock value
321c1729db5b initial checkin
penk
parents:
diff changeset
   346
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   347
    enteredFileName := enteredFileNameString asFilename.
5867
ef786691f063 *** empty log message ***
penk
parents: 5863
diff changeset
   348
    enteredFileNameString := enteredFileName asString.
5858
d5648b365b8d returns construct with defaultName if directory selected on requestFilename
penk
parents: 5853
diff changeset
   349
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   350
    (enteredFileName notNil 
321c1729db5b initial checkin
penk
parents:
diff changeset
   351
    and:[enteredFileNameString notEmpty]) ifTrue:[
4666
2775d69bc8be accept return in fileName field
martin
parents: 4627
diff changeset
   352
        FileSelectionBox lastFileSelectionDirectory:(enteredFileName directoryName).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   353
        versionSymbol isNil ifTrue:[ ^ enteredFileNameString].
321c1729db5b initial checkin
penk
parents:
diff changeset
   354
        versionSymbol == #mustBeNew ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   355
            "/ file may not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   356
            enteredFileName exists ifTrue:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   357
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   358
        versionSymbol == #new ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   359
            "/ file may not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   360
            enteredFileName exists ifTrue:[
6356
cff12ff7dc25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   361
                (Dialog confirm:(self classResources stringWithCRs:'''%1'' exists.\\Continue anyway ?' with:enteredFileNameString))
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   362
                    ifFalse:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   363
            ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   364
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   365
        versionSymbol == #mustBeOld ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   366
            enteredFileName exists ifFalse:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   367
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   368
        versionSymbol == #old ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   369
            "/ file may not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   370
            enteredFileName exists ifFalse:[
6356
cff12ff7dc25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   371
                (self confirm:(self classResources stringWithCRs:'''%1'' does not exist yet.\\Continue anyway ?' with:enteredFileNameString))
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   372
                ifFalse:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   373
            ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   374
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   375
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   376
    ^ enteredFileNameString
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   377
"
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   378
     FileDialog 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   379
        requestFileName:'enter a fileName:'
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   380
        default:''
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   381
        ok:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   382
        abort:nil
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   383
        version:nil
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   384
        ifFail:['none']
5858
d5648b365b8d returns construct with defaultName if directory selected on requestFilename
penk
parents: 5853
diff changeset
   385
        pattern:'*'
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   386
        fromDirectory:Filename currentDirectory pathName
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   387
        whenBoxCreatedEvaluate:nil
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   388
        asLoadDialog:true
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   389
"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   390
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   391
321c1729db5b initial checkin
penk
parents:
diff changeset
   392
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPathOrNil whenBoxCreatedEvaluate:boxCreatedCallback
321c1729db5b initial checkin
penk
parents:
diff changeset
   393
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   394
    ^ self  
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   395
        requestFileName:titleString 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   396
        default:defaultName 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   397
        ok:nil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   398
        abort:nil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   399
        version:versionSymbol 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   400
        ifFail:failBlock 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   401
        pattern:pattern 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   402
        fromDirectory:aDirectoryPathOrNil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   403
        whenBoxCreatedEvaluate:boxCreatedCallback
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   404
321c1729db5b initial checkin
penk
parents:
diff changeset
   405
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   406
     FileDialog 
321c1729db5b initial checkin
penk
parents:
diff changeset
   407
        requestFileName:'enter a fileName:'
321c1729db5b initial checkin
penk
parents:
diff changeset
   408
        default:''
321c1729db5b initial checkin
penk
parents:
diff changeset
   409
        version:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   410
        ifFail:['none']
321c1729db5b initial checkin
penk
parents:
diff changeset
   411
        pattern:'*.conf'
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   412
        fromDirectory:Filename currentDirectory pathName
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   413
        whenBoxCreatedEvaluate:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
   414
     Dialog 
321c1729db5b initial checkin
penk
parents:
diff changeset
   415
        requestFileName:'enter a fileName:'
321c1729db5b initial checkin
penk
parents:
diff changeset
   416
        default:''
321c1729db5b initial checkin
penk
parents:
diff changeset
   417
        version:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   418
        ifFail:['none']
321c1729db5b initial checkin
penk
parents:
diff changeset
   419
        pattern:'*.conf'
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   420
        fromDirectory:Filename currentDirectory pathName
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   421
        whenBoxCreatedEvaluate:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   422
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   423
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   424
     FileDialog
321c1729db5b initial checkin
penk
parents:
diff changeset
   425
        requestFileName:'enter a fileName:'
321c1729db5b initial checkin
penk
parents:
diff changeset
   426
        default:''
321c1729db5b initial checkin
penk
parents:
diff changeset
   427
        version:#old 
321c1729db5b initial checkin
penk
parents:
diff changeset
   428
        ifFail:['none']   
321c1729db5b initial checkin
penk
parents:
diff changeset
   429
        pattern:'*.conf'
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   430
        fromDirectory:Filename currentDirectory pathName
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   431
        whenBoxCreatedEvaluate:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   432
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   433
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   434
     FileDialog
321c1729db5b initial checkin
penk
parents:
diff changeset
   435
        requestFileName:'enter a fileName:'
321c1729db5b initial checkin
penk
parents:
diff changeset
   436
        default:''
321c1729db5b initial checkin
penk
parents:
diff changeset
   437
        version:#mustBeNew 
321c1729db5b initial checkin
penk
parents:
diff changeset
   438
        ifFail:['none']   
321c1729db5b initial checkin
penk
parents:
diff changeset
   439
        pattern:'*.conf'
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   440
        fromDirectory:Filename currentDirectory pathName
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   441
        whenBoxCreatedEvaluate:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   442
    "
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   443
!
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   444
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   445
requestFileNames:titleString default:defaultName ok:okText abort:abortText ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   446
    "launch a Dialog, which allows user to enter a filename.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   447
     The files presented initially are those in aDirectoryPathOrNil, or the
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   448
     last fileBox directory (default: current directory) (if a nil path is given).
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   449
     The box will show okText in its okButton, abortText in the abortButton.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   450
     The matchPattern is set to pattern initially.
3905
2a1afd0fdcd3 add requestFilenames method
penk
parents: 3904
diff changeset
   451
     Return all selected Filenames as filenames in a collection, or nil if cancel was pressed
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   452
    "
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   453
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   454
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   455
    ^ self  
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   456
        requestFileNames:titleString 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   457
        default:defaultName 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   458
        ok:okText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   459
        abort:abortText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   460
        ifFail:failBlock 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   461
        pattern:pattern 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   462
        fromDirectory:aDirectoryPath 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   463
        whenBoxCreatedEvaluate:boxCreatedCallback 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   464
        asLoadDialog:nil.
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   465
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   466
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   467
"
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   468
     FileDialog 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   469
        requestFileNames:'enter a fileName:'
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   470
        default:''
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   471
        ok:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   472
        abort:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   473
        ifFail:['none']
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   474
        pattern:'*.conf'
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   475
        fromDirectory:Filename currentDirectory pathName
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   476
        whenBoxCreatedEvaluate:nil.
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   477
"
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   478
!
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   479
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   480
requestFileNames:titleString default:defaultName ok:okText abort:abortText ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:asLoadDialog
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   481
    "launch a Dialog, which allows user to enter a filename.
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   482
     The files presented initially are those in aDirectoryPathOrNil, or the
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   483
     last fileBox directory (default: current directory) (if a nil path is given).
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   484
     The box will show okText in its okButton, abortText in the abortButton.
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   485
     The matchPattern is set to pattern initially.
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   486
     Return all selected Filenames as filenames in a collection, or nil if cancel was pressed
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   487
    "
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   488
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   489
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   490
    | instance enteredFileNames lastDirectory|
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   491
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   492
    instance := self    
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   493
        startApplicationFor:titleString 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   494
        default:defaultName 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   495
        ok:okText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   496
        abort:abortText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   497
        ifFail:failBlock 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   498
        pattern:pattern 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   499
        fromDirectory:aDirectoryPath 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   500
        whenBoxCreatedEvaluate:boxCreatedCallback
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   501
        asLoadDialog:asLoadDialog 
5329
022b6631df6f checkin from browser
Michael Beyl <mb@exept.de>
parents: 5230
diff changeset
   502
        viewFiles:true
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   503
        multipleSelect:true.
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   504
3996
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
   505
    enteredFileNames := instance currentSelectedFiles.
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   506
    (enteredFileNames isEmpty or:[instance result isNil]) ifTrue:[
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   507
        ^ failBlock value
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   508
    ].
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   509
    lastDirectory := enteredFileNames first.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   510
    lastDirectory := lastDirectory isFilename ifTrue:[lastDirectory directory] ifFalse:[lastDirectory].
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   511
    FileSelectionBox lastFileSelectionDirectory:(lastDirectory directoryName).
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   512
    ^ enteredFileNames
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   513
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   514
"
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   515
     FileDialog 
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   516
        requestFileNames:'enter a fileName:'
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   517
        default:''
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   518
        ok:nil 
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   519
        abort:nil 
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   520
        ifFail:['none']
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   521
        pattern:'*.conf'
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   522
        fromDirectory:Filename currentDirectory pathName
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   523
        whenBoxCreatedEvaluate:nil
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   524
        asLoadDialog:true.
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   525
"
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   526
!
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   527
5790
a20cb6fcb74b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5617
diff changeset
   528
startApplicationFor:titleString default:initialDefaultFileNameArg ok:okTextArg abort:abortTextArg ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:asLoadDialog viewFiles:viewFiles multipleSelect:multipleSelect
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   529
    "launch a Dialog, which allows user to enter a filename.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   530
     The files presented initially are those in aDirectoryPathOrNil, or the
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   531
     last fileBox directory (default: current directory) (if a nil path is given).
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   532
     The box will show okText in its okButton, abortText in the abortButton.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   533
     The matchPattern is set to pattern initially.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   534
     Return the string, or nil if cancel was pressed
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   535
     The version argument allows validation of the files existance;
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   536
     it may be any of:
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   537
        #mustBeNew      - fail (return empty string) if the file exists
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   538
        #new            - confirm if the file exists
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   539
        #mustBeOld      - fail if the file does not exist
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   540
        #old            - confirm if the file does not exist
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   541
        #any (other)    - no validation
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   542
    "
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   543
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   544
5790
a20cb6fcb74b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5617
diff changeset
   545
    |defaultDir instance defaultFile okText abortText initialDefaultFileName|
a20cb6fcb74b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5617
diff changeset
   546
a20cb6fcb74b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5617
diff changeset
   547
    initialDefaultFileName := initialDefaultFileNameArg.
a20cb6fcb74b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5617
diff changeset
   548
    initialDefaultFileName notNil ifTrue:[ 
a20cb6fcb74b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5617
diff changeset
   549
        initialDefaultFileName := initialDefaultFileName asFilename 
a20cb6fcb74b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5617
diff changeset
   550
    ].
5163
7923e3b781bd oops - nil button labels
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   551
7923e3b781bd oops - nil button labels
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   552
    okText := okTextArg.
7923e3b781bd oops - nil button labels
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   553
    okText isNil ifTrue:[ okText := self resources string:'OK' ]. 
7923e3b781bd oops - nil button labels
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   554
    abortText := abortTextArg.
7923e3b781bd oops - nil button labels
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   555
    abortText isNil ifTrue:[ abortText := self resources string:'Cancel' ]. 
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   556
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   557
    defaultDir := aDirectoryPath.
5220
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   558
"/    defaultDir isNil ifTrue:[
5790
a20cb6fcb74b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5617
diff changeset
   559
"/        (initialDefaultFileName size > 0 and:[initialDefaultFileName exists]) ifTrue:[
a20cb6fcb74b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5617
diff changeset
   560
"/            defaultDir := initialDefaultFileName asAbsoluteFilename directory.
5220
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   561
"/        ] ifFalse:[
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   562
"/            defaultDir := FileSelectionBox lastFileSelectionDirectory.
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   563
"/            defaultDir isNil ifTrue:[
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   564
"/                defaultDir := Filename currentDirectory asAbsoluteFilename.        
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   565
"/            ].
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   566
"/            defaultDir asFilename exists ifFalse:[
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   567
"/                defaultDir := nil
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   568
"/            ].
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   569
"/        ]
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   570
"/    ].
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   571
    (initialDefaultFileName notNil 
5790
a20cb6fcb74b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5617
diff changeset
   572
    and:[initialDefaultFileName isAbsolute 
5220
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   573
    and:[true "initialDefaultFileName asFilename exists"]]) ifTrue:[
5790
a20cb6fcb74b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5617
diff changeset
   574
        defaultDir := initialDefaultFileName asAbsoluteFilename.
6953
651025031ea2 initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents: 6728
diff changeset
   575
        true "viewFiles" ifTrue:[
651025031ea2 initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents: 6728
diff changeset
   576
            defaultFile := defaultDir asAbsoluteFilename.
5220
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   577
            defaultDir := defaultDir directory.
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   578
        ].
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   579
    ] ifFalse:[
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   580
        defaultDir isNil ifTrue:[
5193
cc132f6bb560 appendLabelHolder was removed
penk
parents: 5189
diff changeset
   581
            defaultDir := FileSelectionBox lastFileSelectionDirectory.
cc132f6bb560 appendLabelHolder was removed
penk
parents: 5189
diff changeset
   582
            defaultDir isNil ifTrue:[
cc132f6bb560 appendLabelHolder was removed
penk
parents: 5189
diff changeset
   583
                defaultDir := Filename currentDirectory asAbsoluteFilename.        
cc132f6bb560 appendLabelHolder was removed
penk
parents: 5189
diff changeset
   584
            ].
5188
283a77f6efe2 care for non-existing initial dir.
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
   585
            defaultDir asFilename exists ifFalse:[
283a77f6efe2 care for non-existing initial dir.
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
   586
                defaultDir := nil
283a77f6efe2 care for non-existing initial dir.
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
   587
            ].
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   588
        ]
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   589
    ].
4206
ebbc6f79a43d defaultDir asAbsoluteFilename
penk
parents: 4175
diff changeset
   590
    defaultDir := defaultDir asFilename asAbsoluteFilename.
5220
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   591
"/    [defaultDir exists] whileFalse:[
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   592
"/        defaultDir := defaultDir directory.
1de409e5ea52 initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents: 5193
diff changeset
   593
"/    ].
5066
57de46852214 Do not select '/tmp/tmp' if '/tmp' is given as default directory
Stefan Vogel <sv@exept.de>
parents: 5062
diff changeset
   594
6953
651025031ea2 initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents: 6728
diff changeset
   595
    defaultFile isNil ifTrue:[
651025031ea2 initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents: 6728
diff changeset
   596
        viewFiles ifFalse:[
651025031ea2 initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents: 6728
diff changeset
   597
            defaultFile := defaultDir asAbsoluteFilename.
651025031ea2 initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents: 6728
diff changeset
   598
        ] ifTrue:[
651025031ea2 initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents: 6728
diff changeset
   599
            (initialDefaultFileName notNil and:[initialDefaultFileName withoutSuffix baseName ~= '*']) ifTrue:[
651025031ea2 initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents: 6728
diff changeset
   600
                defaultFile := defaultDir construct:initialDefaultFileName baseName.
651025031ea2 initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents: 6728
diff changeset
   601
            ] ifFalse:[
651025031ea2 initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents: 6728
diff changeset
   602
                defaultFile := defaultDir.
651025031ea2 initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents: 6728
diff changeset
   603
            ].
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   604
        ].
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   605
    ].
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   606
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   607
    instance := self new.
5066
57de46852214 Do not select '/tmp/tmp' if '/tmp' is given as default directory
Stefan Vogel <sv@exept.de>
parents: 5062
diff changeset
   608
    defaultDir notNil ifTrue:[instance directory:defaultDir].
3958
39364b0202cf fileDialog multiple select changes
penk
parents: 3956
diff changeset
   609
    instance multipleSelect:multipleSelect ? false.
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   610
    instance startFilename:defaultFile.
6482
00207f456339 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 6462
diff changeset
   611
    instance pattern:((pattern isEmptyOrNil) ifTrue:['*'] ifFalse:[pattern]).
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   612
    instance initialText:titleString.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   613
    instance okLabelHolder value:okText.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   614
    instance cancelLabelHolder value:abortText.
5571
333ee892a087 thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents: 5375
diff changeset
   615
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   616
    instance beLoadDialog:asLoadDialog ? false.
5329
022b6631df6f checkin from browser
Michael Beyl <mb@exept.de>
parents: 5230
diff changeset
   617
    instance viewFiles:viewFiles ? true.
3953
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   618
    self setDoubleClickActionFor:instance.
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   619
    instance allButOpenInterface:#windowSpec.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   620
    boxCreatedCallback notNil ifTrue:[boxCreatedCallback value:instance].
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   621
8661
086147f751d0 AboutToOpenBoxNotificationSignal moved to SimpleView and now raised
Claus Gittinger <cg@exept.de>
parents: 8586
diff changeset
   622
    "/ Dialog aboutToOpenBoxNotificationSignal raiseRequestWith:instance.
7571
3e686c0ffb5c sortCaseless depending on Filename isCaseSensitive
fm
parents: 7567
diff changeset
   623
    instance treeBrowser sortCaselessInTreeBrowser value: (Filename isCaseSensitive not).
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   624
    instance openWindowModal.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   625
    ^ instance
6953
651025031ea2 initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents: 6728
diff changeset
   626
651025031ea2 initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents: 6728
diff changeset
   627
    "Modified: / 23-08-2006 / 12:24:54 / cg"
7571
3e686c0ffb5c sortCaseless depending on Filename isCaseSensitive
fm
parents: 7567
diff changeset
   628
    "Modified: / 13-12-2006 / 16:25:42 / User"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   629
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   630
321c1729db5b initial checkin
penk
parents:
diff changeset
   631
!FileDialog class methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   632
6650
1dedae38414a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6632
diff changeset
   633
classResources
9110
9fcea22ea3b7 showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 8663
diff changeset
   634
    ^ (FileBrowserV2 ? AbstractFileBrowser) classResources
6650
1dedae38414a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6632
diff changeset
   635
!
1dedae38414a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6632
diff changeset
   636
5931
penk
parents: 5930
diff changeset
   637
lastExtent
penk
parents: 5930
diff changeset
   638
    ^ LastExtent
penk
parents: 5930
diff changeset
   639
!
penk
parents: 5930
diff changeset
   640
penk
parents: 5930
diff changeset
   641
lastExtent:anExtent
penk
parents: 5930
diff changeset
   642
    LastExtent := anExtent
penk
parents: 5930
diff changeset
   643
!
penk
parents: 5930
diff changeset
   644
3953
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   645
setDoubleClickActionFor:instance
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   646
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   647
    instance doubleClickAction:[:anIndex|
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   648
        | item |
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   649
        item := instance treeBrowser fileList at:anIndex ifAbsent:nil.
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   650
        item notNil ifTrue:[
5329
022b6631df6f checkin from browser
Michael Beyl <mb@exept.de>
parents: 5230
diff changeset
   651
            (instance viewFiles and:[item isDirectory not]) ifTrue:[ 
3953
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   652
                instance doAccept.
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   653
            ]
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   654
        ]
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   655
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   656
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   657
8585
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
   658
!FileDialog class methodsFor:'help specs'!
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   659
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   660
flyByHelpSpec
8585
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
   661
    "This resource specification was automatically generated
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
   662
     by the UIHelpTool of ST/X."
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
   663
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
   664
    "Do not manually edit this!! If it is corrupted,
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
   665
     the UIHelpTool may not be able to read the specification."
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
   666
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
   667
    "
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
   668
     UIHelpTool openOnClass:FileDialog    
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
   669
    "
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
   670
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   671
    <resource: #help>
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   672
8585
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
   673
    ^ FileBrowserV2 flyByHelpSpec addPairsFrom:#(
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   674
8585
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
   675
#openFileBrowser
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
   676
'Open a FileBrowser on the selected Directory'
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   677
8585
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
   678
)
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   679
! !
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   680
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   681
!FileDialog class methodsFor:'interface specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   682
321c1729db5b initial checkin
penk
parents:
diff changeset
   683
windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   684
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
   685
     by the UIPainter of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
   686
321c1729db5b initial checkin
penk
parents:
diff changeset
   687
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
   688
     the UIPainter may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
   689
321c1729db5b initial checkin
penk
parents:
diff changeset
   690
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   691
     UIPainter new openOnClass:FileDialog andSelector:#windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   692
     FileDialog new openInterface:#windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   693
     FileDialog open
321c1729db5b initial checkin
penk
parents:
diff changeset
   694
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   695
321c1729db5b initial checkin
penk
parents:
diff changeset
   696
    <resource: #canvas>
321c1729db5b initial checkin
penk
parents:
diff changeset
   697
321c1729db5b initial checkin
penk
parents:
diff changeset
   698
    ^ 
5229
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   699
     #(FullSpec
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   700
        name: windowSpec
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   701
        window: 
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   702
       (WindowSpec
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   703
          label: 'FileDialog'
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   704
          name: 'FileDialog'
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   705
          min: (Point 10 10)
5873
penk
parents: 5868
diff changeset
   706
          bounds: (Rectangle 0 0 407 400)
9113
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   707
          menu: mainMenu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   708
          performer: treeBrowser
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   709
        )
5229
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   710
        component: 
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   711
       (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   712
          collection: (
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   713
           (ViewSpec
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   714
              name: 'FilePart'
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   715
              layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 -32 1.0)
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   716
              component: 
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   717
             (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   718
                collection: (
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   719
                 (MenuPanelSpec
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   720
                    name: 'ToolBar1'
8250
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   721
                    layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 40 0)
5229
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   722
                    tabable: true
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   723
                    menu: toolBarMenu
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   724
                    textDefault: true
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   725
                  )
5229
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   726
                 (VariableHorizontalPanelSpec
7919
6da8791c2e93 geometry (make underline visible); variable panel handle
fm
parents: 7581
diff changeset
   727
                    name: 'DeviceAndFilterPanel'
8250
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   728
                    layout: (LayoutFrame 0 0 40 0 0 1 70 0)
5229
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   729
                    level: 1
7919
6da8791c2e93 geometry (make underline visible); variable panel handle
fm
parents: 7581
diff changeset
   730
                    showHandle: true
5229
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   731
                    component: 
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   732
                   (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   733
                      collection: (
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   734
                       (ViewSpec
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   735
                          name: 'Box1'
6065
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
   736
                          component: 
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
   737
                         (SpecCollection
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
   738
                            collection: (
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
   739
                             (ComboListSpec
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
   740
                                name: 'ComboList1'
7919
6da8791c2e93 geometry (make underline visible); variable panel handle
fm
parents: 7581
diff changeset
   741
                                layout: (LayoutFrame 1 0 1 0.0 -1 1 -1 1)
6065
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
   742
                                visibilityChannel: driveSelectorVisible
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
   743
                                model: selectedDeviceDrive
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
   744
                                comboList: listOfDeviceDrives
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
   745
                                useIndex: false
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
   746
                                hidePullDownMenuButton: false
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
   747
                              )
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
   748
                             )
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
   749
                           
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
   750
                          )
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   751
                        )
5229
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   752
                       (ViewSpec
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   753
                          name: 'Box2'
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   754
                          component: 
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   755
                         (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   756
                            collection: (
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   757
                             (LabelSpec
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   758
                                label: 'Filter:'
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   759
                                name: 'FilterLabel'
7919
6da8791c2e93 geometry (make underline visible); variable panel handle
fm
parents: 7581
diff changeset
   760
                                layout: (LayoutFrame 1 0 2 0 59 0 -2 1)
5229
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   761
                                translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   762
                                adjust: right
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   763
                              )
5229
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   764
                             (InputFieldSpec
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   765
                                name: 'FilterEntryField'
7919
6da8791c2e93 geometry (make underline visible); variable panel handle
fm
parents: 7581
diff changeset
   766
                                layout: (LayoutFrame 60 0 -27 1 -2 1 -2 1)
5229
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   767
                                model: filterHolder
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   768
                                immediateAccept: true
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   769
                                acceptOnReturn: true
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   770
                                acceptOnTab: true
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   771
                                acceptOnLostFocus: true
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   772
                                acceptOnPointerLeave: false
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   773
                                postBuildCallback: postBuildFilterField:
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   774
                              )
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   775
                             )
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   776
                           
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   777
                          )
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   778
                        )
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   779
                       )
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   780
                     
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   781
                    )
9113
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   782
                    handles: (Any 0.2972972972973 1.0)
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   783
                  )
8250
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   784
                 (SubCanvasSpec
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   785
                    name: 'DirectoryTreeBrowser'
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   786
                    layout: (LayoutFrame 0 0.0 70 0 0 1.0 -30 1)
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   787
                    tabable: true
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   788
                    hasHorizontalScrollBar: false
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   789
                    hasVerticalScrollBar: false
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   790
                    majorKey: DirectoryTreeBrowser
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   791
                    subAspectHolders: 
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   792
                   (Array
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   793
                      
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   794
                     (SubChannelInfoSpec
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   795
                        subAspect: filterModel
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   796
                        aspect: filterHolder
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   797
                      ) 
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   798
                     (SubChannelInfoSpec
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   799
                        subAspect: rootHolder
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   800
                        aspect: rootDirectoryHolder
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   801
                      )
9113
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   802
                      
9110
9fcea22ea3b7 showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 8663
diff changeset
   803
                     (SubChannelInfoSpec
9fcea22ea3b7 showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 8663
diff changeset
   804
                        subAspect: showHiddenFiles
9fcea22ea3b7 showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 8663
diff changeset
   805
                        aspect: showHiddenFiles
9113
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   806
                      )
8250
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   807
                    )
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   808
                    createNewApplication: true
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   809
                    createNewBuilder: true
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   810
                    postBuildCallback: postBuildTreeBrowser:
60e3fd1433b3 geometry
Claus Gittinger <cg@exept.de>
parents: 8191
diff changeset
   811
                  )
5230
f81f386620c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5229
diff changeset
   812
                 (LabelSpec
f81f386620c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5229
diff changeset
   813
                    label: 'Filename:'
f81f386620c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5229
diff changeset
   814
                    name: 'FilenameLabel'
7919
6da8791c2e93 geometry (make underline visible); variable panel handle
fm
parents: 7581
diff changeset
   815
                    layout: (LayoutFrame 3 0 -25 1 73 0 -1 1)
5230
f81f386620c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5229
diff changeset
   816
                    translateLabel: true
f81f386620c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5229
diff changeset
   817
                    labelChannel: filenameLabelHolder
f81f386620c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5229
diff changeset
   818
                    adjust: left
f81f386620c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5229
diff changeset
   819
                  )
f81f386620c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5229
diff changeset
   820
                 (FilenameInputFieldSpec
f81f386620c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5229
diff changeset
   821
                    name: 'FilenameEntryField'
7919
6da8791c2e93 geometry (make underline visible); variable panel handle
fm
parents: 7581
diff changeset
   822
                    layout: (LayoutFrame 70 0 -25 1 -4 1 -1 1)
5230
f81f386620c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5229
diff changeset
   823
                    tabable: true
f81f386620c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5229
diff changeset
   824
                    model: filenameHolder
f81f386620c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5229
diff changeset
   825
                    immediateAccept: false
f81f386620c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5229
diff changeset
   826
                    acceptOnPointerLeave: false
5853
88f64d56a279 initial focus
Claus Gittinger <cg@exept.de>
parents: 5823
diff changeset
   827
                    hasKeyboardFocusInitially: true
5230
f81f386620c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5229
diff changeset
   828
                    postBuildCallback: postBuildFileNameField:
f81f386620c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5229
diff changeset
   829
                  )
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   830
                 )
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   831
               
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   832
              )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   833
            )
5229
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   834
           (HorizontalPanelViewSpec
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   835
              name: 'ButtonPanel'
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   836
              layout: (LayoutFrame 0 0.0 -32 1 0 1 0 1)
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   837
              visibilityChannel: buttonPanelVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   838
              horizontalLayout: fitSpace
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   839
              verticalLayout: center
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   840
              horizontalSpace: 3
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   841
              verticalSpace: 3
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   842
              reverseOrderIfOKAtLeft: true
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   843
              component: 
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   844
             (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   845
                collection: (
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   846
                 (ActionButtonSpec
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   847
                    label: 'Cancel'
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   848
                    name: 'cancelButton'
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   849
                    translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   850
                    labelChannel: cancelLabelHolder
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   851
                    tabable: true
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   852
                    model: doCancel
5873
penk
parents: 5868
diff changeset
   853
                    extent: (Point 131 22)
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   854
                  )
5229
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   855
                 (ActionButtonSpec
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   856
                    label: 'Append'
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   857
                    name: 'appendButton'
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   858
                    visibilityChannel: appendButtonVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   859
                    translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   860
                    labelChannel: appendLabelHolder
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   861
                    tabable: true
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   862
                    model: appendPressed
5873
penk
parents: 5868
diff changeset
   863
                    extent: (Point 132 22)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   864
                  )
5229
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   865
                 (ActionButtonSpec
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   866
                    label: 'OK'
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   867
                    name: 'okButton'
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   868
                    translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   869
                    labelChannel: okLabelHolder
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   870
                    tabable: true
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   871
                    model: okPressed
Claus Gittinger <cg@exept.de>
parents: 5220
diff changeset
   872
                    isDefault: true
5873
penk
parents: 5868
diff changeset
   873
                    extent: (Point 132 22)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   874
                  )
321c1729db5b initial checkin
penk
parents:
diff changeset
   875
                 )
321c1729db5b initial checkin
penk
parents:
diff changeset
   876
               
321c1729db5b initial checkin
penk
parents:
diff changeset
   877
              )
321c1729db5b initial checkin
penk
parents:
diff changeset
   878
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
   879
           )
321c1729db5b initial checkin
penk
parents:
diff changeset
   880
         
321c1729db5b initial checkin
penk
parents:
diff changeset
   881
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
   882
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
   883
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   884
321c1729db5b initial checkin
penk
parents:
diff changeset
   885
!FileDialog class methodsFor:'menu specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   886
9113
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   887
mainMenu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   888
    "This resource specification was automatically generated
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   889
     by the MenuEditor of ST/X."
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   890
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   891
    "Do not manually edit this!! If it is corrupted,
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   892
     the MenuEditor may not be able to read the specification."
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   893
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   894
    "
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   895
     MenuEditor new openOnClass:FileDialog andSelector:#mainMenu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   896
     (Menu new fromLiteralArrayEncoding:(FileDialog mainMenu)) startUp
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   897
    "
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   898
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   899
    <resource: #menu>
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   900
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   901
    ^ 
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   902
     #(Menu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   903
        (
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   904
         (MenuItem
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   905
            label: 'Directory'
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   906
            translateLabel: true
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   907
            submenu: 
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   908
           (Menu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   909
              (
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   910
               (MenuItem
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   911
                  label: 'Up'
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   912
                  itemValue: doGoDirectoryUp
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   913
                  translateLabel: true
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   914
                )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   915
               (MenuItem
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   916
                  label: '-'
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   917
                )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   918
               (MenuItem
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   919
                  activeHelpKey: directoryBack
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   920
                  enabled: enableBack
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   921
                  label: 'Back'
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   922
                  itemValue: doBack
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   923
                  translateLabel: true
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   924
                )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   925
               (MenuItem
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   926
                  activeHelpKey: directoryBack
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   927
                  enabled: enableForward
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   928
                  label: 'Forward'
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   929
                  itemValue: doForward
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   930
                  translateLabel: true
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   931
                )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   932
               (MenuItem
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   933
                  label: '-'
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   934
                )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   935
               (MenuItem
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   936
                  enabled: enableHome
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   937
                  label: 'Home Directory'
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   938
                  itemValue: doGotoHomeDirectory
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   939
                  translateLabel: true
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   940
                )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   941
               (MenuItem
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   942
                  label: 'Bookmarks'
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   943
                  translateLabel: true
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   944
                  submenuChannel: bookmarksMenu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   945
                )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   946
               (MenuItem
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   947
                  label: 'Visited Directories'
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   948
                  translateLabel: true
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   949
                  submenuChannel: visitedDirectoriesMenu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   950
                )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   951
               )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   952
              nil
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   953
              nil
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   954
            )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   955
          )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   956
         (MenuItem
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   957
            label: 'View'
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   958
            translateLabel: true
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   959
            submenu: 
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   960
           (Menu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   961
              (
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   962
               (MenuItem
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   963
                  label: 'Sort'
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   964
                  translateLabel: true
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   965
                  submenuChannel: sortMenu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   966
                )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   967
               (MenuItem
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   968
                  label: 'Show'
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   969
                  translateLabel: true
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   970
                  submenuChannel: showMenuSpecForDialog
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   971
                )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   972
               (MenuItem
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   973
                  label: '-'
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   974
                )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   975
               (MenuItem
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   976
                  label: 'Update'
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   977
                  itemValue: updateCurrentDirectory
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   978
                  translateLabel: true
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   979
                )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   980
               )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   981
              nil
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   982
              nil
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   983
            )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   984
          )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   985
         )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   986
        nil
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   987
        nil
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   988
      )
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   989
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
   990
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   991
toolBarMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
   992
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
   993
     by the MenuEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
   994
321c1729db5b initial checkin
penk
parents:
diff changeset
   995
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
   996
     the MenuEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
   997
321c1729db5b initial checkin
penk
parents:
diff changeset
   998
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   999
     MenuEditor new openOnClass:FileDialog andSelector:#toolBarMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
  1000
     (Menu new fromLiteralArrayEncoding:(FileDialog toolBarMenu)) startUp
321c1729db5b initial checkin
penk
parents:
diff changeset
  1001
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  1002
321c1729db5b initial checkin
penk
parents:
diff changeset
  1003
    <resource: #menu>
321c1729db5b initial checkin
penk
parents:
diff changeset
  1004
321c1729db5b initial checkin
penk
parents:
diff changeset
  1005
    ^ 
5873
penk
parents: 5868
diff changeset
  1006
     #(Menu
penk
parents: 5868
diff changeset
  1007
        (
penk
parents: 5868
diff changeset
  1008
         (MenuItem
penk
parents: 5868
diff changeset
  1009
            activeHelpKey: directoryBack
penk
parents: 5868
diff changeset
  1010
            enabled: enableBack
penk
parents: 5868
diff changeset
  1011
            label: 'Back'
penk
parents: 5868
diff changeset
  1012
            itemValue: doBack
penk
parents: 5868
diff changeset
  1013
            translateLabel: true
penk
parents: 5868
diff changeset
  1014
            isButton: true
penk
parents: 5868
diff changeset
  1015
            submenuChannel: menuDirHistoryBack
6087
344513ffd6a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6068
diff changeset
  1016
            labelImage: (ResourceRetriever AbstractFileBrowser historyBackIcon)
5873
penk
parents: 5868
diff changeset
  1017
            keepLinkedMenu: true
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1018
          )
5873
penk
parents: 5868
diff changeset
  1019
         (MenuItem
penk
parents: 5868
diff changeset
  1020
            label: ''
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1021
          )
5873
penk
parents: 5868
diff changeset
  1022
         (MenuItem
penk
parents: 5868
diff changeset
  1023
            activeHelpKey: directoryForward
penk
parents: 5868
diff changeset
  1024
            enabled: enableForward
penk
parents: 5868
diff changeset
  1025
            label: 'Forward'
penk
parents: 5868
diff changeset
  1026
            itemValue: doForward
penk
parents: 5868
diff changeset
  1027
            translateLabel: true
penk
parents: 5868
diff changeset
  1028
            isButton: true
penk
parents: 5868
diff changeset
  1029
            submenuChannel: menuDirHistoryForward
6087
344513ffd6a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6068
diff changeset
  1030
            labelImage: (ResourceRetriever AbstractFileBrowser historyForwardIcon)
5873
penk
parents: 5868
diff changeset
  1031
            keepLinkedMenu: true
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1032
          )
5873
penk
parents: 5868
diff changeset
  1033
         (MenuItem
6462
44990c9945fc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6409
diff changeset
  1034
            label: '-'
44990c9945fc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6409
diff changeset
  1035
          )
44990c9945fc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6409
diff changeset
  1036
         (MenuItem
44990c9945fc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6409
diff changeset
  1037
            activeHelpKey: directoryUp
44990c9945fc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6409
diff changeset
  1038
            enabled: enableDirectoryUp
44990c9945fc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6409
diff changeset
  1039
            label: 'DirectoryUp'
44990c9945fc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6409
diff changeset
  1040
            itemValue: doGoDirectoryUp
44990c9945fc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6409
diff changeset
  1041
            translateLabel: true
44990c9945fc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6409
diff changeset
  1042
            isButton: true
44990c9945fc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6409
diff changeset
  1043
            labelImage: (ResourceRetriever AbstractFileBrowser directoryUpIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1044
          )
5873
penk
parents: 5868
diff changeset
  1045
         (MenuItem
penk
parents: 5868
diff changeset
  1046
            activeHelpKey: fileHome
penk
parents: 5868
diff changeset
  1047
            enabled: enableHome
penk
parents: 5868
diff changeset
  1048
            label: 'Home'
penk
parents: 5868
diff changeset
  1049
            itemValue: doGotoHomeDirectory
penk
parents: 5868
diff changeset
  1050
            translateLabel: true
penk
parents: 5868
diff changeset
  1051
            isButton: true
6096
ad7437953ee4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6088
diff changeset
  1052
            labelImage: (ResourceRetriever ToolbarIconLibrary homeIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1053
          )
5873
penk
parents: 5868
diff changeset
  1054
         (MenuItem
8092
c75f44bd9e69 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 7919
diff changeset
  1055
            activeHelpKey: fileDesktop
8586
46504ccbcc93 enable goto desktop
Claus Gittinger <cg@exept.de>
parents: 8585
diff changeset
  1056
            enabled: enableGotoDesktop
8092
c75f44bd9e69 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 7919
diff changeset
  1057
            label: 'Desktop'
c75f44bd9e69 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 7919
diff changeset
  1058
            itemValue: doGotoDesktopDirectory
c75f44bd9e69 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 7919
diff changeset
  1059
            translateLabel: true
c75f44bd9e69 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 7919
diff changeset
  1060
            isButton: true
c75f44bd9e69 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 7919
diff changeset
  1061
            labelImage: (ResourceRetriever ToolbarIconLibrary desktopIcon)
c75f44bd9e69 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 7919
diff changeset
  1062
          )
c75f44bd9e69 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 7919
diff changeset
  1063
         (MenuItem
6098
8b70ed799a5e bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  1064
            activeHelpKey: fileGotoBookmark
8b70ed799a5e bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  1065
            label: 'Bookmarks'
8b70ed799a5e bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  1066
            translateLabel: true
8b70ed799a5e bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  1067
            isButton: true
9113
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1068
            submenuChannel: gotoBookmarksMenu
6098
8b70ed799a5e bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  1069
            labelImage: (ResourceRetriever ToolbarIconLibrary directoryBookmarksIcon)
8b70ed799a5e bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  1070
          )
8b70ed799a5e bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  1071
         (MenuItem
5873
penk
parents: 5868
diff changeset
  1072
            label: '-'
penk
parents: 5868
diff changeset
  1073
            isVisible: newDirectoryVisibilityHolder
3923
2988fc3c88ab next stage
penk
parents: 3905
diff changeset
  1074
          )
5873
penk
parents: 5868
diff changeset
  1075
         (MenuItem
6122
f6cb3f5ebe48 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6098
diff changeset
  1076
            label: 'New Directory...'
5873
penk
parents: 5868
diff changeset
  1077
            itemValue: newDirectory
penk
parents: 5868
diff changeset
  1078
            translateLabel: true
penk
parents: 5868
diff changeset
  1079
            isButton: true
penk
parents: 5868
diff changeset
  1080
            isVisible: newDirectoryVisibilityHolder
6088
486567591821 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6087
diff changeset
  1081
            labelImage: (ResourceRetriever AbstractFileBrowser newDirectoryIcon)
3923
2988fc3c88ab next stage
penk
parents: 3905
diff changeset
  1082
          )
8585
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
  1083
         (MenuItem
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
  1084
            label: '-'
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
  1085
            isVisible: browseVisibleHolder
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
  1086
          )
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
  1087
         (MenuItem
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
  1088
            activeHelpKey: openFileBrowser
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
  1089
            label: 'Browse'
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
  1090
            itemValue: doBrowseDirectory
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
  1091
            translateLabel: true
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
  1092
            isButton: true
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
  1093
            isVisible: browseVisibleHolder
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
  1094
            labelImage: (ResourceRetriever ToolbarIconLibrary startFileBrowserIcon)
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
  1095
          )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1096
         )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1097
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  1098
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  1099
      )
9113
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1100
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1101
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1102
viewInContentsBrowserMenu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1103
    ^ DirectoryContentsBrowser showMenuSpec
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1104
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1105
8182
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1106
!FileDialog class methodsFor:'plugIn spec'!
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1107
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1108
aspectSelectors
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1109
    "This resource specification was automatically generated
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1110
     by the UIPainter of ST/X."
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1111
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1112
    "Do not manually edit this. If it is corrupted,
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1113
     the UIPainter may not be able to read the specification."
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1114
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1115
    "Return a description of exported aspects;
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1116
     these can be connected to aspects of an embedding application
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1117
     (if this app is embedded in a subCanvas)."
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1118
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1119
    ^ #(
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1120
        #filenameHolder
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1121
        #filterHolder
8191
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1122
        #rootDirectoryHolder
8182
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1123
      ).
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1124
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1125
! !
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1126
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1127
!FileDialog methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1128
3996
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
  1129
currentSelectedFiles
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
  1130
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
  1131
    | selectedFiles|
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
  1132
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
  1133
    selectedFiles := treeBrowser currentFileNameHolder value.
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
  1134
    ^ selectedFiles select:[:aFile| aFile isDirectory not].
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
  1135
!
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
  1136
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1137
directory
321c1729db5b initial checkin
penk
parents:
diff changeset
  1138
    "return the value of the instance variable 'directory' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1139
321c1729db5b initial checkin
penk
parents:
diff changeset
  1140
    ^ directory
321c1729db5b initial checkin
penk
parents:
diff changeset
  1141
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1142
321c1729db5b initial checkin
penk
parents:
diff changeset
  1143
directory:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  1144
    "set the value of the instance variable 'directory' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1145
321c1729db5b initial checkin
penk
parents:
diff changeset
  1146
    directory := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1147
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1148
321c1729db5b initial checkin
penk
parents:
diff changeset
  1149
initialText
321c1729db5b initial checkin
penk
parents:
diff changeset
  1150
5598
5b48cc4c1ef6 Fix for hideButtonPanel
Stefan Vogel <sv@exept.de>
parents: 5571
diff changeset
  1151
    initialText isNil ifTrue:[
5b48cc4c1ef6 Fix for hideButtonPanel
Stefan Vogel <sv@exept.de>
parents: 5571
diff changeset
  1152
        ^ resources string:'File Dialog'.
5b48cc4c1ef6 Fix for hideButtonPanel
Stefan Vogel <sv@exept.de>
parents: 5571
diff changeset
  1153
    ].
5b48cc4c1ef6 Fix for hideButtonPanel
Stefan Vogel <sv@exept.de>
parents: 5571
diff changeset
  1154
    ^ resources string:initialText
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1155
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1156
321c1729db5b initial checkin
penk
parents:
diff changeset
  1157
initialText:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  1158
    "set the value of the instance variable 'initialText' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1159
321c1729db5b initial checkin
penk
parents:
diff changeset
  1160
    initialText := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1161
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1162
321c1729db5b initial checkin
penk
parents:
diff changeset
  1163
pattern
321c1729db5b initial checkin
penk
parents:
diff changeset
  1164
    "return the value of the instance variable 'pattern' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1165
321c1729db5b initial checkin
penk
parents:
diff changeset
  1166
    ^ pattern
321c1729db5b initial checkin
penk
parents:
diff changeset
  1167
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1168
321c1729db5b initial checkin
penk
parents:
diff changeset
  1169
pattern:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  1170
    "set the value of the instance variable 'pattern' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1171
321c1729db5b initial checkin
penk
parents:
diff changeset
  1172
    pattern := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1173
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1174
321c1729db5b initial checkin
penk
parents:
diff changeset
  1175
result
321c1729db5b initial checkin
penk
parents:
diff changeset
  1176
    "return the value of the instance variable 'result' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1177
321c1729db5b initial checkin
penk
parents:
diff changeset
  1178
    ^ result
321c1729db5b initial checkin
penk
parents:
diff changeset
  1179
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1180
321c1729db5b initial checkin
penk
parents:
diff changeset
  1181
result:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  1182
    "set the value of the instance variable 'result' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1183
321c1729db5b initial checkin
penk
parents:
diff changeset
  1184
    result := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1185
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1186
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1187
selectedDirectories
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1188
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1189
    | selectedFiles|
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1190
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1191
    selectedFiles := treeBrowser currentFileNameHolder value.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1192
    ^ selectedFiles select:[:aFile| aFile isDirectory].
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1193
!
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1194
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1195
startFilename
321c1729db5b initial checkin
penk
parents:
diff changeset
  1196
    "return the value of the instance variable 'startFilename' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1197
321c1729db5b initial checkin
penk
parents:
diff changeset
  1198
    startFilename isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1199
        startFilename := Filename currentDirectory asAbsoluteFilename.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1200
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1201
    ^ startFilename
321c1729db5b initial checkin
penk
parents:
diff changeset
  1202
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1203
321c1729db5b initial checkin
penk
parents:
diff changeset
  1204
startFilename:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  1205
    "set the value of the instance variable 'startFilename' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1206
321c1729db5b initial checkin
penk
parents:
diff changeset
  1207
    startFilename := something.
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1208
! !
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1209
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1210
!FileDialog methodsFor:'accessing-behavior'!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1211
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1212
asLoadDialog
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1213
    ^ self isLoadDialog
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1214
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1215
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1216
asLoadDialog:aBoolean
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1217
    self beLoadDialog:aBoolean
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1218
!
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1219
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1220
beLoadDialog:aBoolean
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1221
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1222
    isLoadDialog := aBoolean
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1223
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1224
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1225
doubleClickAction
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1226
    "return the value of the instance variable 'doubleClickAction' (automatically generated)"
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1227
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1228
    ^ doubleClickAction
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1229
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1230
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1231
doubleClickAction:something
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1232
    "set the value of the instance variable 'doubleClickAction' (automatically generated)"
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1233
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1234
    doubleClickAction := something.
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1235
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1236
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1237
isLoadDialog
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1238
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1239
    ^ isLoadDialog ? true
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1240
!
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1241
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1242
multipleSelect
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1243
    ^ multipleSelect ? false
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1244
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1245
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1246
multipleSelect:aBoolean
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1247
    multipleSelect := aBoolean.
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1248
    treeBrowser notNil ifTrue:[
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1249
        treeBrowser multipleSelect:aBoolean.
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1250
    ].
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1251
! !
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1252
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1253
!FileDialog methodsFor:'accessing-components'!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1254
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1255
addButton:aButton
6068
b7426bb73588 addButton
Claus Gittinger <cg@exept.de>
parents: 6065
diff changeset
  1256
    |buttonPanel okButton|
b7426bb73588 addButton
Claus Gittinger <cg@exept.de>
parents: 6065
diff changeset
  1257
b7426bb73588 addButton
Claus Gittinger <cg@exept.de>
parents: 6065
diff changeset
  1258
    buttonPanel := self componentAt:#ButtonPanel.
b7426bb73588 addButton
Claus Gittinger <cg@exept.de>
parents: 6065
diff changeset
  1259
    okButton := self okButton.
b7426bb73588 addButton
Claus Gittinger <cg@exept.de>
parents: 6065
diff changeset
  1260
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1261
    DialogBox defaultOKButtonAtLeft ifTrue:[
6068
b7426bb73588 addButton
Claus Gittinger <cg@exept.de>
parents: 6065
diff changeset
  1262
        buttonPanel addSubView:aButton before:okButton
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1263
    ] ifFalse:[
6068
b7426bb73588 addButton
Claus Gittinger <cg@exept.de>
parents: 6065
diff changeset
  1264
        buttonPanel addSubView:aButton after:okButton
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1265
    ].
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1266
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1267
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1268
okButton
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1269
    ^ (self componentAt:#okButton) 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1270
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1271
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1272
treeBrowser
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1273
    "return the value of the instance variable 'treeBrowser' (automatically generated)"
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1274
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1275
    ^ treeBrowser
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1276
! !
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1277
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1278
!FileDialog methodsFor:'accessing-look'!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1279
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1280
hideButtonPanel
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1281
    self buttonPanelVisibleHolder value:false
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1282
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1283
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1284
newDirectoryVisibilityHolder
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1285
    newDirectoryVisibilityHolder isNil ifTrue:[
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1286
        newDirectoryVisibilityHolder := true asValue.
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1287
    ].
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1288
    ^ newDirectoryVisibilityHolder
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1289
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1290
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1291
showButtonPanel
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1292
    self buttonPanelVisibleHolder value:true
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1293
!
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1294
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1295
viewFiles
321c1729db5b initial checkin
penk
parents:
diff changeset
  1296
    "return the value of the instance variable 'viewFiles' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1297
321c1729db5b initial checkin
penk
parents:
diff changeset
  1298
    ^ viewFiles
321c1729db5b initial checkin
penk
parents:
diff changeset
  1299
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1300
321c1729db5b initial checkin
penk
parents:
diff changeset
  1301
viewFiles:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  1302
    "set the value of the instance variable 'viewFiles' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1303
321c1729db5b initial checkin
penk
parents:
diff changeset
  1304
    viewFiles := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1305
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1306
321c1729db5b initial checkin
penk
parents:
diff changeset
  1307
!FileDialog methodsFor:'aspects'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1308
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
  1309
appendButtonVisibleHolder
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
  1310
    appendButtonVisibleHolder isNil ifTrue:[
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
  1311
        appendButtonVisibleHolder := false asValue.
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
  1312
    ].
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
  1313
    ^ appendButtonVisibleHolder
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
  1314
!
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
  1315
5193
cc132f6bb560 appendLabelHolder was removed
penk
parents: 5189
diff changeset
  1316
appendLabelHolder
cc132f6bb560 appendLabelHolder was removed
penk
parents: 5189
diff changeset
  1317
    appendLabelHolder isNil ifTrue:[
cc132f6bb560 appendLabelHolder was removed
penk
parents: 5189
diff changeset
  1318
        appendLabelHolder := 'Append' asValue.
cc132f6bb560 appendLabelHolder was removed
penk
parents: 5189
diff changeset
  1319
    ].
cc132f6bb560 appendLabelHolder was removed
penk
parents: 5189
diff changeset
  1320
    ^ appendLabelHolder
cc132f6bb560 appendLabelHolder was removed
penk
parents: 5189
diff changeset
  1321
!
cc132f6bb560 appendLabelHolder was removed
penk
parents: 5189
diff changeset
  1322
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1323
aspectOrNil:aKey forSubApplication:aSubApp
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1324
    "this hook provides an aspect for a subApp"
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1325
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1326
    aKey == #currentFileNameHolder ifTrue:[
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1327
        directory notNil ifTrue:[
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1328
            ^ (OrderedCollection with:directory) asValue
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1329
        ]
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1330
    ].
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1331
    ^ nil
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1332
!
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1333
5969
3b4c0c099aab browseVisibleHolder added
penk
parents: 5966
diff changeset
  1334
browseVisibleHolder
3b4c0c099aab browseVisibleHolder added
penk
parents: 5966
diff changeset
  1335
    browseVisibleHolder isNil ifTrue:[
8585
55e239825e8d browseVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 8250
diff changeset
  1336
        browseVisibleHolder := true "false" asValue.
5969
3b4c0c099aab browseVisibleHolder added
penk
parents: 5966
diff changeset
  1337
    ].
3b4c0c099aab browseVisibleHolder added
penk
parents: 5966
diff changeset
  1338
    ^ browseVisibleHolder.
3b4c0c099aab browseVisibleHolder added
penk
parents: 5966
diff changeset
  1339
!
3b4c0c099aab browseVisibleHolder added
penk
parents: 5966
diff changeset
  1340
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1341
buttonPanelVisibleHolder
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1342
    buttonPanelVisibleHolder isNil ifTrue:[
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1343
        buttonPanelVisibleHolder := true asValue.
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1344
        buttonPanelVisibleHolder onChangeSend:#buttonPanelVisibilityChanged to:self.
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1345
    ].
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1346
    ^ buttonPanelVisibleHolder.
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1347
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1348
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1349
cancelLabelHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1350
321c1729db5b initial checkin
penk
parents:
diff changeset
  1351
    cancelLabelHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1352
        cancelLabelHolder := 'Cancel' asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1353
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1354
    ^ cancelLabelHolder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1355
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1356
321c1729db5b initial checkin
penk
parents:
diff changeset
  1357
enableBack
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1358
    ^ treeBrowser enableBack.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1359
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1360
321c1729db5b initial checkin
penk
parents:
diff changeset
  1361
enableDirectoryUp
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1362
    ^ treeBrowser enableDirectoryUp.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1363
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1364
321c1729db5b initial checkin
penk
parents:
diff changeset
  1365
enableForward
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1366
    ^ treeBrowser enableForward.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1367
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1368
8169
b746d1eb2d40 changed #enableGotoDesktop
Claus Gittinger <cg@exept.de>
parents: 8092
diff changeset
  1369
enableGotoDesktop
b746d1eb2d40 changed #enableGotoDesktop
Claus Gittinger <cg@exept.de>
parents: 8092
diff changeset
  1370
    ^ treeBrowser enableGotoDesktop.
b746d1eb2d40 changed #enableGotoDesktop
Claus Gittinger <cg@exept.de>
parents: 8092
diff changeset
  1371
!
b746d1eb2d40 changed #enableGotoDesktop
Claus Gittinger <cg@exept.de>
parents: 8092
diff changeset
  1372
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1373
enableHome
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1374
    ^ treeBrowser enableHome.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1375
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1376
9269
4d09efee3752 added: #fileEntryFieldHolder
Claus Gittinger <cg@exept.de>
parents: 9113
diff changeset
  1377
fileEntryFieldHolder
4d09efee3752 added: #fileEntryFieldHolder
Claus Gittinger <cg@exept.de>
parents: 9113
diff changeset
  1378
    "for directoryTreeBrowser"
4d09efee3752 added: #fileEntryFieldHolder
Claus Gittinger <cg@exept.de>
parents: 9113
diff changeset
  1379
4d09efee3752 added: #fileEntryFieldHolder
Claus Gittinger <cg@exept.de>
parents: 9113
diff changeset
  1380
    ^ self filenameHolder
4d09efee3752 added: #fileEntryFieldHolder
Claus Gittinger <cg@exept.de>
parents: 9113
diff changeset
  1381
!
4d09efee3752 added: #fileEntryFieldHolder
Claus Gittinger <cg@exept.de>
parents: 9113
diff changeset
  1382
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1383
filenameHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1384
    "Return a value holder with the filename.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1385
     Shown in the filename input-field.
9514
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1386
     Being the selection in the tree."
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1387
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1388
    |holder|
7581
8720d2277df6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7571
diff changeset
  1389
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1390
    holder := builder bindingAt:#filenameHolder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1391
7581
8720d2277df6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7571
diff changeset
  1392
    holder isNil ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1393
        holder := ValueHolder new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1394
        holder addDependent:self.
9514
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1395
        builder aspectAt:#filenameHolder put:holder.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1396
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1397
321c1729db5b initial checkin
penk
parents:
diff changeset
  1398
    ^ holder.
9514
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1399
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1400
    "Modified: / 09-07-2010 / 19:25:15 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1401
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1402
8183
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1403
filenameHolder:aHolder 
8182
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1404
    "needed when used as subcanvas"
8183
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1405
    
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1406
    |holder|
8182
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1407
8183
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1408
    holder := builder aspectAt:#filenameHolder.
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1409
    holder notNil ifTrue:[
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1410
        holder removeDependent:self
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1411
    ].
8182
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1412
    builder aspectAt:#filenameHolder put:aHolder.
8183
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1413
    aHolder addDependent:self
8182
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1414
!
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1415
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1416
filenameLabelHolder
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1417
    "Return a value holder for the input string.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1418
    "
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1419
    filenameLabelHolder isNil ifTrue:[
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1420
        filenameLabelHolder := 'Filename:' asValue.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1421
    ].
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1422
    ^ filenameLabelHolder
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1423
!
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1424
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1425
filterHolder
8183
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1426
    "Return a value holder for filter"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1427
321c1729db5b initial checkin
penk
parents:
diff changeset
  1428
    filterHolder isNil ifTrue:[
8191
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1429
        filterHolder := (self pattern ? '*') asValue.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1430
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1431
    ^ filterHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1432
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1433
8183
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1434
filterHolder:aHolder
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1435
    "needed when used as subcanvas"
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1436
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1437
    filterHolder := aHolder.
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1438
!
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1439
9113
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1440
gotoBookmarksMenu
6098
8b70ed799a5e bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  1441
    <resource: #programMenu>
8b70ed799a5e bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  1442
9113
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1443
    ^ treeBrowser gotoBookmarksMenu
7567
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1444
"/    |menu bookmarks|
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1445
"/
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1446
"/    menu := treeBrowser class emptyMenuSpec decodeAsLiteralArray.
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1447
"/    menu findGuiResourcesIn:self.
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1448
"/    menu receiver:self.
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1449
"/
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1450
"/    "/ add the bookmark items ...
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1451
"/    bookmarks := treeBrowser class directoryBookmarks.
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1452
"/    bookmarks notEmptyOrNil ifTrue:[
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1453
"/        bookmarks do:[:dirName |
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1454
"/            menu addItem:((MenuItem label:dirName asString value:[
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1455
"/                (treeBrowser currentSelectedDirectories includes:dirName) ifFalse:[
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1456
"/                    treeBrowser setCurrentFileName:dirName.
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1457
"/                ].
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1458
"/            ])).
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1459
"/        ].
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1460
"/    ].
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1461
"/    ^ menu
6098
8b70ed799a5e bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  1462
7567
9896e794a220 share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents: 6953
diff changeset
  1463
    "Modified: / 06-12-2006 / 12:05:06 / cg"
6098
8b70ed799a5e bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  1464
!
8b70ed799a5e bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  1465
6065
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1466
listOfDeviceDrives
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1467
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1468
    listOfDeviceDrives isNil ifTrue:[
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1469
        listOfDeviceDrives := Filename volumes.
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1470
    ].
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1471
    ^ listOfDeviceDrives
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1472
!
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1473
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1474
okLabelHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1475
    "automatically generated by UIPainter ..."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1476
321c1729db5b initial checkin
penk
parents:
diff changeset
  1477
    "*** the code below creates a default model when invoked."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1478
    "*** (which may not be the one you wanted)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1479
    "*** Please change as required and accept it in the browser."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1480
    "*** (and replace this comment by something more useful ;-)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1481
321c1729db5b initial checkin
penk
parents:
diff changeset
  1482
    okLabelHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1483
        okLabelHolder := 'OK' asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1484
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1485
    ^ okLabelHolder.
6065
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1486
!
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1487
8191
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1488
rootDirectoryHolder
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1489
    "Return a value holder for filter"
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1490
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1491
    rootDirectoryHolder isNil ifTrue:[
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1492
        rootDirectoryHolder := self initialRootDirectory asValue.
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1493
    ].
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1494
    ^ rootDirectoryHolder
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1495
!
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1496
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1497
rootDirectoryHolder:aHolder
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1498
    "Return a value holder for filter"
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1499
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1500
    rootDirectoryHolder := aHolder.
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1501
!
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1502
6065
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1503
selectedDeviceDrive
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1504
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1505
    selectedDeviceDrive isNil ifTrue:[
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1506
        selectedDeviceDrive := self listOfDeviceDrives first asValue.
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1507
        selectedDeviceDrive addDependent:self.
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1508
    ].
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1509
    ^ selectedDeviceDrive
9110
9fcea22ea3b7 showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 8663
diff changeset
  1510
!
9fcea22ea3b7 showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 8663
diff changeset
  1511
9113
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1512
showDirectoryTree
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1513
    ^ false
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1514
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1515
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1516
showDiskUsageHolder
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1517
    ^ treeBrowser showDiskUsageHolder
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1518
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1519
9110
9fcea22ea3b7 showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 8663
diff changeset
  1520
showHiddenFiles
9113
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1521
    ^ treeBrowser showHiddenFiles
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1522
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1523
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1524
shownFiles
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1525
    ^ treeBrowser shownFiles
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1526
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1527
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1528
sortCaselessInTreeBrowser
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1529
    ^ treeBrowser sortCaselessInTreeBrowser
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1530
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1531
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1532
sortInTreeVisibilityHolder
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1533
    ^ true
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1534
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1535
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1536
sortPropertyInTree
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1537
    ^ treeBrowser sortBlockProperty
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1538
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1539
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1540
viewDirsInContentsBrowser
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1541
    ^ false
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1542
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1543
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1544
viewFilesInDirectoryTree
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1545
    ^ false
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1546
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1547
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1548
viewNoteBookApplicationHolder
9110
9fcea22ea3b7 showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 8663
diff changeset
  1549
    ^ false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1550
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1551
321c1729db5b initial checkin
penk
parents:
diff changeset
  1552
!FileDialog methodsFor:'change & update'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1553
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1554
buttonPanelVisibilityChanged
5598
5b48cc4c1ef6 Fix for hideButtonPanel
Stefan Vogel <sv@exept.de>
parents: 5571
diff changeset
  1555
    |filePart|
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1556
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1557
    filePart := builder componentAt:#FilePart.
5598
5b48cc4c1ef6 Fix for hideButtonPanel
Stefan Vogel <sv@exept.de>
parents: 5571
diff changeset
  1558
    filePart notNil ifTrue:[
5b48cc4c1ef6 Fix for hideButtonPanel
Stefan Vogel <sv@exept.de>
parents: 5571
diff changeset
  1559
        buttonPanelVisibleHolder value ifTrue:[
5b48cc4c1ef6 Fix for hideButtonPanel
Stefan Vogel <sv@exept.de>
parents: 5571
diff changeset
  1560
            filePart layout bottomOffset:-40
5b48cc4c1ef6 Fix for hideButtonPanel
Stefan Vogel <sv@exept.de>
parents: 5571
diff changeset
  1561
        ] ifFalse:[
5b48cc4c1ef6 Fix for hideButtonPanel
Stefan Vogel <sv@exept.de>
parents: 5571
diff changeset
  1562
            filePart layout bottomOffset:0
5b48cc4c1ef6 Fix for hideButtonPanel
Stefan Vogel <sv@exept.de>
parents: 5571
diff changeset
  1563
        ].
5b48cc4c1ef6 Fix for hideButtonPanel
Stefan Vogel <sv@exept.de>
parents: 5571
diff changeset
  1564
        filePart containerChangedSize    "/ force resize
5b48cc4c1ef6 Fix for hideButtonPanel
Stefan Vogel <sv@exept.de>
parents: 5571
diff changeset
  1565
   ]
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1566
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1567
6065
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1568
selectedDeviceDriveChanged
9683
83fb945b7a5a changed: #selectedDeviceDriveChanged
Claus Gittinger <cg@exept.de>
parents: 9678
diff changeset
  1569
    |newDrive curSel newFile|
6065
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1570
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1571
    newDrive := self selectedDeviceDrive value.
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1572
    curSel := treeBrowser currentFileNameHolder value.
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1573
    curSel notEmpty ifTrue:[
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1574
        curSel first volume = newDrive ifTrue:[ ^self].
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1575
    ].
9683
83fb945b7a5a changed: #selectedDeviceDriveChanged
Claus Gittinger <cg@exept.de>
parents: 9678
diff changeset
  1576
6065
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1577
    newDrive notNil ifTrue:[
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1578
        newFile := newDrive asFilename.
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1579
        newFile isReadable ifTrue:[
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1580
            treeBrowser gotoFile:newFile.
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1581
            ^self.
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1582
        ].
9683
83fb945b7a5a changed: #selectedDeviceDriveChanged
Claus Gittinger <cg@exept.de>
parents: 9678
diff changeset
  1583
        self warn:'Cannot open drive %1' with:newFile asFilename volume.
6065
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1584
    ].
9683
83fb945b7a5a changed: #selectedDeviceDriveChanged
Claus Gittinger <cg@exept.de>
parents: 9678
diff changeset
  1585
83fb945b7a5a changed: #selectedDeviceDriveChanged
Claus Gittinger <cg@exept.de>
parents: 9678
diff changeset
  1586
    newDrive := curSel notEmpty ifTrue:[ curSel first volume ] ifFalse:[ 'C:' ].
83fb945b7a5a changed: #selectedDeviceDriveChanged
Claus Gittinger <cg@exept.de>
parents: 9678
diff changeset
  1587
    self selectedDeviceDrive value:newDrive.
6065
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1588
!
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1589
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1590
update:something with:aParameter from:changedObject
9514
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1591
    |files newFile newLabel fn entryFieldFilename filenameHolder|
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1592
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1593
    filenameHolder := self filenameHolder.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1594
321c1729db5b initial checkin
penk
parents:
diff changeset
  1595
    changedObject == treeBrowser currentFileNameHolder ifTrue:[
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1596
        files := changedObject value.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1597
321c1729db5b initial checkin
penk
parents:
diff changeset
  1598
        (files isEmpty) ifTrue:[
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1599
            newFile := nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1600
        ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1601
            files size == 1 ifTrue:[
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1602
                newFile := files first.    
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1603
            ] ifFalse:[
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1604
                newFile := ''.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1605
            ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1606
        ].
9514
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1607
        (filenameHolder value notNil 
5924
bed48aebdf4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5903
diff changeset
  1608
        and:[newFile notNil 
bed48aebdf4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5903
diff changeset
  1609
        and:[newFile asFilename isDirectory]]) ifTrue:[
9514
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1610
            entryFieldFilename := filenameHolder value asFilename.
5867
ef786691f063 *** empty log message ***
penk
parents: 5863
diff changeset
  1611
            self startFilename asFilename baseName = entryFieldFilename baseName ifTrue:[
6250
5b0673ccff1c refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents: 6122
diff changeset
  1612
                entryFieldFilename isDirectory ifFalse:[
5867
ef786691f063 *** empty log message ***
penk
parents: 5863
diff changeset
  1613
                    newFile := newFile asFilename construct:entryFieldFilename baseName.
ef786691f063 *** empty log message ***
penk
parents: 5863
diff changeset
  1614
                ].
ef786691f063 *** empty log message ***
penk
parents: 5863
diff changeset
  1615
            ].
ef786691f063 *** empty log message ***
penk
parents: 5863
diff changeset
  1616
        ].
9514
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1617
        filenameHolder value:newFile withoutNotifying:self.
6065
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1618
        OperatingSystem supportsVolumes ifTrue:[
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1619
            | volume |
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1620
            volume := (files size >= 1) 
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1621
                    ifTrue:[files first volume] 
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1622
                    ifFalse:nil.    
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1623
            self selectedDeviceDrive value:volume.
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1624
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1625
    ].
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1626
6065
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1627
    changedObject == self selectedDeviceDrive ifTrue:[
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1628
        self selectedDeviceDriveChanged.
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1629
        ^ self.
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1630
    ].
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1631
    changedObject == treeBrowser viewFilesInDirectoryTree ifTrue:[
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1632
        changedObject value ifTrue:[
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1633
            newLabel := 'Filename:'.
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1634
        ] ifFalse:[
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1635
            newLabel := 'Directory:'.
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1636
        ].
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1637
        self filenameLabelHolder value:(resources string:newLabel)
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1638
    ].
9514
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1639
    changedObject == filenameHolder ifTrue:[
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1640
        fn := changedObject value asFilename.
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1641
        (fn exists) ifFalse:[^ self].
9514
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1642
        treeBrowser currentFileNameHolder 
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1643
                        value:(OrderedCollection with:fn) withoutNotifying:self.
5949
bf5584691fd6 *** empty log message ***
penk
parents: 5934
diff changeset
  1644
        fn isDirectory ifTrue:[
bf5584691fd6 *** empty log message ***
penk
parents: 5934
diff changeset
  1645
            treeBrowser expandEnforceSelectedItems.
bf5584691fd6 *** empty log message ***
penk
parents: 5934
diff changeset
  1646
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1647
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1648
    ^ super update:something with:aParameter from:changedObject
9514
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1649
c818ca8969f7 comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents: 9476
diff changeset
  1650
    "Modified: / 09-07-2010 / 19:34:55 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1651
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1652
321c1729db5b initial checkin
penk
parents:
diff changeset
  1653
!FileDialog methodsFor:'event handling'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1654
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1655
appendWasPressed
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1656
    "valid after the dialog has been closed: true if append was pressed"
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1657
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1658
    ^ appendWasPressed
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1659
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1660
321c1729db5b initial checkin
penk
parents:
diff changeset
  1661
!FileDialog methodsFor:'initialization & release'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1662
5932
eea85a7af4b1 remark last extent
penk
parents: 5931
diff changeset
  1663
closeDownViews
eea85a7af4b1 remark last extent
penk
parents: 5931
diff changeset
  1664
    self remarkExtent.
eea85a7af4b1 remark last extent
penk
parents: 5931
diff changeset
  1665
    super closeDownViews.
eea85a7af4b1 remark last extent
penk
parents: 5931
diff changeset
  1666
!
eea85a7af4b1 remark last extent
penk
parents: 5931
diff changeset
  1667
eea85a7af4b1 remark last extent
penk
parents: 5931
diff changeset
  1668
closeWindow
eea85a7af4b1 remark last extent
penk
parents: 5931
diff changeset
  1669
    self remarkExtent.
eea85a7af4b1 remark last extent
penk
parents: 5931
diff changeset
  1670
    super closeWindow.
eea85a7af4b1 remark last extent
penk
parents: 5931
diff changeset
  1671
!
eea85a7af4b1 remark last extent
penk
parents: 5931
diff changeset
  1672
5903
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1673
commonPostOpen
8182
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1674
    |selection|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1675
321c1729db5b initial checkin
penk
parents:
diff changeset
  1676
"/     self windowGroup addPreEventHook:self.
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1677
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1678
    treeBrowser currentFileNameHolder addDependent:self.
5598
5b48cc4c1ef6 Fix for hideButtonPanel
Stefan Vogel <sv@exept.de>
parents: 5571
diff changeset
  1679
    treeBrowser doubleClickAction:self doubleClickAction.
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1680
    treeBrowser viewFilesInDirectoryTree addDependent:self.
5863
e31e066a41d9 root is one up (showing containing directory)
Claus Gittinger <cg@exept.de>
parents: 5858
diff changeset
  1681
6409
b4e8b1c4c2d6 initialRootDirectory: set to directory browser too
ca
parents: 6356
diff changeset
  1682
    treeBrowser rootHolder value:(self initialRootDirectory).
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1683
    treeBrowser viewFilesInDirectoryTree setValue:(self viewFiles ? true).
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1684
    treeBrowser viewFilesInDirectoryTree changed.
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1685
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1686
    self isLoadDialog ifTrue:[
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1687
        treeBrowser newVisibilityHolder value:false.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1688
        treeBrowser allowFileOperations value:false.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1689
        self newDirectoryVisibilityHolder value:false.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1690
    ].
5927
1f8faa30e394 expand selected directory item on startup
penk
parents: 5924
diff changeset
  1691
    treeBrowser expandEnforceSelectedItems.
5929
456900f1aba5 *** empty log message ***
martin
parents: 5927
diff changeset
  1692
456900f1aba5 *** empty log message ***
martin
parents: 5927
diff changeset
  1693
    selection := treeBrowser treeSelectionHolder value.
456900f1aba5 *** empty log message ***
martin
parents: 5927
diff changeset
  1694
    selection notEmptyOrNil ifTrue:[
5930
e334dcfffb9e *** empty log message ***
martin
parents: 5929
diff changeset
  1695
        selection := selection asCollection first.
5929
456900f1aba5 *** empty log message ***
martin
parents: 5927
diff changeset
  1696
        selection enforcedExpand.
456900f1aba5 *** empty log message ***
martin
parents: 5927
diff changeset
  1697
        treeBrowser browser makeItemVisible:selection withMinimumLines:5.
456900f1aba5 *** empty log message ***
martin
parents: 5927
diff changeset
  1698
    ].
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1699
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1700
6409
b4e8b1c4c2d6 initialRootDirectory: set to directory browser too
ca
parents: 6356
diff changeset
  1701
initialRootDirectory
b4e8b1c4c2d6 initialRootDirectory: set to directory browser too
ca
parents: 6356
diff changeset
  1702
    "returns the directory the browser is open on
b4e8b1c4c2d6 initialRootDirectory: set to directory browser too
ca
parents: 6356
diff changeset
  1703
    "
b4e8b1c4c2d6 initialRootDirectory: set to directory browser too
ca
parents: 6356
diff changeset
  1704
    |root|
b4e8b1c4c2d6 initialRootDirectory: set to directory browser too
ca
parents: 6356
diff changeset
  1705
9678
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
  1706
    initialRoot isNil ifTrue:[
6409
b4e8b1c4c2d6 initialRootDirectory: set to directory browser too
ca
parents: 6356
diff changeset
  1707
9678
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
  1708
        (root := self directory) notNil ifTrue:[
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
  1709
            root := root asFilename.
6409
b4e8b1c4c2d6 initialRootDirectory: set to directory browser too
ca
parents: 6356
diff changeset
  1710
b4e8b1c4c2d6 initialRootDirectory: set to directory browser too
ca
parents: 6356
diff changeset
  1711
            root isDirectory ifFalse:[
9678
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
  1712
                root := root directory.
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
  1713
                root isDirectory ifFalse:[
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
  1714
                    root := nil.
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
  1715
                ]
6409
b4e8b1c4c2d6 initialRootDirectory: set to directory browser too
ca
parents: 6356
diff changeset
  1716
            ]
9678
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
  1717
        ].
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
  1718
        root isNil ifTrue:[
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
  1719
            root := Filename currentDirectory.
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
  1720
        ].
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
  1721
        initialRoot := root asAbsoluteFilename.
6409
b4e8b1c4c2d6 initialRootDirectory: set to directory browser too
ca
parents: 6356
diff changeset
  1722
    ].
9678
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
  1723
    ^ initialRoot
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
  1724
04cf959bfd96 cache initial root
Claus Gittinger <cg@exept.de>
parents: 9553
diff changeset
  1725
    "Modified: / 27-12-2010 / 09:56:30 / cg"
6409
b4e8b1c4c2d6 initialRootDirectory: set to directory browser too
ca
parents: 6356
diff changeset
  1726
!
b4e8b1c4c2d6 initialRootDirectory: set to directory browser too
ca
parents: 6356
diff changeset
  1727
5903
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1728
postBuildFileNameField:aWidget
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1729
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1730
    filenameField := aWidget.
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1731
!
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1732
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1733
postBuildFilterField:aWidget
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1734
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1735
    filterField := aWidget.
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1736
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1737
5903
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1738
postBuildTreeBrowser:aSubCanvasView
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1739
    treeBrowser := aSubCanvasView client.
6409
b4e8b1c4c2d6 initialRootDirectory: set to directory browser too
ca
parents: 6356
diff changeset
  1740
    treeBrowser rootHolder value:(self initialRootDirectory value).
9113
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1741
    treeBrowser sortPropertyInTree:(treeBrowser sortBlockProperty).
9553
5ff0056960d1 changed: #postBuildTreeBrowser:
sr
parents: 9514
diff changeset
  1742
    treeBrowser showHiddenFiles value:true.
5ff0056960d1 changed: #postBuildTreeBrowser:
sr
parents: 9514
diff changeset
  1743
5ff0056960d1 changed: #postBuildTreeBrowser:
sr
parents: 9514
diff changeset
  1744
    "Modified: / 24-08-2010 / 16:07:16 / sr"
5903
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1745
!
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1746
5903
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1747
postBuildWith:aBuilder    
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1748
    treeBrowser multipleSelect:multipleSelect.
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1749
    appendWasPressed := false.
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1750
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1751
    (aBuilder componentAt:'cancelButton') cursor:(Cursor thumbsDown).
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1752
    (aBuilder componentAt:'appendButton') cursor:(Cursor thumbsUp).
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1753
    (aBuilder componentAt:'okButton') cursor:(Cursor thumbsUp).
0c2fdcd6babf make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents: 5873
diff changeset
  1754
6632
ea16a307f70e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  1755
    super postBuildWith:aBuilder
5932
eea85a7af4b1 remark last extent
penk
parents: 5931
diff changeset
  1756
!
eea85a7af4b1 remark last extent
penk
parents: 5931
diff changeset
  1757
8182
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1758
postOpenAsSubcanvasWith:aBuilder
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1759
    super postOpenAsSubcanvasWith:aBuilder.
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1760
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1761
    "No ok and cancel buttons, when dialog is part of a larger dialog"
8191
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1762
    self hideButtonPanel.
8183
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1763
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1764
    "filenameHolder contains the initial file name"
8191
1779a8c3730d Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8183
diff changeset
  1765
    self startFilename:self filenameHolder value.
8183
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1766
    treeBrowser currentFileNameHolder value:(Array with:self filenameHolder value).
8182
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1767
!
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1768
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1769
postOpenWith:aBuilder
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1770
    |lastExtent|
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1771
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1772
    super postOpenWith:aBuilder.
8183
ff8c8d68267e Make reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8182
diff changeset
  1773
    treeBrowser currentFileNameHolder value:(OrderedCollection with:self startFilename).
8182
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1774
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1775
    lastExtent := self class lastExtent.
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1776
    lastExtent notNil ifTrue:[
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1777
        self window topView extent:lastExtent.
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1778
    ].
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1779
    self window label:self initialText.
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1780
!
4fd82dbf97b3 design for reusability
Stefan Vogel <sv@exept.de>
parents: 8169
diff changeset
  1781
5932
eea85a7af4b1 remark last extent
penk
parents: 5931
diff changeset
  1782
remarkExtent
eea85a7af4b1 remark last extent
penk
parents: 5931
diff changeset
  1783
    self class lastExtent:self window topView extent.
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1784
! !
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1785
9113
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1786
!FileDialog methodsFor:'menus'!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1787
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1788
bookmarksMenu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1789
    ^ treeBrowser bookmarksMenu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1790
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1791
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1792
directoryMenu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1793
self halt.
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1794
    ^ treeBrowser directoryMenu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1795
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1796
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1797
showMenuSpecForDialog
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1798
    ^ treeBrowser class showMenuSpecForDialog
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1799
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1800
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1801
sortMenu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1802
    ^ treeBrowser class sortInTreeMenu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1803
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1804
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1805
visitedDirectoriesMenu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1806
    ^ treeBrowser visitedDirectoriesMenu
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1807
! !
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1808
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1809
!FileDialog methodsFor:'private'!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1810
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1811
returnWasPressedInFilterField
8663
22e0a2969ab2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8661
diff changeset
  1812
    |wg ev|
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1813
8663
22e0a2969ab2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8661
diff changeset
  1814
    ((wg := self windowGroup) notNil
22e0a2969ab2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8661
diff changeset
  1815
    and:[ (ev := wg lastEvent) notNil 
22e0a2969ab2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8661
diff changeset
  1816
    and:[ ev isKeyEvent 
22e0a2969ab2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8661
diff changeset
  1817
    and:[ ev key == #Return
22e0a2969ab2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8661
diff changeset
  1818
    and:[ (ev targetView isSameOrComponentOf:filterField) 
22e0a2969ab2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8661
diff changeset
  1819
          or:[false "ev targetView isSameOrComponentOf:filenameField"]]]]]) ifTrue:[
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1820
        ^ true
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1821
    ].
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1822
    ^ false
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1823
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1824
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1825
returnWasPressedInFilterOrFilenameField
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1826
    |ev|
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1827
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1828
    ev := self windowGroup lastEvent.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1829
    (ev notNil 
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1830
    and:[ev isKeyEvent 
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1831
    and:[ev key == #Return
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1832
    and:[(   ev targetView isSameOrComponentOf:filterField) 
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1833
         or:[false "ev targetView isSameOrComponentOf:filenameField"]]]]) ifTrue:[
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1834
        ^ true
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1835
    ].
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1836
    ^ false
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1837
! !
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1838
6065
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1839
!FileDialog methodsFor:'queries'!
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1840
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1841
driveSelectorVisible
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1842
    ^ OperatingSystem isMSDOSlike
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1843
! !
500ec804b779 *** empty log message ***
penk
parents: 5982
diff changeset
  1844
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1845
!FileDialog methodsFor:'user actions'!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1846
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1847
appendPressed
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1848
    appendWasPressed := true.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1849
    self commonAcceptAction.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1850
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1851
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1852
commonAcceptAction
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1853
    filenameField accept.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1854
    self result:(self filenameHolder value asString).
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1855
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1856
    ^ super doAccept
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1857
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1858
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1859
doAccept
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1860
    "force accept - ignore in filterField"
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1861
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1862
    self returnWasPressedInFilterField ifTrue:[
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1863
        ^ self
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1864
    ].
4996
5927cc0508e8 close the editor in treebrowser on rename if ENTER is pressed
penk
parents: 4824
diff changeset
  1865
    treeBrowser hasOpenEditor ifTrue:[
5927cc0508e8 close the editor in treebrowser on rename if ENTER is pressed
penk
parents: 4824
diff changeset
  1866
        "/ have to send the event to the TreeView
5927cc0508e8 close the editor in treebrowser on rename if ENTER is pressed
penk
parents: 4824
diff changeset
  1867
        treeBrowser browser closeEditor.
5927cc0508e8 close the editor in treebrowser on rename if ENTER is pressed
penk
parents: 4824
diff changeset
  1868
        ^ self
5927cc0508e8 close the editor in treebrowser on rename if ENTER is pressed
penk
parents: 4824
diff changeset
  1869
    ].
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1870
    appendWasPressed := false.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1871
    self commonAcceptAction.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1872
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1873
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1874
doBack
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1875
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1876
    treeBrowser doBack.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1877
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1878
5966
a677b08c76c0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5949
diff changeset
  1879
doBrowseDirectory
a677b08c76c0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5949
diff changeset
  1880
    UserPreferences fileBrowserClass openOn:(treeBrowser currentDirectory ? treeBrowser rootHolder value).
a677b08c76c0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5949
diff changeset
  1881
a677b08c76c0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5949
diff changeset
  1882
a677b08c76c0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5949
diff changeset
  1883
!
a677b08c76c0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5949
diff changeset
  1884
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1885
doCancel
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1886
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1887
    self result:nil.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1888
    ^ super doCancel.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1889
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1890
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1891
doForward
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1892
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1893
    treeBrowser doForward.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1894
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1895
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1896
doGoDirectoryUp
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1897
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1898
    treeBrowser doGoDirectoryUp.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1899
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1900
8092
c75f44bd9e69 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 7919
diff changeset
  1901
doGotoDesktopDirectory
c75f44bd9e69 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 7919
diff changeset
  1902
c75f44bd9e69 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 7919
diff changeset
  1903
    treeBrowser doGotoDesktopDirectory.
c75f44bd9e69 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 7919
diff changeset
  1904
!
c75f44bd9e69 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 7919
diff changeset
  1905
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1906
doGotoHomeDirectory
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1907
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1908
    treeBrowser doGotoHomeDirectory.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1909
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1910
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1911
menuDirHistory:backOrForward
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1912
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1913
    ^ treeBrowser menuDirHistory:backOrForward.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1914
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1915
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1916
menuDirHistoryBack
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1917
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1918
    ^ treeBrowser menuDirHistory:#back.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1919
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1920
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1921
menuDirHistoryForward
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1922
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1923
    ^ treeBrowser menuDirHistory:#forward.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1924
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1925
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1926
newDirectory
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1927
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1928
    ^ treeBrowser newDirectory
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1929
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1930
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1931
okPressed
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1932
    self doAccept
9113
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1933
!
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1934
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1935
updateCurrentDirectory
c2f2d5819d28 menu, filters and sorting
Claus Gittinger <cg@exept.de>
parents: 9110
diff changeset
  1936
    treeBrowser updateCurrentDirectory
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1937
! !
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1938
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1939
!FileDialog class methodsFor:'documentation'!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1940
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1941
version
9683
83fb945b7a5a changed: #selectedDeviceDriveChanged
Claus Gittinger <cg@exept.de>
parents: 9678
diff changeset
  1942
    ^ '$Header: /cvs/stx/stx/libtool/FileDialog.st,v 1.112 2011-01-14 12:53:49 cg Exp $'
9110
9fcea22ea3b7 showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 8663
diff changeset
  1943
!
9fcea22ea3b7 showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 8663
diff changeset
  1944
9fcea22ea3b7 showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 8663
diff changeset
  1945
version_CVS
9683
83fb945b7a5a changed: #selectedDeviceDriveChanged
Claus Gittinger <cg@exept.de>
parents: 9678
diff changeset
  1946
    ^ '$Header: /cvs/stx/stx/libtool/FileDialog.st,v 1.112 2011-01-14 12:53:49 cg Exp $'
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1947
! !