DisplayAutoLayouter
This class facilitates the layouting of Views inside a Display by encapsulating logic to generate layouts for dynamic view configurations based on a customizable set of layouting algorithms.
Extends
Methods
| Method | Description |
|---|---|
| setLayoutMode() | Sets the current view layout mode. |
| currentMode() | Returns the current view layout mode. |
| setMaximizedView() | Sets an optional view that should be shown alone in a maximized fashion. |
| isViewHidden() | Returns whether view should be hidden in the generated DisplayLayout. |
| setViewHidden() | Sets whether view should be hidden in the generated DisplayLayout. |
| onModeChanged() | Fires when the layout mode changes. |
| onViewHiddenChanged() | Fires when a view's hidden state changes. |
Inherited from ClassHandle
| Method | Description |
|---|---|
| isAliasOf() | Returns true if this handle and other alias the same underlying C++ object. |
| delete() | Releases this JavaScript handle. |
| deleteLater() | Schedules this handle for deferred deletion and returns this handle. |
| isDeleted() | Returns true if this handle has already been deleted. |
| [dispose]() | Releases this handle when the enclosing scope exits, so a handle can be declared with using instead of calling delete() later manually. |
| clone() | Returns a new JavaScript handle aliasing the same underlying C++ object. |
setLayoutMode()
setLayoutMode(mode: DisplayLayoutMode): void;Sets the current view layout mode.
Parameters
| Parameter | Type |
|---|---|
mode | DisplayLayoutMode |
Returns
void
currentMode()
currentMode(): DisplayLayoutMode;Returns the current view layout mode.
Returns
setMaximizedView()
setMaximizedView(view: View | null): void;Sets an optional view that should be shown alone in a maximized fashion.
Parameters
| Parameter | Type |
|---|---|
view | View | null |
Returns
void
isViewHidden()
isViewHidden(view: View | null): boolean;Returns whether view should be hidden in the generated DisplayLayout.
Note that the naming of this function was chosen carefully to express the visibility logic of DisplayAutoLayouter. The "hidden" state of a view serves only as input to the layouting algorithm. Marking a view as hidden means that it will never be considered during layouting and thus never be visible. However, a view that is not marked hidden may still not appear in the resulting currentLayout():
Parameters
| Parameter | Type |
|---|---|
view | View | null |
Returns
boolean
setViewHidden()
setViewHidden(view: View | null, value: boolean): void;Sets whether view should be hidden in the generated DisplayLayout.
Parameters
| Parameter | Type | Description |
|---|---|---|
view | View | null | - |
value | boolean | Whether the view should be hidden |
Returns
void
See
isViewHidden()
onModeChanged()
onModeChanged(callback: (mode: DisplayLayoutMode) => void): () => void;Fires when the layout mode changes.
Parameters
| Parameter | Type |
|---|---|
callback | (mode: DisplayLayoutMode) => void |
Returns
Unsubscribe function.
() => void
onViewHiddenChanged()
onViewHiddenChanged(callback: (view: View, hidden: boolean) => void): () => void;Fires when a view's hidden state changes.
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | (view: View, hidden: boolean) => void | Called with the view and its new hidden state. |
Returns
Unsubscribe function.
() => void