GuiRolloutCtrl

consoledoc.h

A container that shows a single child with an optional header bar that can be used to collapse and expand the rollout.

More...

Rollout

string

Text label to display on the rollout header.

RectI

Margin to put around child control.

int

Default height of the client area. This is used when no child control has been added to the rollout.

bool

The current rollout expansion state.

bool

Whether the rollout can be collapsed by clicking its header.

bool

Whether to render the rollout header.

bool

Whether to automatically collapse sibling rollouts.

Callbacks

void

Called when the user right-clicks on the rollout's header. This is useful for implementing context menus for rollouts.

void

Called when the rollout is expanded.

void

Called when the rollout is collapsed.

Public Functions

void

Collapse the rollout if it is currently expanded. This will make the rollout's child control invisible.

void

Expand the rollout if it is currently collapsed. This will make the rollout's child control visible.

void

Instantly collapse the rollout without animation. To smoothly slide the rollout to collapsed state, use collapse().

void

Instantly expand the rollout without animation. To smoothly slide the rollout to expanded state, use expand().

bool

Determine whether the rollout is currently expanded, i.e. whether the child control is visible.

void

Resize the rollout to exactly fit around its child control. This can be used to manually trigger a recomputation of the rollout size.

void

Toggle the current collapse state of the rollout. If it is currently expanded, then collapse it. If it is currently collapsed, then expand it.

void
toggleExpanded(bool instantly)

Toggle the current expansion state of the rollout If it is currently expanded, then collapse it. If it is currently collapsed, then expand it.

Detailed Description

A container that shows a single child with an optional header bar that can be used to collapse and expand the rollout.

A rollout is a container that can be collapsed and expanded using smooth animation. By default, rollouts will display a header with a caption along the top edge of the control which can be clicked by the user to toggle the collapse state of the rollout.

Rollouts will automatically size themselves to exactly fit around their child control. They will also automatically position their child control in their upper left corner below the header (if present).

note:

GuiRolloutCtrls will only work correctly with a single child control. To put multiple controls in a rollout, put them in their own group using a new GuiControl which then can be put inside the rollout.

Rollout

string caption 

Text label to display on the rollout header.

RectI margin 

Margin to put around child control.

int defaultHeight 

Default height of the client area. This is used when no child control has been added to the rollout.

bool expanded 

The current rollout expansion state.

bool clickCollapse 

Whether the rollout can be collapsed by clicking its header.

bool hideHeader 

Whether to render the rollout header.

note:

If this is false, the user cannot toggle the rollout state with the mouse.

bool autoCollapseSiblings 

Whether to automatically collapse sibling rollouts.

If this is true, the rollout will automatically collapse all sibling rollout controls when it is expanded. If this is false, the auto-collapse behavior can be triggered by CTRL (CMD on MAC) clicking the rollout header. CTRL/CMD clicking also works if this is false, in which case the auto-collapsing of sibling controls will be temporarily deactivated.

Callbacks

onHeaderRightClick()

Called when the user right-clicks on the rollout's header. This is useful for implementing context menus for rollouts.

onExpanded()

Called when the rollout is expanded.

onCollapsed()

Called when the rollout is collapsed.

Public Functions

collapse()

Collapse the rollout if it is currently expanded. This will make the rollout's child control invisible.

note:

The rollout will animate to collapsed state. To instantly collapse without animation, use instantCollapse().

expand()

Expand the rollout if it is currently collapsed. This will make the rollout's child control visible.

note:

The rollout will animate to expanded state. To instantly expand without animation, use instantExpand().

instantCollapse()

Instantly collapse the rollout without animation. To smoothly slide the rollout to collapsed state, use collapse().

instantExpand()

Instantly expand the rollout without animation. To smoothly slide the rollout to expanded state, use expand().

isExpanded()

Determine whether the rollout is currently expanded, i.e. whether the child control is visible.

return:

True if the rollout is expanded, false if not.

sizeToContents()

Resize the rollout to exactly fit around its child control. This can be used to manually trigger a recomputation of the rollout size.

toggleCollapse()

Toggle the current collapse state of the rollout. If it is currently expanded, then collapse it. If it is currently collapsed, then expand it.

toggleExpanded(bool instantly)

Toggle the current expansion state of the rollout If it is currently expanded, then collapse it. If it is currently collapsed, then expand it.

Parameters:

instant

If true, the rollout will toggle its state without animation. Otherwise, the rollout will smoothly slide into the opposite state.