Skip to content

Commit 76ac7f8

Browse files
lpradermkellner
authored andcommitted
Piu doc updates
1 parent 12aa0a9 commit 76ac7f8

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed
-466 Bytes
Loading

documentation/piu/piu.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ The graphical user interface elements of Piu applications are composed of a hier
7070

7171
Applications use constructors to define `content` and `container` objects. These objects are attached to the containment hierarchy using the `add`, `insert`, and `replace` functions, and are removed from the containment hierarchy using the `remove` and `replace` functions. See [Functions](#container-functions) in the section [Container Object](#container-object) for descriptions of these properties.
7272

73-
<!--
74-
TO DO:
75-
For more information about how `content` and `container` objects are used in applications, see the [Piu Containment Hierarchy document][29].
76-
-->
77-
7873
#### Bound and Unbound Contents
7974

8075
Contents that are not attached to the containment hierarchy are called *unbound* contents; contents attached to the containment hierarchy, *bound* contents. Only objects that are part of the containment hierarchy appear on screen.
@@ -2816,7 +2811,7 @@ application.add(samplePort);
28162811
| `string` | `string` | The string to draw
28172812
| `style` | `style` | The style to use to draw the string
28182813
| `x, y, width, height` | `number` | The local position and size of the area in which to draw, in pixels
2819-
| `ellipsis` | `boolean` | [TO DO: figure out what this does]
2814+
| `ellipsis` | `boolean` | If `true`, the string is truncated to fit the specified bounds. If `false`, the entire string is drawn, even if it extends beyond the specified bounds.
28202815
| `state` | `number` | The state of the style to draw. If the specified style has multiple fill colors, setting the state selects which color to use.
28212816

28222817
Draws a string with the style, position, and state speciied.
@@ -2834,8 +2829,8 @@ let samplePort = new Port(null, {
28342829
let h = size.height;
28352830
port.drawStyle(string, sampleStyle, 20, 10, w, h, true, 0);
28362831
port.drawStyle(string, sampleStyle, 20, h+10, w, h, true, 1);
2837-
port.drawStyle(string, sampleStyle, 20, h*2+10, w, h, true, 2);
2838-
port.drawStyle(string, sampleStyle, 20, h*3+10, w, h, true, 3);
2832+
port.drawStyle(string, sampleStyle, 20, h*2+10, w-10, h, false, 2); // Not truncated
2833+
port.drawStyle(string, sampleStyle, 20, h*3+10, w-10, h, true, 3); // Truncated
28392834
}
28402835
}
28412836
});
@@ -3583,11 +3578,14 @@ application.add(sampleLabel2);
35833578
| Parameter | Type | Description |
35843579
| --- | --- | :--- |
35853580
| `bottom` | `number` | This style's bottom margin, in pixels (setting the `bottom` property of the created instance, and `bottom` in the created instance's `margins` property)
3586-
| `indentation` | `number` | This style's indentation--the indentation of the first line of a block, in pixels
35873581
| `leading` | `number` | This style's line height, or "leading"--the distance between lines of a block, in pixels. If 0 or unspecified, it is automatically calculated. Use a negative value to force a distance even if lines overlap.
35883582
| `left` | `number` | This style's left margin, in pixels (setting the `left` property of the created instance, and `left` in the created instance's `margins` property)
35893583
| `right` | `number` | This style's right margin, in pixels (setting the `right` property of the created instance, and `right` in the created instance's `margins` property)
35903584

3585+
<!-- TO DO:
3586+
| `indentation` | `number` | This style's indentation--the indentation of the first line of a block, in pixels
3587+
-->
3588+
35913589
##### Label styles only
35923590

35933591
| Parameter | Type | Description |
@@ -3617,7 +3615,6 @@ All properties of a `style` object are read-only, but you can change the style o
36173615
| `color` | `object` | `undefined` | This style's color(s), as an array of strings, or `undefined` if no color has been specified. The `state` property of the `content` object using the style determines the index of the array; if `state` is not an integer, colors from surrounding states are blended.
36183616
| `family` | `string` | | This style's font family
36193617
| `horizontal` | `string` | | This style's horizontal alignment, as `left`, `center` (the default), `right`, or `justify`
3620-
| `indentation` | `number` | | This style's indentation--the indentation of the first line of a block, in pixels **TO DO: test this**
36213618
| `leading` | `number` | | This style's line height (or "leading")--the distance between lines of a block, in pixels. If `0` or unspecified, it is automatically calculated
36223619
| `left` | `number` | 0 | The left margin of this style
36233620
| `margins` | `object` | | This style's margins, as an object with `left`, `right`, `top`, and `bottom` number properties, specified in pixels
@@ -3628,6 +3625,11 @@ All properties of a `style` object are read-only, but you can change the style o
36283625
| `vertical` | `string` | | This style's vertical alignment, as `top`, `middle` (the default), or `bottom`, specified in pixels
36293626
| `weight` | `number` | | The weight of this style's font
36303627

3628+
3629+
<!-- TO DO:
3630+
| `indentation` | `number` | | This style's indentation--the indentation of the first line of a block, in pixels
3631+
-->
3632+
36313633
##### Functions
36323634

36333635
**`measure(string)`**

0 commit comments

Comments
 (0)