author | fm |
Fri, 19 Oct 2007 16:21:04 +0200 | |
changeset 3252 | 5036ab52712f |
parent 3228 | 1903c2ccb97f |
child 5580 | 3f24169c2d32 |
permissions | -rw-r--r-- |
3047 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
3 |
All Rights Reserved |
|
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 |
" |
|
2967 | 12 |
"{ Package: 'stx:libwidg2' }" |
13 |
||
14 |
ApplicationModel subclass:#PrintAbortDialog |
|
3252 | 15 |
instanceVariableNames:'printer title printingPageLabel titleLabel printerLabel abort' |
2967 | 16 |
classVariableNames:'' |
17 |
poolDictionaries:'' |
|
2969 | 18 |
category:'Interface-Printing' |
2967 | 19 |
! |
20 |
||
3047 | 21 |
!PrintAbortDialog class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
26 |
All Rights Reserved |
|
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 |
" |
|
3094
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
35 |
! |
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
36 |
|
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
37 |
documentation |
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
38 |
" |
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
39 |
I allow for an ongoing print operation to be cancelled. |
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
40 |
|
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
41 |
[author:] |
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
42 |
Felix Madrid (fm@exept.de) |
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
43 |
" |
3047 | 44 |
! ! |
2967 | 45 |
|
46 |
!PrintAbortDialog class methodsFor:'interface specs'! |
|
47 |
||
48 |
windowSpec |
|
49 |
"This resource specification was automatically generated |
|
50 |
by the UIPainter of ST/X." |
|
51 |
||
52 |
"Do not manually edit this!! If it is corrupted, |
|
53 |
the UIPainter may not be able to read the specification." |
|
54 |
||
55 |
" |
|
56 |
UIPainter new openOnClass:PrintAbortDialog andSelector:#windowSpec |
|
57 |
PrintAbortDialog new openInterface:#windowSpec |
|
58 |
PrintAbortDialog open |
|
59 |
" |
|
60 |
||
61 |
<resource: #canvas> |
|
62 |
||
63 |
^ |
|
64 |
#(FullSpec |
|
65 |
name: windowSpec |
|
66 |
window: |
|
67 |
(WindowSpec |
|
68 |
label: 'Printing in progress...' |
|
69 |
name: 'Printing in progress...' |
|
70 |
min: (Point 313 163) |
|
71 |
max: (Point 313 163) |
|
72 |
bounds: (Rectangle 0 0 313 163) |
|
73 |
icon: icon |
|
74 |
) |
|
75 |
component: |
|
76 |
(SpecCollection |
|
77 |
collection: ( |
|
78 |
(ActionButtonSpec |
|
79 |
label: 'Abort' |
|
80 |
name: 'Button1' |
|
81 |
layout: (LayoutFrame 114 0 131 0 201 0 153 0) |
|
82 |
translateLabel: true |
|
83 |
model: abort |
|
84 |
) |
|
85 |
(LabelSpec |
|
86 |
label: 'Job name' |
|
87 |
name: 'TitleLabel' |
|
88 |
layout: (LayoutFrame 5 0 7 0 307 0 29 0) |
|
89 |
style: (FontDescription Tahoma bold roman 10 #'ms-ansi') |
|
90 |
translateLabel: true |
|
91 |
postBuildCallback: titleLabelPostBuild: |
|
92 |
) |
|
93 |
(FramedBoxSpec |
|
94 |
label: '' |
|
95 |
name: 'FramedBox1' |
|
96 |
layout: (LayoutFrame 3 0.0 37 0.0 309 0.0 118 0.0) |
|
97 |
component: |
|
98 |
(SpecCollection |
|
99 |
collection: ( |
|
100 |
(LabelSpec |
|
101 |
label: 'Printer:' |
|
102 |
name: 'Label1' |
|
103 |
layout: (LayoutFrame 1 0.0 0 0.0 52 0.0 22 0.0) |
|
104 |
style: (FontDescription Tahoma bold roman 8.25 #'ms-ansi') |
|
105 |
translateLabel: true |
|
106 |
adjust: left |
|
107 |
) |
|
108 |
(LabelSpec |
|
109 |
label: 'PrinterLabel' |
|
110 |
name: 'PrinterLabel' |
|
111 |
layout: (LayoutFrame 59 0.0 -1 0.0 281 0.0 22 0.0) |
|
112 |
translateLabel: true |
|
113 |
adjust: left |
|
114 |
postBuildCallback: printerLabelPostBuild: |
|
115 |
) |
|
116 |
(LabelSpec |
|
3228 | 117 |
label: 'Status:' |
2967 | 118 |
name: 'PrintingPage' |
119 |
layout: (LayoutFrame 0 0.0 28 0.0 50 0.0 50 0.0) |
|
120 |
style: (FontDescription Tahoma bold roman 8.25 #'ms-ansi') |
|
121 |
translateLabel: true |
|
122 |
adjust: left |
|
123 |
) |
|
124 |
(LabelSpec |
|
125 |
label: 'Page 1/N' |
|
126 |
name: 'PrintingPageLabel' |
|
127 |
layout: (LayoutFrame 59 0.0 28 0.0 281 0.0 50 0.0) |
|
128 |
translateLabel: true |
|
129 |
adjust: left |
|
130 |
postBuildCallback: printingPageLabelPostBuild: |
|
131 |
) |
|
132 |
) |
|
133 |
||
134 |
) |
|
135 |
) |
|
136 |
) |
|
137 |
||
138 |
) |
|
139 |
) |
|
140 |
! ! |
|
141 |
||
142 |
!PrintAbortDialog class methodsFor:'opening'! |
|
143 |
||
3094
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
144 |
open:aTitle printer:aPrinter |
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
145 |
^ self new open:aTitle printer:aPrinter |
2967 | 146 |
|
147 |
"Created: / 02-08-2006 / 13:32:16 / fm" |
|
3094
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
148 |
"Modified: / 10-10-2006 / 17:29:51 / cg" |
2967 | 149 |
! ! |
150 |
||
151 |
!PrintAbortDialog methodsFor:'aspects'! |
|
152 |
||
3094
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
153 |
printerLabelPostBuild:aLabel |
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
154 |
printerLabel := aLabel |
2967 | 155 |
|
156 |
"Created: / 03-08-2006 / 17:13:11 / fm" |
|
3094
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
157 |
"Modified: / 10-10-2006 / 17:29:11 / cg" |
2967 | 158 |
! |
159 |
||
3094
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
160 |
printingPageLabelPostBuild:aLabel |
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
161 |
printingPageLabel := aLabel |
2967 | 162 |
|
163 |
"Modified: / 02-08-2006 / 13:47:33 / fm" |
|
3094
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
164 |
"Modified: / 10-10-2006 / 17:29:15 / cg" |
2967 | 165 |
! |
166 |
||
3094
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
167 |
titleLabelPostBuild:aLabel |
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
168 |
titleLabel := aLabel |
2967 | 169 |
|
170 |
"Created: / 02-08-2006 / 13:47:42 / fm" |
|
3094
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
171 |
"Modified: / 10-10-2006 / 17:29:21 / cg" |
2967 | 172 |
! ! |
173 |
||
174 |
!PrintAbortDialog methodsFor:'opening'! |
|
175 |
||
3094
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
176 |
open:aTitle printer:aPrinter |
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
177 |
"Open a printer abort dialog. This dialog box |
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
178 |
allows the user to abort while printing." |
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
179 |
|
2967 | 180 |
printer := aPrinter. |
181 |
title := aTitle. |
|
182 |
self openAndWaitUntilVisible. |
|
183 |
self updateTitle |
|
184 |
||
185 |
"Created: / 02-08-2006 / 13:06:21 / fm" |
|
3094
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
186 |
"Modified: / 10-10-2006 / 17:29:26 / cg" |
2967 | 187 |
! ! |
188 |
||
3252 | 189 |
!PrintAbortDialog methodsFor:'queries'! |
190 |
||
191 |
shouldAbort |
|
192 |
||
193 |
^ abort ? false |
|
194 |
! ! |
|
195 |
||
2967 | 196 |
!PrintAbortDialog methodsFor:'update'! |
197 |
||
3094
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
198 |
updatePrintingPageInfo:aString |
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
199 |
printingPageLabel label:aString |
2967 | 200 |
|
201 |
"Created: / 02-08-2006 / 15:56:13 / fm" |
|
3094
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
202 |
"Modified: / 10-10-2006 / 17:29:31 / cg" |
2967 | 203 |
! |
204 |
||
205 |
updateTitle |
|
3094
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
206 |
titleLabel label:title. |
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
207 |
printerLabel label:printer printerUserFriendlyName. |
2967 | 208 |
|
209 |
"Created: / 02-08-2006 / 13:58:47 / fm" |
|
210 |
"Modified: / 03-08-2006 / 17:14:16 / fm" |
|
3094
9aa1178d8e86
pretty printed & added some documentation and examples
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
211 |
"Modified: / 10-10-2006 / 17:29:35 / cg" |
2967 | 212 |
! ! |
213 |
||
214 |
!PrintAbortDialog methodsFor:'user actions'! |
|
215 |
||
216 |
abort |
|
3227 | 217 |
"The abort dialog should be closed after aborting the printing process" |
3252 | 218 |
abort := true. |
2967 | 219 |
printer abortPrintJob. |
3252 | 220 |
"/ self close. |
2967 | 221 |
! ! |
222 |
||
223 |
!PrintAbortDialog class methodsFor:'documentation'! |
|
224 |
||
225 |
version |
|
3252 | 226 |
^ '$Header: /cvs/stx/stx/libwidg2/PrintAbortDialog.st,v 1.7 2007-10-19 14:21:04 fm Exp $' |
2967 | 227 |
! ! |