FileDialog.st
author penk
Fri, 12 Sep 2003 17:29:07 +0200
changeset 5173 66787858b06a
parent 5163 7923e3b781bd
child 5188 283a77f6efe2
permissions -rw-r--r--
open on not existing default directories
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
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    12
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    13
"{ Package: 'stx:libtool' }"
321c1729db5b initial checkin
penk
parents:
diff changeset
    14
321c1729db5b initial checkin
penk
parents:
diff changeset
    15
SimpleDialog subclass:#FileDialog
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    16
	instanceVariableNames:'aspects treeBrowser directory pattern filterHolder initialText
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    17
		multipleSelect doubleClickAction cancelLabelHolder okLabelHolder
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    18
		startFilename result filterField filenameField viewFiles
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    19
		filenameLabelHolder isLoadDialog newDirectoryVisibilityHolder
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    20
		appendButtonVisibleHolder appendWasPressed
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
    21
		buttonPanelVisibleHolder'
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    22
	classVariableNames:''
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    23
	poolDictionaries:''
321c1729db5b initial checkin
penk
parents:
diff changeset
    24
	category:'Interface-Tools-File'
321c1729db5b initial checkin
penk
parents:
diff changeset
    25
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    26
321c1729db5b initial checkin
penk
parents:
diff changeset
    27
!FileDialog class methodsFor:'documentation'!
321c1729db5b initial checkin
penk
parents:
diff changeset
    28
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    29
copyright
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    30
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    31
 COPYRIGHT (c) 2002 by eXept Software AG
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    32
              All Rights Reserved
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    33
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    34
 This software is furnished under a license and may be used
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    35
 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
    36
 inclusion of the above copyright notice.   This software may not
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    37
 be provided or otherwise made available to, or used by, any
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    38
 other person.  No title to or ownership of the software is
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    39
 hereby transferred.
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
    40
"
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
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    43
documentation
321c1729db5b initial checkin
penk
parents:
diff changeset
    44
"
321c1729db5b initial checkin
penk
parents:
diff changeset
    45
    documentation to be added.
321c1729db5b initial checkin
penk
parents:
diff changeset
    46
321c1729db5b initial checkin
penk
parents:
diff changeset
    47
    [author:]
321c1729db5b initial checkin
penk
parents:
diff changeset
    48
        Martin Walser (martin@vercingetorix)
321c1729db5b initial checkin
penk
parents:
diff changeset
    49
321c1729db5b initial checkin
penk
parents:
diff changeset
    50
    [instance variables:]
321c1729db5b initial checkin
penk
parents:
diff changeset
    51
321c1729db5b initial checkin
penk
parents:
diff changeset
    52
    [class variables:]
321c1729db5b initial checkin
penk
parents:
diff changeset
    53
321c1729db5b initial checkin
penk
parents:
diff changeset
    54
    [see also:]
321c1729db5b initial checkin
penk
parents:
diff changeset
    55
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
examples
321c1729db5b initial checkin
penk
parents:
diff changeset
    60
"
321c1729db5b initial checkin
penk
parents:
diff changeset
    61
  Starting the application:
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]
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    67
     FileDialog 
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    68
        requestFileName:'enter a fileName:'
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    69
        default:''
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    70
        version:nil
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    71
        ifFail:['none']
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    72
        pattern:'*.conf'
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    73
        fromDirectory:'/etc'
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    74
        whenBoxCreatedEvaluate:nil.
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    75
                                                                [exEnd]
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    76
                                                                [exBegin]
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    77
    |fd|
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    78
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    79
    fd := FileDialog new.
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    80
    fd multipleSelect:true.
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
    81
    fd open
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    82
                                                                [exEnd]
321c1729db5b initial checkin
penk
parents:
diff changeset
    83
"
5062
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    84
!
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    85
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    86
todo
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    87
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    88
"
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    89
    - make the filedialog windows like f
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    90
      filename entry field shows only the filename not the whole directory 
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    91
      the tree allways starts in currrent directory
dc8526b353f7 add a todo list
penk
parents: 5039
diff changeset
    92
      the parent tree is shown in a compobox where the perents are selectable
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
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   122
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
   123
    "same as requestFileName, but only show directories"
321c1729db5b initial checkin
penk
parents:
diff changeset
   124
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   125
    |enteredFileName instance enteredFileNameString|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   126
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   127
    instance := self    
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   128
        startApplicationFor:titleString 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   129
        default:aFileName 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   130
        ok:okText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   131
        abort:abortText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   132
        ifFail:failBlock 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   133
        pattern:pattern 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   134
        fromDirectory:aDirectoryPath 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   135
        whenBoxCreatedEvaluate:boxCreatedCallback
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   136
        asLoadDialog:aBoolean
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   137
        forDirectory:true
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   138
        multipleSelect:false.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   139
321c1729db5b initial checkin
penk
parents:
diff changeset
   140
    enteredFileNameString := instance result.
321c1729db5b initial checkin
penk
parents:
diff changeset
   141
    enteredFileNameString isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   142
        ^ failBlock value
321c1729db5b initial checkin
penk
parents:
diff changeset
   143
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   144
    enteredFileName := enteredFileNameString asFilename.
321c1729db5b initial checkin
penk
parents:
diff changeset
   145
    enteredFileNameString := enteredFileName asString.
321c1729db5b initial checkin
penk
parents:
diff changeset
   146
    (enteredFileName notNil 
321c1729db5b initial checkin
penk
parents:
diff changeset
   147
    and:[enteredFileNameString notEmpty]) ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   148
        versionSymbol isNil ifTrue:[ ^ enteredFileNameString].
