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