File size: 1,602 Bytes
07c3cdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/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