37
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1994 by Claus Gittinger
|
59
|
3 |
All Rights Reserved
|
37
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
FileSelectionBox subclass:#FileSaveBox
|
77
|
14 |
instanceVariableNames:'appendButton appendAction'
|
59
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'Views-DialogBoxes'
|
37
|
18 |
!
|
|
19 |
|
|
20 |
FileSaveBox comment:'
|
|
21 |
COPYRIGHT (c) 1994 by Claus Gittinger
|
59
|
22 |
All Rights Reserved
|
37
|
23 |
|
150
|
24 |
$Header: /cvs/stx/stx/libwidg/FileSaveBox.st,v 1.5 1995-08-29 16:43:47 claus Exp $
|
37
|
25 |
'!
|
|
26 |
|
|
27 |
!FileSaveBox class methodsFor:'documentation'!
|
|
28 |
|
|
29 |
copyright
|
|
30 |
"
|
|
31 |
COPYRIGHT (c) 1994 by Claus Gittinger
|
59
|
32 |
All Rights Reserved
|
37
|
33 |
|
|
34 |
This software is furnished under a license and may be used
|
|
35 |
only in accordance with the terms of that license and with the
|
|
36 |
inclusion of the above copyright notice. This software may not
|
|
37 |
be provided or otherwise made available to, or used by, any
|
|
38 |
other person. No title to or ownership of the software is
|
|
39 |
hereby transferred.
|
|
40 |
"
|
|
41 |
!
|
|
42 |
|
|
43 |
version
|
|
44 |
"
|
150
|
45 |
$Header: /cvs/stx/stx/libwidg/FileSaveBox.st,v 1.5 1995-08-29 16:43:47 claus Exp $
|
37
|
46 |
"
|
|
47 |
!
|
|
48 |
|
|
49 |
documentation
|
|
50 |
"
|
|
51 |
Instances of FileSaveBox add an 'append'-button. The other
|
|
52 |
behavior is that of a FileSelectionBox.
|
|
53 |
|
|
54 |
Instance variables:
|
59
|
55 |
appendAction action to be performed when append is pressed
|
37
|
56 |
"
|
|
57 |
! !
|
|
58 |
|
|
59 |
!FileSaveBox methodsFor:'user interaction'!
|
|
60 |
|
|
61 |
appendPressed
|
|
62 |
self hideAndEvaluate:[:string |
|
59
|
63 |
appendAction notNil ifTrue:[
|
|
64 |
appendAction value:string
|
|
65 |
]
|
37
|
66 |
]
|
|
67 |
! !
|
|
68 |
|
|
69 |
!FileSaveBox methodsFor:'initialization'!
|
|
70 |
|
|
71 |
initialize
|
77
|
72 |
super initialize.
|
37
|
73 |
|
150
|
74 |
label := resources string:'Save file dialog'.
|
37
|
75 |
|
59
|
76 |
okButton label:(resources string:'save').
|
|
77 |
|
|
78 |
"
|
|
79 |
insert an append-button between abort- and save-buttons
|
|
80 |
"
|
118
|
81 |
appendButton := Button okButton.
|
77
|
82 |
appendButton isReturnButton:false.
|
|
83 |
appendButton label:(resources string:'append').
|
|
84 |
appendButton action:[appendButton turnOffWithoutRedraw. self appendPressed].
|
|
85 |
buttonPanel addSubView:appendButton after:abortButton
|
|
86 |
!
|
|
87 |
|
|
88 |
focusSequence
|
|
89 |
|a|
|
|
90 |
|
|
91 |
patternField shown ifTrue:[
|
|
92 |
a := Array new:6.
|
|
93 |
a at:1 put:enterField.
|
|
94 |
a at:2 put:patternField.
|
|
95 |
a at:3 put:selectionList.
|
|
96 |
a at:4 put:abortButton.
|
|
97 |
a at:5 put:appendButton.
|
|
98 |
a at:6 put:okButton.
|
|
99 |
^ a
|
|
100 |
].
|
|
101 |
^ Array with:enterField
|
|
102 |
with:selectionList
|
|
103 |
with:abortButton
|
|
104 |
with:appendButton
|
|
105 |
with:okButton
|
37
|
106 |
! !
|
|
107 |
|
|
108 |
!FileSaveBox methodsFor:'accessing'!
|
|
109 |
|
|
110 |
appendAction:aBlock
|
59
|
111 |
"set the action to be performed when append is pressed"
|
|
112 |
|
37
|
113 |
appendAction := aBlock
|
|
114 |
! !
|