77 lines
1.6 KiB
PostScript
77 lines
1.6 KiB
PostScript
/box-input-text-create { % =>
|
|
box-inline-create
|
|
dup box-input-text-setup-methods
|
|
dup /box-input-text add-type
|
|
} def
|
|
|
|
/box-input-text-get-min-width { % => Context This
|
|
2 copy /get-max-width call-method
|
|
exch pop
|
|
exch pop
|
|
} def
|
|
|
|
/box-input-text-line-break-allowed { % => This
|
|
pop false
|
|
} def
|
|
|
|
/box-input-text-reflow { % => Context Parent This
|
|
% Check if we need a line break here
|
|
|
|
3 copy /maybe-line-break call-method
|
|
pop
|
|
|
|
% Append to parent line box
|
|
|
|
dup 2 index box-container-append-line
|
|
|
|
% Determine coordinates of upper-left corner
|
|
|
|
2 copy
|
|
box-generic-guess-corner % => Context Parent This
|
|
|
|
% Determine the box width
|
|
|
|
2 index 1 index
|
|
/get-min-width call-method
|
|
1 index put-full-width % => Context Parent This
|
|
|
|
2 index 1 index
|
|
box-container-reflow-content
|
|
|
|
% vertical-align
|
|
|
|
dup get-content 0 get
|
|
get-default-baseline
|
|
1 index get-extra-top add
|
|
dup 2 index put-baseline
|
|
1 index put-default-baseline
|
|
|
|
% Offset parent curernt X coordinate
|
|
|
|
1 index get-current-x
|
|
1 index get-full-width
|
|
add
|
|
2 index put-current-x
|
|
|
|
% Extend parent height
|
|
|
|
dup get-bottom-margin
|
|
1 index box-generic-extend-height
|
|
|
|
pop pop pop
|
|
} def
|
|
|
|
/box-input-text-setup-methods {
|
|
dup /Methods get
|
|
dup /get-min-width { box-input-text-get-min-width } put
|
|
dup /line-break-allowed { box-input-text-line-break-allowed } put
|
|
dup /reflow { box-input-text-reflow } put
|
|
dup /show { box-input-text-show } put
|
|
pop pop
|
|
} def
|
|
|
|
/box-input-text-show { % => Viewport This
|
|
box-container-show
|
|
} def
|
|
|