321c1729db5b initial checkin
penk
parents:
diff changeset
   149
        versionSymbol == #mustBeNew ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   150
            "/ file may not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   151
            enteredFileName exists ifTrue:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   152
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   153
        versionSymbol == #new ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   154
            "/ file may not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   155
            enteredFileName exists ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   156
                (Dialog confirm:(self classResources string:'''%1'' exists.\\Continue anyway ?' with:enteredFileNameString) withCRs)
321c1729db5b initial checkin
penk
parents:
diff changeset
   157
                    ifFalse:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   158
            ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   159
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   160
        versionSymbol == #mustBeOld ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   161
            enteredFileName exists ifFalse:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   162
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   163
        versionSymbol == #old ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   164
            "/ file may not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   165
            enteredFileName exists ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   166
                (self confirm:(self classResources string:'''%1'' does not exist yet.\\Continue anyway ?' with:enteredFileNameString) withCRs)
321c1729db5b initial checkin
penk
parents:
diff changeset
   167
                ifFalse:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   168
            ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   169
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   170
        FileSelectionBox lastFileSelectionDirectory:(enteredFileNameString).
321c1729db5b initial checkin
penk
parents:
diff changeset
   171
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   172
    ^ enteredFileNameString
321c1729db5b initial checkin
penk
parents:
diff changeset
   173
321c1729db5b initial checkin
penk
parents:
diff changeset
   174
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   175
     FileDialog
321c1729db5b initial checkin
penk
parents:
diff changeset
   176
        requestDirectoryName:'which directory ?' 
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   177
        default:Filename currentDirectory pathName
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   178
        ifFail:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   179
    "
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   180
    "
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   181
     FileDialog
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   182
        requestDirectoryName:'which directory ?' 
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   183
        default:Filename currentDirectory pathName 
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   184
        ok:nil
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   185
        abort:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   186
        version:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   187
        pattern:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   188
        fromDirectory:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   189
        ifFail:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   190
        whenBoxCreatedEvaluate:nil
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   191
        asLoadDialog:true
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   192
    "
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   193
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   194
321c1729db5b initial checkin
penk
parents:
diff changeset
   195
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil whenBoxCreatedEvaluate:boxCreatedCallback
321c1729db5b initial checkin
penk
parents:
diff changeset
   196
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   197
    ^ self  
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   198
        requestFileName:titleString 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   199
        default:defaultName 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   200
        ok:okText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   201
        abort:abortText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   202
        version:nil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   203
        ifFail:nil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   204
        pattern:pattern 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   205
        fromDirectory:aDirectoryPathOrNil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   206
        whenBoxCreatedEvaluate:boxCreatedCallback
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   207
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   208
321c1729db5b initial checkin
penk
parents:
diff changeset
   209
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
   210
    "launch a Dialog, which allows user to enter a filename.
321c1729db5b initial checkin
penk
parents:
diff changeset
   211
     The files presented initially are those in aDirectoryPathOrNil, or the
321c1729db5b initial checkin
penk
parents:
diff changeset
   212
     last fileBox directory (default: current directory) (if a nil path is given).
321c1729db5b initial checkin
penk
parents:
diff changeset
   213
     The box will show okText in its okButton, abortText in the abortButton.
321c1729db5b initial checkin
penk
parents:
diff changeset
   214
     The matchPattern is set to pattern initially.
321c1729db5b initial checkin
penk
parents:
diff changeset
   215
     Return the string, or nil if cancel was pressed
321c1729db5b initial checkin
penk
parents:
diff changeset
   216
     The version argument allows validation of the files existance;
321c1729db5b initial checkin
penk
parents:
diff changeset
   217
     it may be any of:
321c1729db5b initial checkin
penk
parents:
diff changeset
   218
        #mustBeNew      - fail (return empty string) if the file exists
321c1729db5b initial checkin
penk
parents:
diff changeset
   219
        #new            - confirm if the file exists
321c1729db5b initial checkin
penk
parents:
diff changeset
   220
        #mustBeOld      - fail if the file does not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   221
        #old            - confirm if the file does not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   222
        #any (other)    - no validation
321c1729db5b initial checkin
penk
parents:
diff changeset
   223
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   224
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   225
    ^ self  
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   226
        requestFileName:titleString 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   227
        default:defaultName 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   228
        ok:okText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   229
        abort:abortText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   230
        version:versionSymbol 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   231
        ifFail:failBlock 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   232
        pattern:pattern 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   233
        fromDirectory:aDirectoryPath 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   234
        whenBoxCreatedEvaluate:boxCreatedCallback 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   235
        asLoadDialog:nil
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   236
!
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   237
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   238
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
   239
    "launch a Dialog, which allows user to enter a filename.
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   240
     The files presented initially are those in aDirectoryPathOrNil, or the
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   241
     last fileBox directory (default: current directory) (if a nil path is given).
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   242
     The box will show okText in its okButton, abortText in the abortButton.
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   243
     The matchPattern is set to pattern initially.
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   244
     Return the string, or nil if cancel was pressed
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   245
     The version argument allows validation of the files existance;
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   246
     it may be any of:
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   247
        #mustBeNew      - fail (return empty string) if the file exists
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   248
        #new            - confirm if the file exists
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   249
        #mustBeOld      - fail if the file does not exist
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   250
        #old            - confirm if the file does not exist
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   251
        #any (other)    - no validation
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   252
    "
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   253
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   254
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   255
    | instance enteredFileName enteredFileNameString|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   256
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   257
    instance := self    
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   258
        startApplicationFor:titleString 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   259
        default:defaultName 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   260
        ok:okText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   261
        abort:abortText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   262
        ifFail:failBlock 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   263
        pattern:pattern 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   264
        fromDirectory:aDirectoryPath 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   265
        whenBoxCreatedEvaluate:boxCreatedCallback
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   266
        asLoadDialog:aBoolean
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   267
        forDirectory:false
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   268
        multipleSelect:false.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   269
321c1729db5b initial checkin
penk
parents:
diff changeset
   270
    enteredFileNameString := instance result.
3938
cc381aba7134 for empty string do fail action
penk
parents: 3923
diff changeset
   271
    (enteredFileNameString isNil or:[enteredFileNameString isEmpty]) ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   272
        ^ failBlock value
321c1729db5b initial checkin
penk
parents:
diff changeset
   273
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   274
    enteredFileName := enteredFileNameString asFilename.
321c1729db5b initial checkin
penk
parents:
diff changeset
   275
    enteredFileNameString := enteredFileName asString.
4666
2775d69bc8be accept return in fileName field
martin
parents: 4627
diff changeset
   276
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   277
    (enteredFileName notNil 
321c1729db5b initial checkin
penk
parents:
diff changeset
   278
    and:[enteredFileNameString notEmpty]) ifTrue:[
4666
2775d69bc8be accept return in fileName field
martin
parents: 4627
diff changeset
   279
        FileSelectionBox lastFileSelectionDirectory:(enteredFileName directoryName).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   280
        versionSymbol isNil ifTrue:[ ^ enteredFileNameString].
321c1729db5b initial checkin
penk
parents:
diff changeset
   281
        versionSymbol == #mustBeNew ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   282
            "/ file may not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   283
            enteredFileName exists ifTrue:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   284
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   285
        versionSymbol == #new ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   286
            "/ file may not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   287
            enteredFileName exists ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   288
                (Dialog confirm:(self classResources string:'''%1'' exists.\\Continue anyway ?' with:enteredFileNameString) withCRs)
321c1729db5b initial checkin
penk
parents:
diff changeset
   289
                    ifFalse:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   290
            ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   291
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   292
        versionSymbol == #mustBeOld ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   293
            enteredFileName exists ifFalse:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   294
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   295
        versionSymbol == #old ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   296
            "/ file may not exist
321c1729db5b initial checkin
penk
parents:
diff changeset
   297
            enteredFileName exists ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   298
                (self confirm:(self classResources string:'''%1'' does not exist yet.\\Continue anyway ?' with:enteredFileNameString) withCRs)
321c1729db5b initial checkin
penk
parents:
diff changeset
   299
                ifFalse:[^ ''].
321c1729db5b initial checkin
penk
parents:
diff changeset
   300
            ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   301
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   302
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   303
    ^ enteredFileNameString
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   304
"
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   305
     FileDialog 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   306
        requestFileName:'enter a fileName:'
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   307
        default:''
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   308
        ok:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   309
        abort:nil
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   310
        version:nil
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   311
        ifFail:['none']
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   312
        pattern:'*.conf'
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   313
        fromDirectory:Filename currentDirectory pathName
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   314
        whenBoxCreatedEvaluate:nil
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   315
        asLoadDialog:true
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   316
"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   317
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   318
321c1729db5b initial checkin
penk
parents:
diff changeset
   319
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPathOrNil whenBoxCreatedEvaluate:boxCreatedCallback
321c1729db5b initial checkin
penk
parents:
diff changeset
   320
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   321
    ^ self  
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   322
        requestFileName:titleString 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   323
        default:defaultName 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   324
        ok:nil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   325
        abort:nil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   326
        version:versionSymbol 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   327
        ifFail:failBlock 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   328
        pattern:pattern 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   329
        fromDirectory:aDirectoryPathOrNil 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   330
        whenBoxCreatedEvaluate:boxCreatedCallback
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   331
321c1729db5b initial checkin
penk
parents:
diff changeset
   332
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   333
     FileDialog 
321c1729db5b initial checkin
penk
parents:
diff changeset
   334
        requestFileName:'enter a fileName:'
321c1729db5b initial checkin
penk
parents:
diff changeset
   335
        default:''
321c1729db5b initial checkin
penk
parents:
diff changeset
   336
        version:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   337
        ifFail:['none']
321c1729db5b initial checkin
penk
parents:
diff changeset
   338
        pattern:'*.conf'
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   339
        fromDirectory:Filename currentDirectory pathName
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   340
        whenBoxCreatedEvaluate:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
   341
     Dialog 
321c1729db5b initial checkin
penk
parents:
diff changeset
   342
        requestFileName:'enter a fileName:'
321c1729db5b initial checkin
penk
parents:
diff changeset
   343
        default:''
321c1729db5b initial checkin
penk
parents:
diff changeset
   344
        version:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   345
        ifFail:['none']
321c1729db5b initial checkin
penk
parents:
diff changeset
   346
        pattern:'*.conf'
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   347
        fromDirectory:Filename currentDirectory pathName
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   348
        whenBoxCreatedEvaluate:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   349
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   350
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   351
     FileDialog
321c1729db5b initial checkin
penk
parents:
diff changeset
   352
        requestFileName:'enter a fileName:'
321c1729db5b initial checkin
penk
parents:
diff changeset
   353
        default:''
321c1729db5b initial checkin
penk
parents:
diff changeset
   354
        version:#old 
321c1729db5b initial checkin
penk
parents:
diff changeset
   355
        ifFail:['none']   
321c1729db5b initial checkin
penk
parents:
diff changeset
   356
        pattern:'*.conf'
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   357
        fromDirectory:Filename currentDirectory pathName
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   358
        whenBoxCreatedEvaluate:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   359
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   360
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   361
     FileDialog
321c1729db5b initial checkin
penk
parents:
diff changeset
   362
        requestFileName:'enter a fileName:'
321c1729db5b initial checkin
penk
parents:
diff changeset
   363
        default:''
321c1729db5b initial checkin
penk
parents:
diff changeset
   364
        version:#mustBeNew 
321c1729db5b initial checkin
penk
parents:
diff changeset
   365
        ifFail:['none']   
321c1729db5b initial checkin
penk
parents:
diff changeset
   366
        pattern:'*.conf'
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   367
        fromDirectory:Filename currentDirectory pathName
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   368
        whenBoxCreatedEvaluate:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   369
    "
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   370
!
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   371
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   372
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
   373
    "launch a Dialog, which allows user to enter a filename.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   374
     The files presented initially are those in aDirectoryPathOrNil, or the
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   375
     last fileBox directory (default: current directory) (if a nil path is given).
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   376
     The box will show okText in its okButton, abortText in the abortButton.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   377
     The matchPattern is set to pattern initially.
3905
2a1afd0fdcd3 add requestFilenames method
penk
parents: 3904
diff changeset
   378
     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
   379
    "
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   380
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   381
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   382
    ^ self  
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   383
        requestFileNames:titleString 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   384
        default:defaultName 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   385
        ok:okText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   386
        abort:abortText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   387
        ifFail:failBlock 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   388
        pattern:pattern 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   389
        fromDirectory:aDirectoryPath 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   390
        whenBoxCreatedEvaluate:boxCreatedCallback 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   391
        asLoadDialog:nil.
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   392
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   393
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   394
"
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   395
     FileDialog 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   396
        requestFileNames:'enter a fileName:'
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   397
        default:''
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   398
        ok:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   399
        abort:nil 
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   400
        ifFail:['none']
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   401
        pattern:'*.conf'
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   402
        fromDirectory:Filename currentDirectory pathName
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   403
        whenBoxCreatedEvaluate:nil.
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   404
"
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   405
!
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   406
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   407
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
   408
    "launch a Dialog, which allows user to enter a filename.
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   409
     The files presented initially are those in aDirectoryPathOrNil, or the
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   410
     last fileBox directory (default: current directory) (if a nil path is given).
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   411
     The box will show okText in its okButton, abortText in the abortButton.
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   412
     The matchPattern is set to pattern initially.
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   413
     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
   414
    "
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   415
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   416
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   417
    | instance enteredFileNames lastDirectory|
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   418
4795
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   419
    instance := self    
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   420
        startApplicationFor:titleString 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   421
        default:defaultName 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   422
        ok:okText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   423
        abort:abortText 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   424
        ifFail:failBlock 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   425
        pattern:pattern 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   426
        fromDirectory:aDirectoryPath 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   427
        whenBoxCreatedEvaluate:boxCreatedCallback
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   428
        asLoadDialog:asLoadDialog 
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   429
        forDirectory:false
86443bbe1451 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4793
diff changeset
   430
        multipleSelect:true.
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   431
3996
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
   432
    enteredFileNames := instance currentSelectedFiles.
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   433
    (enteredFileNames isEmpty or:[instance result isNil]) ifTrue:[
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   434
        ^ failBlock value
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   435
    ].
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   436
    lastDirectory := enteredFileNames first.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   437
    lastDirectory := lastDirectory isFilename ifTrue:[lastDirectory directory] ifFalse:[lastDirectory].
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   438
    FileSelectionBox lastFileSelectionDirectory:(lastDirectory directoryName).
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   439
    ^ enteredFileNames
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   440
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   441
"
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   442
     FileDialog 
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   443
        requestFileNames:'enter a fileName:'
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   444
        default:''
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   445
        ok:nil 
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   446
        abort:nil 
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   447
        ifFail:['none']
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   448
        pattern:'*.conf'
4627
856a643c7854 fix for windows
penk
parents: 4603
diff changeset
   449
        fromDirectory:Filename currentDirectory pathName
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   450
        whenBoxCreatedEvaluate:nil
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   451
        asLoadDialog:true.
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   452
"
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   453
!
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   454
5163
7923e3b781bd oops - nil button labels
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   455
startApplicationFor:titleString default:aFileName ok:okTextArg abort:abortTextArg ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:asLoadDialog forDirectory:forDirectory multipleSelect:multipleSelect
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   456
    "launch a Dialog, which allows user to enter a filename.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   457
     The files presented initially are those in aDirectoryPathOrNil, or the
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   458
     last fileBox directory (default: current directory) (if a nil path is given).
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   459
     The box will show okText in its okButton, abortText in the abortButton.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   460
     The matchPattern is set to pattern initially.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   461
     Return the string, or nil if cancel was pressed
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   462
     The version argument allows validation of the files existance;
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   463
     it may be any of:
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   464
        #mustBeNew      - fail (return empty string) if the file exists
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   465
        #new            - confirm if the file exists
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   466
        #mustBeOld      - fail if the file does not exist
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   467
        #old            - confirm if the file does not exist
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   468
        #any (other)    - no validation
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   469
    "
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   470
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   471
5163
7923e3b781bd oops - nil button labels
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   472
    |defaultDir defaultNm instance defaultFile locFilename okText abortText|
7923e3b781bd oops - nil button labels
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   473
7923e3b781bd oops - nil button labels
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   474
    okText := okTextArg.
7923e3b781bd oops - nil button labels
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   475
    okText isNil ifTrue:[ okText := self resources string:'OK' ]. 
7923e3b781bd oops - nil button labels
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   476
    abortText := abortTextArg.
7923e3b781bd oops - nil button labels
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   477
    abortText isNil ifTrue:[ abortText := self resources string:'Cancel' ]. 
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   478
4539
845e4e692dbf *** empty log message ***
penk
parents: 4206
diff changeset
   479
    locFilename := aFileName.
845e4e692dbf *** empty log message ***
penk
parents: 4206
diff changeset
   480
    defaultNm := locFilename.
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   481
    defaultDir := aDirectoryPath.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   482
    defaultDir isNil ifTrue:[
5173
66787858b06a open on not existing default directories
penk
parents: 5163
diff changeset
   483
        (defaultNm notNil and:[defaultNm asFilename exists]) ifTrue:[
4539
845e4e692dbf *** empty log message ***
penk
parents: 4206
diff changeset
   484
            defaultDir := locFilename asFilename asAbsoluteFilename directory.
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   485
        ] ifFalse:[
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   486
            defaultDir := FileSelectionBox lastFileSelectionDirectory.
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   487
            defaultDir isNil ifTrue:[
4539
845e4e692dbf *** empty log message ***
penk
parents: 4206
diff changeset
   488
                defaultDir := Filename currentDirectory asAbsoluteFilename.        
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   489
            ].
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   490
        ]
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   491
    ].
4206
ebbc6f79a43d defaultDir asAbsoluteFilename
penk
parents: 4175
diff changeset
   492
    defaultDir := defaultDir asFilename asAbsoluteFilename.
5066
57de46852214 Do not select '/tmp/tmp' if '/tmp' is given as default directory
Stefan Vogel <sv@exept.de>
parents: 5062
diff changeset
   493
    [defaultDir exists] whileFalse:[
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   494
        defaultDir := defaultDir directory.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   495
    ].
5066
57de46852214 Do not select '/tmp/tmp' if '/tmp' is given as default directory
Stefan Vogel <sv@exept.de>
parents: 5062
diff changeset
   496
57de46852214 Do not select '/tmp/tmp' if '/tmp' is given as default directory
Stefan Vogel <sv@exept.de>
parents: 5062
diff changeset
   497
    forDirectory ifTrue:[
57de46852214 Do not select '/tmp/tmp' if '/tmp' is given as default directory
Stefan Vogel <sv@exept.de>
parents: 5062
diff changeset
   498
        defaultFile := (locFilename ? defaultDir) asFilename asAbsoluteFilename.
57de46852214 Do not select '/tmp/tmp' if '/tmp' is given as default directory
Stefan Vogel <sv@exept.de>
parents: 5062
diff changeset
   499
    ] ifFalse:[
4539
845e4e692dbf *** empty log message ***
penk
parents: 4206
diff changeset
   500
        (locFilename notNil and:[locFilename asFilename withoutSuffix baseName ~= '*']) ifTrue:[
5066
57de46852214 Do not select '/tmp/tmp' if '/tmp' is given as default directory
Stefan Vogel <sv@exept.de>
parents: 5062
diff changeset
   501
            defaultFile := defaultDir construct:locFilename asFilename baseName.
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   502
        ].
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   503
    ].
4562
967b5b5a8519 *** empty log message ***
penk
parents: 4539
diff changeset
   504
    defaultFile isNil ifTrue:[
967b5b5a8519 *** empty log message ***
penk
parents: 4539
diff changeset
   505
        defaultFile := defaultDir.
967b5b5a8519 *** empty log message ***
penk
parents: 4539
diff changeset
   506
    ].
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   507
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   508
    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
   509
    defaultDir notNil ifTrue:[instance directory:defaultDir].
3958
39364b0202cf fileDialog multiple select changes
penk
parents: 3956
diff changeset
   510
    instance multipleSelect:multipleSelect ? false.
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   511
    instance startFilename:defaultFile.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   512
    instance pattern:((pattern isNil or:[pattern isEmpty]) ifTrue:['*'] ifFalse:[pattern]).
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   513
    instance initialText:titleString.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   514
    instance okLabelHolder value:okText.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   515
    instance cancelLabelHolder value:abortText.
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   516
    instance beLoadDialog:asLoadDialog ? false.
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   517
    instance viewFiles:(forDirectory isNil ifTrue:[true] ifFalse:[forDirectory not]).
3953
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   518
    self setDoubleClickActionFor:instance.
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   519
    instance allButOpenInterface:#windowSpec.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   520
    boxCreatedCallback notNil ifTrue:[boxCreatedCallback value:instance].
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   521
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   522
    Dialog aboutToOpenBoxNotificationSignal raiseRequestWith:instance.
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   523
    instance openWindowModal.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   524
    ^ instance
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   525
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   526
321c1729db5b initial checkin
penk
parents:
diff changeset
   527
!FileDialog class methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   528
3953
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   529
setDoubleClickActionFor:instance
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   530
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   531
    instance doubleClickAction:[:anIndex|
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   532
        | item |
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   533
        item := instance treeBrowser fileList at:anIndex ifAbsent:nil.
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   534
        item notNil ifTrue:[
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   535
            ((instance viewFiles and:[item isDirectory not]) or:[instance viewFiles not]) ifTrue:[
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   536
                instance doAccept.
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   537
            ]
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   538
        ]
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
   539
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   540
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   541
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   542
!FileDialog class methodsFor:'active help'!
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   543
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   544
flyByHelpSpec
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   545
    <resource: #help>
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   546
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   547
    |spec hist|
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   548
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   549
    spec := super flyByHelpSpec addPairsFrom:#(
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   550
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   551
#directoryUp
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   552
'Directory Up'
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   553
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   554
#directoryBack
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   555
'Directory Back'
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   556
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   557
#directoryForward
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   558
'Directory Forward'
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   559
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   560
#directoryHistory
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   561
'Directory'
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   562
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   563
#fileHome
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   564
'Home Directory'
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   565
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   566
#fileGotoDefault
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   567
'Default Directory (ST/X Start Directory)'
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   568
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   569
#fileHistory
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   570
'File History'
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   571
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   572
).
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   573
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   574
"/    hist := self directoryHistory.
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   575
"/    hist notNil ifTrue:[
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   576
"/        hist canForward ifTrue:[
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   577
"/            spec at:#directoryForward put:(self classResources string:'Forward to: %1' with:hist nextForwardItem).
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   578
"/        ].
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   579
"/        hist canBackward ifTrue:[
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   580
"/            spec at:#directoryBack put:(self classResources string:'Back to: %1' with:hist nextBackwardItem).
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   581
"/        ].
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   582
"/    ].
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   583
    ^ spec.
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   584
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   585
    "
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   586
     self flyByHelpSpec
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   587
    "
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   588
! !
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   589
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   590
!FileDialog class methodsFor:'interface specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   591
321c1729db5b initial checkin
penk
parents:
diff changeset
   592
windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   593
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
   594
     by the UIPainter of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
   595
321c1729db5b initial checkin
penk
parents:
diff changeset
   596
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
   597
     the UIPainter may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
   598
321c1729db5b initial checkin
penk
parents:
diff changeset
   599
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   600
     UIPainter new openOnClass:FileDialog andSelector:#windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   601
     FileDialog new openInterface:#windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   602
     FileDialog open
321c1729db5b initial checkin
penk
parents:
diff changeset
   603
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   604
321c1729db5b initial checkin
penk
parents:
diff changeset
   605
    <resource: #canvas>
321c1729db5b initial checkin
penk
parents:
diff changeset
   606
321c1729db5b initial checkin
penk
parents:
diff changeset
   607
    ^ 
321c1729db5b initial checkin
penk
parents:
diff changeset
   608
     #(#FullSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   609
        #name: #windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   610
        #window: 
321c1729db5b initial checkin
penk
parents:
diff changeset
   611
       #(#WindowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   612
          #label: 'FileDialog'
321c1729db5b initial checkin
penk
parents:
diff changeset
   613
          #name: 'FileDialog'
321c1729db5b initial checkin
penk
parents:
diff changeset
   614
          #min: #(#Point 10 10)
321c1729db5b initial checkin
penk
parents:
diff changeset
   615
          #max: #(#Point 1024 768)
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   616
          #bounds: #(#Rectangle 16 46 416 446)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   617
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
   618
        #component: 
321c1729db5b initial checkin
penk
parents:
diff changeset
   619
       #(#SpecCollection
321c1729db5b initial checkin
penk
parents:
diff changeset
   620
          #collection: #(
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   621
           #(#ViewSpec
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   622
              #name: 'FilePart'
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   623
              #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -40 1.0)
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   624
              #component: 
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   625
             #(#SpecCollection
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   626
                #collection: #(
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   627
                 #(#MenuPanelSpec
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   628
                    #name: 'ToolBar1'
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   629
                    #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 30 0)
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   630
                    #tabable: true
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   631
                    #menu: #toolBarMenu
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   632
                    #textDefault: true
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   633
                  )
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   634
                 #(#SubCanvasSpec
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   635
                    #name: 'DirectoryTreeBrowser'
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   636
                    #layout: #(#LayoutFrame 0 0.0 55 0 0 1.0 -60 1)
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   637
                    #tabable: true
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   638
                    #hasHorizontalScrollBar: false
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   639
                    #hasVerticalScrollBar: false
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   640
                    #majorKey: #DirectoryTreeBrowser
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   641
                    #createNewApplication: true
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   642
                    #createNewBuilder: true
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   643
                    #postBuildCallback: #postBuildTreeBrowser:
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   644
                  )
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   645
                 #(#LabelSpec
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   646
                    #label: 'Filename:'
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   647
                    #name: 'FilenameLabel'
4729
d2367ffbe952 fixed: Layout
tm
parents: 4728
diff changeset
   648
                    #layout: #(#LayoutFrame 3 0 -50 1 73 0 -30 1)
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   649
                    #translateLabel: true
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   650
                    #labelChannel: #filenameLabelHolder
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   651
                    #adjust: #left
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   652
                  )
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   653
                 #(#FilenameInputFieldSpec
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   654
                    #name: 'FilenameEntryField'
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   655
                    #layout: #(#LayoutFrame 70 0 -50 1 -2 1 -30 1)
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   656
                    #tabable: true
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   657
                    #model: #filenameHolder
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   658
                    #immediateAccept: false
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   659
                    #acceptOnPointerLeave: false
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   660
                    #postBuildCallback: #postBuildFileNameField:
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   661
                  )
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   662
                 #(#VariableHorizontalPanelSpec
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   663
                    #name: 'VariableHorizontalPanel1'
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   664
                    #layout: #(#LayoutFrame 0 0 30 0 0 1 55 0)
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   665
                    #level: 1
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   666
                    #showHandle: false
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   667
                    #barLevel: 0
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   668
                    #component: 
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   669
                   #(#SpecCollection
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   670
                      #collection: #(
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   671
                       #(#ViewSpec
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   672
                          #name: 'Box1'
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   673
                        )
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   674
                       #(#ViewSpec
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   675
                          #name: 'Box2'
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   676
                          #component: 
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   677
                         #(#SpecCollection
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   678
                            #collection: #(
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   679
                             #(#LabelSpec
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   680
                                #label: 'Filter:'
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   681
                                #name: 'FilterLabel'
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   682
                                #layout: #(#LayoutFrame 8 0 2 0 59 0 -2 1)
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   683
                                #translateLabel: true
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   684
                                #adjust: #right
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   685
                              )
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   686
                             #(#InputFieldSpec
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   687
                                #name: 'FilterEntryField'
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   688
                                #layout: #(#LayoutFrame 60 0 -22 1 -2 1 -2 1)
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   689
                                #model: #filterHolder
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   690
                                #immediateAccept: true
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   691
                                #acceptOnReturn: true
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   692
                                #acceptOnTab: true
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   693
                                #acceptOnLostFocus: true
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   694
                                #acceptOnPointerLeave: false
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   695
                                #postBuildCallback: #postBuildFilterField:
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   696
                              )
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   697
                             )
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   698
                           
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   699
                          )
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   700
                        )
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   701
                       )
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   702
                     
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   703
                    )
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   704
                    #handles: #(#Any 0.5 1.0)
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   705
                  )
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   706
                 )
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   707
               
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   708
              )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   709
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
   710
           #(#HorizontalPanelViewSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   711
              #name: 'ButtonPanel'
