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 |
"
|
2415
|
12 |
"{ Package: 'stx:libwidg' }"
|
|
13 |
|
37
|
14 |
FileSelectionBox subclass:#FileSaveBox
|
585
|
15 |
instanceVariableNames:'appendButton appendAction'
|
|
16 |
classVariableNames:''
|
|
17 |
poolDictionaries:''
|
|
18 |
category:'Views-DialogBoxes'
|
37
|
19 |
!
|
|
20 |
|
|
21 |
!FileSaveBox class methodsFor:'documentation'!
|
|
22 |
|
|
23 |
copyright
|
|
24 |
"
|
|
25 |
COPYRIGHT (c) 1994 by Claus Gittinger
|
59
|
26 |
All Rights Reserved
|
37
|
27 |
|
|
28 |
This software is furnished under a license and may be used
|
|
29 |
only in accordance with the terms of that license and with the
|
|
30 |
inclusion of the above copyright notice. This software may not
|
|
31 |
be provided or otherwise made available to, or used by, any
|
|
32 |
other person. No title to or ownership of the software is
|
|
33 |
hereby transferred.
|
|
34 |
"
|
|
35 |
!
|
|
36 |
|
|
37 |
documentation
|
|
38 |
"
|
637
|
39 |
Instances of FileSaveBox add an 'append'-button, and an
|
|
40 |
associated append-action.
|
|
41 |
The other behavior is that of a FileSelectionBox.
|
37
|
42 |
|
585
|
43 |
[Instance variables:]
|
|
44 |
appendAction action to be performed when append is pressed
|
|
45 |
|
|
46 |
|
|
47 |
[author:]
|
|
48 |
Claus Gittinger
|
|
49 |
|
|
50 |
[see also:]
|
|
51 |
DialogBox
|
648
|
52 |
EnterBox2 FilenameEnterBox YesNoBox
|
585
|
53 |
ListSelectionBox FileSelectionBox
|
37
|
54 |
"
|
|
55 |
! !
|
|
56 |
|
197
|
57 |
!FileSaveBox methodsFor:'accessing'!
|
37
|
58 |
|
197
|
59 |
appendAction:aBlock
|
|
60 |
"set the action to be performed when append is pressed"
|
|
61 |
|
|
62 |
appendAction := aBlock
|
37
|
63 |
! !
|
|
64 |
|
|
65 |
!FileSaveBox methodsFor:'initialization'!
|
|
66 |
|
197
|
67 |
initialize
|
|
68 |
super initialize.
|
|
69 |
|
|
70 |
label := resources string:'Save file dialog'.
|
|
71 |
|
|
72 |
okButton label:(resources string:'save').
|
|
73 |
|
|
74 |
"
|
|
75 |
insert an append-button between abort- and save-buttons
|
|
76 |
"
|
|
77 |
appendButton := Button okButton.
|
|
78 |
appendButton isReturnButton:false.
|
2415
|
79 |
appendButton label:(resources string:'Append').
|
197
|
80 |
appendButton action:[appendButton turnOffWithoutRedraw. self appendPressed].
|
4689
|
81 |
self addButton:appendButton after:okButton.
|
|
82 |
|
|
83 |
"Modified: / 29-08-2013 / 12:19:54 / cg"
|
37
|
84 |
! !
|
|
85 |
|
197
|
86 |
!FileSaveBox methodsFor:'user interaction'!
|
37
|
87 |
|
197
|
88 |
appendPressed
|
637
|
89 |
"append was pressed - evaluate the append-action"
|
|
90 |
|
197
|
91 |
self hideAndEvaluate:[:string |
|
637
|
92 |
appendAction notNil ifTrue:[
|
|
93 |
appendAction value:string
|
|
94 |
]
|
197
|
95 |
]
|
637
|
96 |
|
|
97 |
"Modified: 12.5.1996 / 21:45:52 / cg"
|
197
|
98 |
! !
|
59
|
99 |
|
243
|
100 |
!FileSaveBox class methodsFor:'documentation'!
|
|
101 |
|
|
102 |
version
|
4689
|
103 |
^ '$Header: /cvs/stx/stx/libwidg/FileSaveBox.st,v 1.17 2013-08-29 10:28:12 cg Exp $'
|
243
|
104 |
! !
|
4689
|
105 |
|