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