321c1729db5b initial checkin
penk
parents:
diff changeset
   712
              #layout: #(#LayoutFrame 0 0.0 -40 1 0 1 0 1)
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   713
              #visibilityChannel: #buttonPanelVisibleHolder
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   714
              #horizontalLayout: #fitSpace
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   715
              #verticalLayout: #center
321c1729db5b initial checkin
penk
parents:
diff changeset
   716
              #horizontalSpace: 3
321c1729db5b initial checkin
penk
parents:
diff changeset
   717
              #verticalSpace: 3
321c1729db5b initial checkin
penk
parents:
diff changeset
   718
              #reverseOrderIfOKAtLeft: true
321c1729db5b initial checkin
penk
parents:
diff changeset
   719
              #component: 
321c1729db5b initial checkin
penk
parents:
diff changeset
   720
             #(#SpecCollection
321c1729db5b initial checkin
penk
parents:
diff changeset
   721
                #collection: #(
321c1729db5b initial checkin
penk
parents:
diff changeset
   722
                 #(#ActionButtonSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   723
                    #label: 'Cancel'
321c1729db5b initial checkin
penk
parents:
diff changeset
   724
                    #name: 'cancelButton'
321c1729db5b initial checkin
penk
parents:
diff changeset
   725
                    #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
   726
                    #labelChannel: #cancelLabelHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
   727
                    #tabable: true
