- CM :
ConsoleManager the instance of ConsoleManager (singleton)
- page2Title :
string The title of page2.
- page1Title :
string The application title.
- DoubleLayoutOptions :
Object The type containing all the possible options for the DoubleLayout.
The type containing all the possible options for the DoubleLayout.
Kind: global interface
Properties
| Name | Type | Description |
|---|---|---|
| [showTitle] | boolean |
If the title should be shown. |
| [boxed] | boolean |
If the layout should be boxed. |
| [boxColor] | ForegroundColorName | HEX | RGB | "" |
The color of the box taken from the chalk library. |
| [boxStyle] | "bold" |
If the border of the box should be bold. |
| [changeFocusKey] | string |
The key that should be pressed to change the focus. |
| [direction] | "horizontal" | "vertical" |
The direction of the layout. |
| [page1Title] | string |
The title of the first page. |
| [page2Title] | string |
The title of the second page. |
| [pageRatio] | Array.<number> |
The ratio of the pages. (in horizontal direction) |
| [fitHeight] | boolean |
If the height of the pages should be the same. |
Kind: global class
This class is a layout that has two pages.
| Param | Type | Description |
|---|---|---|
| page1 | PageBuilder |
The first page. |
| page2 | PageBuilder |
The second page. |
| options | boolean |
Layout options. |
| selected | number |
The selected page. |
Example
const layout = new DoubleLayout(page1, page2, true, 0)This function is used to overwrite the page content.
Kind: instance method of DoubleLayout
| Param | Type | Description |
|---|---|---|
| page | PageBuilder |
the page to be added |
This function is used to overwrite the page content.
Kind: instance method of DoubleLayout
| Param | Type | Description |
|---|---|---|
| page | PageBuilder |
the page to be added |
This function is used to overwrite the page content.
Kind: instance method of DoubleLayout
| Param | Type | Description |
|---|---|---|
| page | PageBuilder |
the page to be added |
This function is used to set the page titles.
Kind: instance method of DoubleLayout
| Param | Type | Description |
|---|---|---|
| titles | Array.<string> |
the titles of the pages |
Example
layout.setTitles(["Page 1", "Page 2"])This function is used to set the page title at the given index.
Kind: instance method of DoubleLayout
| Param | Type | Description |
|---|---|---|
| title | string |
the title of the page |
| index | number |
the index of the page |
Example
layout.setTitle("Page 1", 0)This function is used to enable or disable the layout border.
Kind: instance method of DoubleLayout
| Param | Type | Description |
|---|---|---|
| border | boolean |
enable or disable the border |
This function is used to choose the page to be highlighted.
Kind: instance method of DoubleLayout
| Param | Type | Description |
|---|---|---|
| selected | number |
0 for page1, 1 for page2 |
This function is used to get the selected page.
Kind: instance method of DoubleLayout
Returns: number -
0 for page1, 1 for page2
This function is used to get switch the selected page.
Kind: instance method of DoubleLayout
This function is used to draw a single line of the layout to the screen. It also trim the line if it is too long.
Kind: instance method of DoubleLayout
| Param | Type | Description |
|---|---|---|
| line | Array.<StyledElement> |
the line to be drawn |
| lineIndex | number |
the index of the selected line |
This function is used to draw the layout to the screen.
Kind: instance method of DoubleLayout
Example
layout.draw()the instance of ConsoleManager (singleton)
The title of page2.
The application title.
Kind: global constant
