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