321c1729db5b initial checkin
penk
parents:
diff changeset
   728
                    #model: #doCancel
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   729
                    #extent: #(#Point 129 21)
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   730
                  )
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   731
                 #(#ActionButtonSpec
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   732
                    #label: 'Append'
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   733
                    #name: 'appendButton'
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   734
                    #visibilityChannel: #appendButtonVisibleHolder
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   735
                    #translateLabel: true
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   736
                    #labelChannel: #appendLabelHolder
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   737
                    #tabable: true
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   738
                    #model: #appendPressed
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   739
                    #extent: #(#Point 129 22)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   740
                  )
321c1729db5b initial checkin
penk
parents:
diff changeset
   741
                 #(#ActionButtonSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   742
                    #label: 'OK'
321c1729db5b initial checkin
penk
parents:
diff changeset
   743
                    #name: 'okButton'
321c1729db5b initial checkin
penk
parents:
diff changeset
   744
                    #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
   745
                    #labelChannel: #okLabelHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
   746
                    #tabable: true
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   747
                    #model: #okPressed
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   748
                    #isDefault: true
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   749
                    #extent: #(#Point 130 22)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   750
                  )
321c1729db5b initial checkin
penk
parents:
diff changeset
   751
                 )
321c1729db5b initial checkin
penk
parents:
diff changeset
   752
               
