| 1 |
lars |
1 |
% $Header: /cvsroot/html2ps/postscript/box.select.ps,v 1.1 2005/12/18 07:21:37 Konstantin Exp $
|
|
|
2 |
|
|
|
3 |
/box-select-button-triangle-padding 1.5 def
|
|
|
4 |
|
|
|
5 |
/box-select-create {
|
|
|
6 |
box-container-create % => Box
|
|
|
7 |
dup box-select-setup-methods
|
|
|
8 |
dup /box-select add-type
|
|
|
9 |
} def
|
|
|
10 |
|
|
|
11 |
/box-select-reflow { % => Context Parent This
|
|
|
12 |
% append to parent line box
|
|
|
13 |
dup 2 index box-container-append-line
|
|
|
14 |
|
|
|
15 |
% Determine coordinates of upper-left _margin_ corner
|
|
|
16 |
1 index 1 index box-generic-guess-corner
|
|
|
17 |
|
|
|
18 |
% Determine the box width
|
|
|
19 |
2 index 1 index /get-max-width call-method
|
|
|
20 |
1 index put-full-width
|
|
|
21 |
|
|
|
22 |
2 index 1 index
|
|
|
23 |
box-container-reflow-content
|
|
|
24 |
|
|
|
25 |
2 index context-pop-collapsed-margin
|
|
|
26 |
|
|
|
27 |
context-push-collapsed-margin % => Context Parent This
|
|
|
28 |
|
|
|
29 |
dup get-content 0 get get-baseline
|
|
|
30 |
1 index get-extra-top add
|
|
|
31 |
1 index put-baseline % => Context Parent This
|
|
|
32 |
|
|
|
33 |
dup get-baseline
|
|
|
34 |
1 index put-default-baseline
|
|
|
35 |
|
|
|
36 |
% Offset parent current X coordinate
|
|
|
37 |
1 index get-current-x
|
|
|
38 |
1 index get-full-width add
|
|
|
39 |
2 index put-current-x
|
|
|
40 |
|
|
|
41 |
% Extend parent height
|
|
|
42 |
dup get-bottom-margin
|
|
|
43 |
2 index box-generic-extend-height
|
|
|
44 |
|
|
|
45 |
pop pop pop
|
|
|
46 |
} def
|
|
|
47 |
|
|
|
48 |
/box-select-setup-methods { % => Box
|
|
|
49 |
dup /Methods get
|
|
|
50 |
dup /reflow {box-select-reflow} put
|
|
|
51 |
dup /show {box-select-show} put
|
|
|
52 |
pop pop
|
|
|
53 |
} def
|
|
|
54 |
|
|
|
55 |
/box-select-show { % => Viewport Box
|
|
|
56 |
2 copy box-container-show
|
|
|
57 |
|
|
|
58 |
dup get-height
|
|
|
59 |
1 index get-padding-top add
|
|
|
60 |
1 index get-padding-bottom add % => Viewport Box ButtonHeight
|
|
|
61 |
|
|
|
62 |
% Show arrow button box
|
|
|
63 |
0.93 0.93 0.93 setrgbcolor
|
|
|
64 |
1 index get-right-padding
|
|
|
65 |
1 index sub % => Viewport Box ButtonHeight X
|
|
|
66 |
2 index get-bottom-padding % => Viewport Box ButtonHeight X Y
|
|
|
67 |
2 index dup % => Viewport Box ButtonHeight X Y W H
|
|
|
68 |
rectfill % => Viewport Box ButtonHeight
|
|
|
69 |
|
|
|
70 |
% Show box boundary
|
|
|
71 |
|
|
|
72 |
1 index get-right-padding
|
|
|
73 |
1 index sub % => Viewport Box ButtonHeight X
|
|
|
74 |
2 index get-bottom-padding % => Viewport Box ButtonHeight X Y
|
|
|
75 |
2 index dup % => Viewport Box ButtonHeight X Y W H
|
|
|
76 |
rectstroke % => Viewport Box ButtonHeight
|
|
|
77 |
|
|
|
78 |
% Show arrow
|
|
|
79 |
|
|
|
80 |
|
|
|
81 |
1 index get-right-padding
|
|
|
82 |
box-select-button-triangle-padding sub
|
|
|
83 |
2 index get-top-padding
|
|
|
84 |
box-select-button-triangle-padding sub moveto
|
|
|
85 |
|
|
|
86 |
1 index get-right-padding
|
|
|
87 |
1 index sub
|
|
|
88 |
box-select-button-triangle-padding add
|
|
|
89 |
2 index get-top-padding
|
|
|
90 |
box-select-button-triangle-padding sub lineto
|
|
|
91 |
|
|
|
92 |
1 index get-right-padding
|
|
|
93 |
1 index 2 div sub
|
|
|
94 |
2 index get-bottom-padding
|
|
|
95 |
box-select-button-triangle-padding add lineto
|
|
|
96 |
|
|
|
97 |
closepath
|
|
|
98 |
fill
|
|
|
99 |
|
|
|
100 |
pop pop pop
|
|
|
101 |
} def
|