author | Claus Gittinger <cg@exept.de> |
Sat, 20 Jun 2009 10:47:07 +0200 | |
changeset 3901 | 113dd960ba11 |
parent 2698 | cca702636705 |
child 4689 | a5cb9ae9641f |
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 |
||
2415 | 13 |
"{ Package: 'stx:libwidg' }" |
14 |
||
37 | 15 |
FileSelectionBox subclass:#FileSaveBox |
585 | 16 |
instanceVariableNames:'appendButton appendAction' |
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Views-DialogBoxes' |
|
37 | 20 |
! |
21 |
||
22 |
!FileSaveBox class methodsFor:'documentation'! |
|
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
59 | 27 |
All Rights Reserved |
37 | 28 |
|
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
38 |
documentation |
|
39 |
" |
|
637 | 40 |
Instances of FileSaveBox add an 'append'-button, and an |
41 |
associated append-action. |
|
42 |
The other behavior is that of a FileSelectionBox. |
|
37 | 43 |
|
585 | 44 |
[Instance variables:] |
45 |
appendAction action to be performed when append is pressed |
|
46 |
||
47 |
||
48 |
[author:] |
|
49 |
Claus Gittinger |
|
50 |
||
51 |
[see also:] |
|
52 |
DialogBox |
|
648 | 53 |
EnterBox2 FilenameEnterBox YesNoBox |
585 | 54 |
ListSelectionBox FileSelectionBox |
37 | 55 |
" |
56 |
! ! |
|
57 |
||
197 | 58 |
!FileSaveBox methodsFor:'accessing'! |
37 | 59 |
|
197 | 60 |
appendAction:aBlock |
61 |
"set the action to be performed when append is pressed" |
|
62 |
||
63 |
appendAction := aBlock |
|
37 | 64 |
! ! |
65 |
||
66 |
!FileSaveBox methodsFor:'initialization'! |
|
67 |
||
197 | 68 |
initialize |
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. |
|
2415 | 80 |
appendButton label:(resources string:'Append'). |
197 | 81 |
appendButton action:[appendButton turnOffWithoutRedraw. self appendPressed]. |
2698 | 82 |
(Dialog defaultOKButtonAtLeft) 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 |
|
2698 | 106 |
^ '$Header: /cvs/stx/stx/libwidg/FileSaveBox.st,v 1.16 2003-02-25 14:58:59 cg Exp $' |
243 | 107 |
! ! |