321c1729db5b initial checkin
penk
parents:
diff changeset
   753
              )
321c1729db5b initial checkin
penk
parents:
diff changeset
   754
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
   755
           )
321c1729db5b initial checkin
penk
parents:
diff changeset
   756
         
321c1729db5b initial checkin
penk
parents:
diff changeset
   757
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
   758
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
   759
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   760
321c1729db5b initial checkin
penk
parents:
diff changeset
   761
!FileDialog class methodsFor:'menu specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   762
321c1729db5b initial checkin
penk
parents:
diff changeset
   763
toolBarMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
   764
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
   765
     by the MenuEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
   766
321c1729db5b initial checkin
penk
parents:
diff changeset
   767
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
   768
     the MenuEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
   769
321c1729db5b initial checkin
penk
parents:
diff changeset
   770
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   771
     MenuEditor new openOnClass:FileDialog andSelector:#toolBarMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
   772
     (Menu new fromLiteralArrayEncoding:(FileDialog toolBarMenu)) startUp
321c1729db5b initial checkin
penk
parents:
diff changeset
   773
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   774
321c1729db5b initial checkin
penk
parents:
diff changeset
   775
    <resource: #menu>
321c1729db5b initial checkin
penk
parents:
diff changeset
   776
321c1729db5b initial checkin
penk
parents:
diff changeset
   777
    ^ 
321c1729db5b initial checkin
penk
parents:
diff changeset
   778
     #(#Menu
321c1729db5b initial checkin
penk
parents:
diff changeset
   779
        #(
321c1729db5b initial checkin
penk
parents:
diff changeset
   780
         #(#MenuItem
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   781
            #activeHelpKey: #directoryUp
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   782
            #enabled: #enableDirectoryUp
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   783
            #label: 'DirectoryUp'
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   784
            #itemValue: #doGoDirectoryUp
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   785
            #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
   786
            #isButton: true
321c1729db5b initial checkin
penk
parents:
diff changeset
   787
            #labelImage: #(#ResourceRetriever #AbstractFileBrowser #upArrow20x20Icon)
321c1729db5b initial checkin
penk
parents:
diff changeset
   788
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
   789
         #(#MenuItem
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   790
            #label: ''
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   791
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
   792
         #(#MenuItem
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   793
            #activeHelpKey: #directoryBack
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   794
            #enabled: #enableBack
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   795
            #label: 'Back'
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   796
            #itemValue: #doBack
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   797
            #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
   798
            #isButton: true
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   799
            #submenuChannel: #menuDirHistoryBack
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   800
            #labelImage: #(#ResourceRetriever #AbstractFileBrowser #leftArrow20x20Icon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   801
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
   802
         #(#MenuItem
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   803
            #label: ''
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   804
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
   805
         #(#MenuItem
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   806
            #activeHelpKey: #directoryForward
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   807
            #enabled: #enableForward
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   808
            #label: 'Forward'
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   809
            #itemValue: #doForward
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   810
            #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
   811
            #isButton: true
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   812
            #submenuChannel: #menuDirHistoryForward
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   813
            #labelImage: #(#ResourceRetriever #AbstractFileBrowser #rightArrow20x20Icon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   814
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
   815
         #(#MenuItem
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   816
            #label: ''
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   817
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
   818
         #(#MenuItem
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   819
            #activeHelpKey: #fileHome
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   820
            #enabled: #enableHome
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   821
            #label: 'Home'
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   822
            #itemValue: #doGotoHomeDirectory
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   823
            #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
   824
            #isButton: true
321c1729db5b initial checkin
penk
parents:
diff changeset
   825
            #labelImage: #(#ResourceRetriever #AbstractFileBrowser #goHomeIcon)
321c1729db5b initial checkin
penk
parents:
diff changeset
   826
          )
3923
2988fc3c88ab next stage
penk
parents: 3905
diff changeset
   827
         #(#MenuItem
2988fc3c88ab next stage
penk
parents: 3905
diff changeset
   828
            #label: '-'
2988fc3c88ab next stage
penk
parents: 3905
diff changeset
   829
          )
2988fc3c88ab next stage
penk
parents: 3905
diff changeset
   830
         #(#MenuItem
2988fc3c88ab next stage
penk
parents: 3905
diff changeset
   831
            #label: 'New Directory'
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   832
            #itemValue: #newDirectory
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
   833
            #translateLabel: true
3923
2988fc3c88ab next stage
penk
parents: 3905
diff changeset
   834
            #isButton: true
3956
617ef25f6d1e allow for loadDialog no fileoperations
penk
parents: 3953
diff changeset
   835
            #isVisible: #newDirectoryVisibilityHolder
3923
2988fc3c88ab next stage
penk
parents: 3905
diff changeset
   836
            #labelImage: #(#ResourceRetriever #AbstractFileBrowser #newDirectory20x20Icon)
2988fc3c88ab next stage
penk
parents: 3905
diff changeset
   837
          )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   838
         )
321c1729db5b initial checkin
penk
parents:
diff changeset
   839
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   840
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   841
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
   842
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   843
321c1729db5b initial checkin
penk
parents:
diff changeset
   844
!FileDialog methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   845
3996
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
   846
currentSelectedFiles
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
   847
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
   848
    | selectedFiles|
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
   849
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
   850
    selectedFiles := treeBrowser currentFileNameHolder value.
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
   851
    ^ selectedFiles select:[:aFile| aFile isDirectory not].
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
   852
!
17c9a6d10f75 *** empty log message ***
penk
parents: 3994
diff changeset
   853
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   854
directory
321c1729db5b initial checkin
penk
parents:
diff changeset
   855
    "return the value of the instance variable 'directory' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
   856
321c1729db5b initial checkin
penk
parents:
diff changeset
   857
    ^ directory
321c1729db5b initial checkin
penk
parents:
diff changeset
   858
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   859
321c1729db5b initial checkin
penk
parents:
diff changeset
   860
directory:something
321c1729db5b initial checkin
penk
parents:
diff changeset
   861
    "set the value of the instance variable 'directory' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
   862
321c1729db5b initial checkin
penk
parents:
diff changeset
   863
    directory := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
   864
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   865
321c1729db5b initial checkin
penk
parents:
diff changeset
   866
initialText
321c1729db5b initial checkin
penk
parents:
diff changeset
   867
    "return the value of the instance variable 'initialText' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
   868
321c1729db5b initial checkin
penk
parents:
diff changeset
   869
    ^ initialText
321c1729db5b initial checkin
penk
parents:
diff changeset
   870
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   871
321c1729db5b initial checkin
penk
parents:
diff changeset
   872
initialText:something
321c1729db5b initial checkin
penk
parents:
diff changeset
   873
    "set the value of the instance variable 'initialText' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
   874
321c1729db5b initial checkin
penk
parents:
diff changeset
   875
    initialText := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
   876
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   877
321c1729db5b initial checkin
penk
parents:
diff changeset
   878
pattern
321c1729db5b initial checkin
penk
parents:
diff changeset
   879
    "return the value of the instance variable 'pattern' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
   880
321c1729db5b initial checkin
penk
parents:
diff changeset
   881
    ^ pattern
321c1729db5b initial checkin
penk
parents:
diff changeset
   882
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   883
321c1729db5b initial checkin
penk
parents:
diff changeset
   884
pattern:something
321c1729db5b initial checkin
penk
parents:
diff changeset
   885
    "set the value of the instance variable 'pattern' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
   886
321c1729db5b initial checkin
penk
parents:
diff changeset
   887
    pattern := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
   888
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   889
321c1729db5b initial checkin
penk
parents:
diff changeset
   890
result
321c1729db5b initial checkin
penk
parents:
diff changeset
   891
    "return the value of the instance variable 'result' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
   892
321c1729db5b initial checkin
penk
parents:
diff changeset
   893
    ^ result
321c1729db5b initial checkin
penk
parents:
diff changeset
   894
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   895
321c1729db5b initial checkin
penk
parents:
diff changeset
   896
result:something
321c1729db5b initial checkin
penk
parents:
diff changeset
   897
    "set the value of the instance variable 'result' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
   898
321c1729db5b initial checkin
penk
parents:
diff changeset
   899
    result := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
   900
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   901
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   902
selectedDirectories
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   903
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   904
    | selectedFiles|
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   905
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   906
    selectedFiles := treeBrowser currentFileNameHolder value.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   907
    ^ selectedFiles select:[:aFile| aFile isDirectory].
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   908
!
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   909
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   910
startFilename
321c1729db5b initial checkin
penk
parents:
diff changeset
   911
    "return the value of the instance variable 'startFilename' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
   912
321c1729db5b initial checkin
penk
parents:
diff changeset
   913
    startFilename isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   914
        startFilename := Filename currentDirectory asAbsoluteFilename.
321c1729db5b initial checkin
penk
parents:
diff changeset
   915
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   916
    ^ startFilename
321c1729db5b initial checkin
penk
parents:
diff changeset
   917
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   918
321c1729db5b initial checkin
penk
parents:
diff changeset
   919
startFilename:something
321c1729db5b initial checkin
penk
parents:
diff changeset
   920
    "set the value of the instance variable 'startFilename' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
   921
321c1729db5b initial checkin
penk
parents:
diff changeset
   922
    startFilename := something.
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   923
! !
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   924
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   925
!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
   926
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   927
asLoadDialog
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   928
    ^ self isLoadDialog
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   929
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   930
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   931
asLoadDialog:aBoolean
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   932
    self beLoadDialog:aBoolean
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   933
!
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   934
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   935
beLoadDialog:aBoolean
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   936
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   937
    isLoadDialog := aBoolean
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   938
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   939
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   940
doubleClickAction
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   941
    "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
   942
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   943
    ^ doubleClickAction
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   944
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   945
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   946
doubleClickAction:something
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   947
    "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
   948
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   949
    doubleClickAction := something.
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   950
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   951
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   952
isLoadDialog
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   953
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   954
    ^ isLoadDialog ? true
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   955
!
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   956
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   957
multipleSelect
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   958
    ^ multipleSelect ? false
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   959
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   960
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   961
multipleSelect:aBoolean
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   962
    multipleSelect := aBoolean.
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   963
    treeBrowser notNil ifTrue:[
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   964
        treeBrowser multipleSelect:aBoolean.
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
   965
    ].
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   966
! !
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   967
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   968
!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
   969
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   970
addButton:aButton
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   971
    DialogBox defaultOKButtonAtLeft ifTrue:[
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   972
        (self componentAt:#ButtonPanel) addSubView:aButton before:(self okButton)
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   973
    ] ifFalse:[
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   974
        (self componentAt:#ButtonPanel) addSubView:aButton after:(self okButton)
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   975
    ].
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   976
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   977
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   978
okButton
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   979
    ^ (self componentAt:#okButton) 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   980
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   981
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   982
treeBrowser
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   983
    "return the value of the instance variable 'treeBrowser' (automatically generated)"
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   984
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
   985
    ^ treeBrowser
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   986
! !
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   987
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   988
!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
   989
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   990
hideButtonPanel
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   991
    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
   992
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   993
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   994
newDirectoryVisibilityHolder
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   995
    newDirectoryVisibilityHolder isNil ifTrue:[
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   996
        newDirectoryVisibilityHolder := true asValue.
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   997
    ].
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   998
    ^ newDirectoryVisibilityHolder
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
   999
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1000
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1001
showButtonPanel
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1002
    self buttonPanelVisibleHolder value:true
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1003
!
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1004
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1005
viewFiles
321c1729db5b initial checkin
penk
parents:
diff changeset
  1006
    "return the value of the instance variable 'viewFiles' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1007
321c1729db5b initial checkin
penk
parents:
diff changeset
  1008
    ^ viewFiles
321c1729db5b initial checkin
penk
parents:
diff changeset
  1009
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1010
321c1729db5b initial checkin
penk
parents:
diff changeset
  1011
viewFiles:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  1012
    "set the value of the instance variable 'viewFiles' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1013
321c1729db5b initial checkin
penk
parents:
diff changeset
  1014
    viewFiles := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1015
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1016
321c1729db5b initial checkin
penk
parents:
diff changeset
  1017
!FileDialog methodsFor:'aspects'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1018
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
  1019
appendButtonVisibleHolder
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
  1020
    appendButtonVisibleHolder isNil ifTrue:[
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
  1021
        appendButtonVisibleHolder := false asValue.
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
  1022
    ].
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
  1023
    ^ appendButtonVisibleHolder
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
  1024
!
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
  1025
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1026
aspectOrNil:aKey forSubApplication:aSubApp
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1027
    "this hook provides an aspect for a subApp"
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1028
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1029
    aKey == #currentFileNameHolder ifTrue:[
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1030
        directory notNil ifTrue:[
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1031
            ^ (OrderedCollection with:directory) asValue
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1032
        ]
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1033
    ].
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1034
    ^ nil
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1035
!
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1036
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1037
buttonPanelVisibleHolder
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1038
    buttonPanelVisibleHolder isNil ifTrue:[
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1039
        buttonPanelVisibleHolder := true asValue.
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1040
        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
  1041
    ].
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1042
    ^ buttonPanelVisibleHolder.
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1043
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1044
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1045
cancelLabelHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1046
    "automatically generated by UIPainter ..."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1047
321c1729db5b initial checkin
penk
parents:
diff changeset
  1048
    "*** the code below creates a default model when invoked."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1049
    "*** (which may not be the one you wanted)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1050
    "*** Please change as required and accept it in the browser."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1051
    "*** (and replace this comment by something more useful ;-)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1052
321c1729db5b initial checkin
penk
parents:
diff changeset
  1053
    cancelLabelHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1054
        cancelLabelHolder := 'Cancel' asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1055
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1056
    ^ cancelLabelHolder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1057
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1058
321c1729db5b initial checkin
penk
parents:
diff changeset
  1059
enableBack
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1060
    ^ treeBrowser enableBack.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1061
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1062
321c1729db5b initial checkin
penk
parents:
diff changeset
  1063
enableDirectoryUp
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1064
    ^ treeBrowser enableDirectoryUp.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1065
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1066
321c1729db5b initial checkin
penk
parents:
diff changeset
  1067
enableForward
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1068
    ^ treeBrowser enableForward.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1069
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1070
321c1729db5b initial checkin
penk
parents:
diff changeset
  1071
enableHome
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1072
    ^ treeBrowser enableHome.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1073
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1074
321c1729db5b initial checkin
penk
parents:
diff changeset
  1075
filenameHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1076
    "Return a value holder with the filename.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1077
     Shown in the filename input-field.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1078
     Being the selection in the tree.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1079
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  1080
    |holder|
321c1729db5b initial checkin
penk
parents:
diff changeset
  1081
    holder := builder bindingAt:#filenameHolder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1082
321c1729db5b initial checkin
penk
parents:
diff changeset
  1083
    holder ifNil:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1084
        holder := ValueHolder new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1085
        holder addDependent:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1086
        builder aspectAt:#filenameHolder 
321c1729db5b initial checkin
penk
parents:
diff changeset
  1087
                     put:holder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1088
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1089
321c1729db5b initial checkin
penk
parents:
diff changeset
  1090
    ^ holder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1091
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1092
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1093
filenameLabelHolder
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1094
    "Return a value holder for the input string.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1095
    "
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1096
    filenameLabelHolder isNil ifTrue:[
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1097
        filenameLabelHolder := 'Filename:' asValue.
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1098
    ].
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1099
    ^ filenameLabelHolder
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1100
!
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1101
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1102
filterHolder
4011
73fa35b1963b *** empty log message ***
penk
parents: 4005
diff changeset
  1103
    "Return a value holder for filter
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1104
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  1105
321c1729db5b initial checkin
penk
parents:
diff changeset
  1106
    filterHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1107
        filterHolder := treeBrowser filterModel.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1108
        self pattern notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1109
            filterHolder value:pattern.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1110
        ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  1111
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1112
    ^ filterHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1113
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1114
321c1729db5b initial checkin
penk
parents:
diff changeset
  1115
okLabelHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1116
    "automatically generated by UIPainter ..."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1117
321c1729db5b initial checkin
penk
parents:
diff changeset
  1118
    "*** the code below creates a default model when invoked."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1119
    "*** (which may not be the one you wanted)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1120
    "*** Please change as required and accept it in the browser."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1121
    "*** (and replace this comment by something more useful ;-)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1122
321c1729db5b initial checkin
penk
parents:
diff changeset
  1123
    okLabelHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1124
        okLabelHolder := 'OK' asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1125
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1126
    ^ okLabelHolder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1127
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1128
321c1729db5b initial checkin
penk
parents:
diff changeset
  1129
!FileDialog methodsFor:'change & update'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1130
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1131
buttonPanelVisibilityChanged
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1132
    |filePart buttonPanel|
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1133
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1134
    filePart := builder componentAt:#FilePart.
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1135
    buttonPanel := builder componentAt:#ButtonPanel.
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1136
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1137
    buttonPanelVisibleHolder value ifTrue:[
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1138
        filePart layout bottomOffset:-40
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1139
    ] ifFalse:[
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1140
        filePart layout bottomOffset:0
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1141
    ].
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1142
    filePart containerChangedSize    "/ force resize
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1143
!
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1144
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1145
update:something with:aParameter from:changedObject
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1146
    |files newFile newLabel fn|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1147
321c1729db5b initial checkin
penk
parents:
diff changeset
  1148
    changedObject == treeBrowser currentFileNameHolder ifTrue:[
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1149
        files := changedObject value.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1150
321c1729db5b initial checkin
penk
parents:
diff changeset
  1151
        (files isEmpty) ifTrue:[
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1152
            newFile := nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1153
        ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1154
            files size == 1 ifTrue:[
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1155
                newFile := files first.    
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1156
            ] ifFalse:[
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1157
                newFile := ''.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1158
            ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1159
        ].
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1160
        self filenameHolder value:newFile withoutNotifying:self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1161
    ].
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1162
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1163
    changedObject == treeBrowser viewFilesInDirectoryTree ifTrue:[
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1164
        changedObject value ifTrue:[
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1165
            newLabel := 'Filename:'.
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1166
        ] ifFalse:[
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1167
            newLabel := 'Directory:'.
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1168
        ].
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1169
        self filenameLabelHolder value:(resources string:newLabel)
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1170
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1171
    changedObject == self filenameHolder ifTrue:[
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1172
        fn := changedObject value asFilename.
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1173
        (fn exists) ifFalse:[^ self].
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1174
        treeBrowser currentFileNameHolder value:(OrderedCollection with:fn) withoutNotifying:self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1175
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1176
    ^ super update:something with:aParameter from:changedObject
321c1729db5b initial checkin
penk
parents:
diff changeset
  1177
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1178
321c1729db5b initial checkin
penk
parents:
diff changeset
  1179
!FileDialog methodsFor:'event handling'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1180
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1181
appendWasPressed
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1182
    "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
  1183
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1184
    ^ appendWasPressed
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1185
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1186
321c1729db5b initial checkin
penk
parents:
diff changeset
  1187
!FileDialog methodsFor:'initialization & release'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1188
321c1729db5b initial checkin
penk
parents:
diff changeset
  1189
postBuildFileNameField:aWidget
321c1729db5b initial checkin
penk
parents:
diff changeset
  1190
321c1729db5b initial checkin
penk
parents:
diff changeset
  1191
    filenameField := aWidget.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1192
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1193
321c1729db5b initial checkin
penk
parents:
diff changeset
  1194
postBuildFilterField:aWidget
321c1729db5b initial checkin
penk
parents:
diff changeset
  1195
321c1729db5b initial checkin
penk
parents:
diff changeset
  1196
    filterField := aWidget.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1197
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1198
321c1729db5b initial checkin
penk
parents:
diff changeset
  1199
postBuildTreeBrowser:aSubCanvasView
321c1729db5b initial checkin
penk
parents:
diff changeset
  1200
321c1729db5b initial checkin
penk
parents:
diff changeset
  1201
    treeBrowser := aSubCanvasView client.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1202
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1203
4005
42f09ac0e0aa Fix for multipleSelection settings (race condition pops debugger at telekom!)
Stefan Vogel <sv@exept.de>
parents: 3996
diff changeset
  1204
postBuildWith:aBuilder    
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1205
    treeBrowser multipleSelect:multipleSelect.
4603
49cca8deebde support an additional "append" button
Claus Gittinger <cg@exept.de>
parents: 4562
diff changeset
  1206
    appendWasPressed := false.
4005
42f09ac0e0aa Fix for multipleSelection settings (race condition pops debugger at telekom!)
Stefan Vogel <sv@exept.de>
parents: 3996
diff changeset
  1207
    ^ super postBuildWith:aBuilder
42f09ac0e0aa Fix for multipleSelection settings (race condition pops debugger at telekom!)
Stefan Vogel <sv@exept.de>
parents: 3996
diff changeset
  1208
!
42f09ac0e0aa Fix for multipleSelection settings (race condition pops debugger at telekom!)
Stefan Vogel <sv@exept.de>
parents: 3996
diff changeset
  1209
4728
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1210
postOpen
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1211
321c1729db5b initial checkin
penk
parents:
diff changeset
  1212
"/     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
  1213
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1214
    self window topView isModal ifFalse:[
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1215
        self hideButtonPanel
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1216
    ].
545cd2c65dfa hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents: 4666
diff changeset
  1217
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1218
    treeBrowser currentFileNameHolder addDependent:self.
3953
4fd0ed70cf36 next stage
penk
parents: 3944
diff changeset
  1219
    treeBrowser doubleClickAction:(self doubleClickAction).
3904
7f20fe941a4c add requestFilenames method
penk
parents: 3892
diff changeset
  1220
    treeBrowser viewFilesInDirectoryTree addDependent:self.
3982
fc30449d705d *** empty log message ***
penk
parents: 3960
diff changeset
  1221
    treeBrowser rootHolder value:((self directory) ? (Filename currentDirectory asAbsoluteFilename)).
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1222
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1223
    treeBrowser viewFilesInDirectoryTree setValue:(self viewFiles ? true).
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1224
    treeBrowser viewFilesInDirectoryTree changed.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1225
    treeBrowser currentFileNameHolder value:(OrderedCollection with:(self startFilename)).
4804
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1226
406ea13c6b0a initial selection;
Claus Gittinger <cg@exept.de>
parents: 4796
diff changeset
  1227
    self isLoadDialog ifTrue:[
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1228
        treeBrowser newVisibilityHolder value:false.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1229
        treeBrowser allowFileOperations value:false.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1230
        self newDirectoryVisibilityHolder value:false.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1231
    ].
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1232
    self filenameHolder value:(self startFilename).
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1233
    self window label:(resources string:((self initialText) ? 'File Dialog')).
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1234
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1235
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1236
postOpenAsSubcanvasWith:aBuilder    
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1237
    self postOpen.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1238
    ^ super postOpenAsSubcanvasWith:aBuilder
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1239
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1240
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1241
postOpenWith:aBuilder    
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1242
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1243
    self postOpen.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1244
    ^ super postOpenWith:aBuilder.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1245
! !
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1246
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1247
!FileDialog methodsFor:'private'!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1248
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1249
returnWasPressedInFilterField
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1250
    |ev|
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1251
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1252
    ev := self windowGroup lastEvent.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1253
    (ev notNil 
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1254
    and:[ev isKeyEvent 
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1255
    and:[ev key == #Return
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1256
    and:[(   ev targetView isSameOrComponentOf:filterField) 
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1257
         or:[false "ev targetView isSameOrComponentOf:filenameField"]]]]) ifTrue:[
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1258
        ^ true
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1259
    ].
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1260
    ^ false
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1261
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1262
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1263
returnWasPressedInFilterOrFilenameField
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1264
    |ev|
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1265
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1266
    ev := self windowGroup lastEvent.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1267
    (ev notNil 
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1268
    and:[ev isKeyEvent 
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1269
    and:[ev key == #Return
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1270
    and:[(   ev targetView isSameOrComponentOf:filterField) 
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1271
         or:[false "ev targetView isSameOrComponentOf:filenameField"]]]]) ifTrue:[
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1272
        ^ true
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1273
    ].
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1274
    ^ false
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1275
! !
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1276
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1277
!FileDialog methodsFor:'user actions'!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1278
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1279
appendPressed
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1280
    appendWasPressed := true.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1281
    self commonAcceptAction.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1282
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1283
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1284
commonAcceptAction
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1285
    filenameField accept.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1286
    self result:(self filenameHolder value asString).
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1287
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1288
    ^ super doAccept
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1289
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1290
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1291
doAccept
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1292
    "force accept - ignore in filterField"
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1293
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1294
    self returnWasPressedInFilterField ifTrue:[
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1295
        ^ self
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1296
    ].
4996
5927cc0508e8 close the editor in treebrowser on rename if ENTER is pressed
penk
parents: 4824
diff changeset
  1297
    treeBrowser hasOpenEditor ifTrue:[
5927cc0508e8 close the editor in treebrowser on rename if ENTER is pressed
penk
parents: 4824
diff changeset
  1298
        "/ 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
  1299
        treeBrowser browser closeEditor.
5927cc0508e8 close the editor in treebrowser on rename if ENTER is pressed
penk
parents: 4824
diff changeset
  1300
        ^ self
5927cc0508e8 close the editor in treebrowser on rename if ENTER is pressed
penk
parents: 4824
diff changeset
  1301
    ].
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1302
    appendWasPressed := false.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1303
    self commonAcceptAction.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1304
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1305
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1306
doBack
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1307
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1308
    treeBrowser doBack.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1309
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1310
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1311
doCancel
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1312
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1313
    self result:nil.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1314
    ^ super doCancel.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1315
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1316
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1317
doForward
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1318
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1319
    treeBrowser doForward.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1320
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1321
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1322
doGoDirectoryUp
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1323
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1324
    treeBrowser doGoDirectoryUp.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1325
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1326
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1327
doGotoHomeDirectory
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1328
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1329
    treeBrowser doGotoHomeDirectory.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1330
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1331
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1332
menuDirHistory:backOrForward
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1333
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1334
    ^ treeBrowser menuDirHistory:backOrForward.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1335
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1336
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1337
menuDirHistoryBack
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1338
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1339
    ^ treeBrowser menuDirHistory:#back.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1340
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1341
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1342
menuDirHistoryForward
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1343
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1344
    ^ treeBrowser menuDirHistory:#forward.
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1345
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1346
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1347
newDirectory
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1348
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1349
    ^ treeBrowser newDirectory
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1350
!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1351
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1352
okPressed
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1353
    self doAccept
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1354
! !
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1355
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1356
!FileDialog class methodsFor:'documentation'!
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1357
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1358
version
5173
66787858b06a open on not existing default directories
penk
parents: 5163
diff changeset
  1359
    ^ '$Header: /cvs/stx/stx/libtool/FileDialog.st,v 1.42 2003-09-12 15:29:07 penk Exp $'
4796
9131f6780fb5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4795
diff changeset
  1360
! !