Layouts manage areas of the screen called regions. Regions contain UI components such as buttons, viewers, and edit boxes. Regions are added to layouts. When a UI component is bound to a region, the region defines how big it is and how it behaves when the layout is resized.Types of Layouts Device Constraint Manipulator Shader A region is first defined using the FBLayout::AddRegion() function. Once a region is defined and the corresponding UI component is created, and the component is bound to its region with FBLayout::SetControl(). You can use the FBSystem::OnUIIdle() in your layout to update real-time UI components such as guages and status indicators. In Python, BoxLayout and GridLayout take care of most of the region handling. They are used to create basic control layouts for simple tools. If you have a lot of content you can use FBScrollBox to manage it. For an example, see the Python sample Scrollbox.py.* Also see the Python sample Layout.py, and the C++ sample ortooluidemo.
See samples: KeyboardMapper.py, ShotTrackSetupTool.py, Attach.py, Border.py, Layout.py.
Public Member Functions |
|
FBLayout () | |
Constructor. |
|
bool | AddRegion (str pName, str pTitle, int pX, FBAttachType pXType, str pXRelative, float pMultX, int pY, FBAttachType pYType, str pYRelative, float pMultY, int pW, FBAttachType pWType, str pWRelative, float pMultW, int pH, FBAttachType pHType, str pHRelative, float pMultH) |
Add a region to the layout. |
|
ClearControl (str pName) | |
Remove a control from a region in a visual
component. |
|
FBVisualComponent | GetControl (str pName) |
Get control of a region in a visual
component. |
|
bool | GetRegion (str pName) |
Verify if a region with pName exists.
|
|
bool | GetRegionPositions (str pName, bool pComputed, int pX, int pY, int pW=None, int pH=None) |
Get region pName information
(position and size). |
|
FBSplitStyle | GetSplitStyle (str pName) |
Get a region's splitstyle. |
|
bool | MoveRegion (str pName, int pX, int pY) |
Move a region. |
|
bool | RemoveRegion (str pName) |
Remove a region. |
|
bool | RenameRegion (str pOldName, str pNewName) |
Rename a region. |
|
Restructure (bool pNoMove) | |
Force a recomputation of all region
placements in the layout. |
|
SetAutoRestructure (bool pAutoRestructure) | |
Suspend all automatic layout recomputation.
|
|
bool | SetBorder (str pName, FBBorderStyle pType, bool pShowTitle, bool pInSet, int pWidth, int pSpacing, float pMaxAngle, int pCornerRadius) |
Set border properties for a region. |
|
bool | SetControl (str pName, FBVisualComponent pComponent) |
Set control of a region to a visual
component. |
|
bool | SetControl (str pName, FBVisualComponent pComponent) |
Set control of a region to a visual
component. |
|
bool | SetRegionTitle (str pName, str pTitle) |
Set a region's title. |
|
bool | SetSplitStyle (str pName, FBSplitStyle pRegionType) |
Set a region's splitstyle. |
|
bool | SetView (str pName, FBVisualComponent pComponent) |
Set view. |
|
bool | SetView (str pName, FBVisualComponent pComponent) |
Set view. |
|
bool | SizeRegion (str pName, int pW, int pH) |
Change a region's size. |
|
Public Attributes |
|
FBEvent | OnIdle |
Event: Idle. |
|
FBEvent | OnInput |
Event: Input. |
|
FBEvent | OnPaint |
Event: Paint layout. |
|
FBEvent | OnResize |
Event: Resize layout. |
|
FBEvent | OnShow |
Event: Show layout. |
FBLayout | ( | ) |
Constructor.
bool AddRegion | ( | str | pName, | |
str | pTitle, | |||
int | pX, | |||
FBAttachType | pXType, | |||
str | pXRelative, | |||
float | pMultX, | |||
int | pY, | |||
FBAttachType | pYType, | |||
str | pYRelative, | |||
float | pMultY, | |||
int | pW, | |||
FBAttachType | pWType, | |||
str | pWRelative, | |||
float | pMultW, | |||
int | pH, | |||
FBAttachType | pHType, | |||
str | pHRelative, | |||
float | pMultH | |||
) |
Add a region to the layout.
pName | Name of region. | |
pTitle | Title to display. | |
pX | X: Position. | |
pXType | X: Type of attachment. | |
pXRelative | X: Item to attach to. | |
pMultX | X: Multiplier of relative value. | |
pY | Y: Position. | |
pYType | Y: Type of attachment. | |
pYRelative | Y: Item to attach to. | |
pMultY | Y: Multiplier of relative value. | |
pW | W: Width of region. | |
pWType | W: Type of attachment. | |
pWRelative | W: Item to attach to. | |
pMultW | W: Multiplier of relative value. | |
pH | H: Height of region. | |
pHType | H: Type of attachment. | |
pHRelative | H: Item to attach to. | |
pMultH | H: Multiplier of relative value. |
ClearControl | ( | str | pName | ) |
Remove a control from a region in a visual component.
pName | Name of region to remove control. |
FBVisualComponent GetControl | ( | str | pName | ) |
Get control of a region in a visual component.
pName | Name of region to find. |
Verify if a region with pName exists.
pName | Name of region to check. |
Get region pName information (position and size).
pName | Name of region. | |
pComputed | Is the information retrieved relative or absolute? | |
pX | Position in X of the region. | |
pY | Position in Y of the region. | |
pW | Width of the region. | |
pH | Height of the region. |
FBSplitStyle GetSplitStyle | ( | str | pName | ) |
Get a region's splitstyle.
pName | Name of Region to get splitstyle from. |
Move a region.
pName | Name of region to move. | |
pX | New X position. | |
pY | New Y position. |
Remove a region.
pName | Name of region to remove. |
Rename a region.
pOldName | Region's old name. | |
pNewName | Region's new name. |
Restructure | ( | bool | pNoMove | ) |
Force a recomputation of all region placements in the layout.
SetAutoRestructure | ( | bool | pAutoRestructure | ) |
Suspend all automatic layout recomputation.
pAutoRestructure | If true, Suspend all automatic layout recomputation, else restore it. |
bool SetBorder | ( | str | pName, | |
FBBorderStyle | pType, | |||
bool | pShowTitle, | |||
bool | pInSet, | |||
int | pWidth, | |||
int | pSpacing, | |||
float | pMaxAngle, | |||
int | pCornerRadius | |||
) |
Set border properties for a region.
pName | Name of Region to change border properties. | |
pType | Border style to use. | |
pShowTitle | Show region title? | |
pInSet | Is region inset? | |
pWidth | Border width. | |
pSpacing | Border spacing. | |
pMaxAngle | Max angle for rounding. | |
pCornerRadius | Corner radius for rounding. |
bool SetControl | ( | str | pName, | |
FBVisualComponent | pComponent | |||
) |
Set control of a region to a visual component.
pName | Name of region to affect. | |
pComponent | Component to control region. |
bool SetControl | ( | str | pName, | |
FBVisualComponent | pComponent | |||
) |
Set control of a region to a visual component.
pName | Name of region to affect. | |
pComponent | Component to control region. |
Set a region's title.
pName | Name of region to change title. | |
pTitle | New title for region. |
bool SetSplitStyle | ( | str | pName, | |
FBSplitStyle | pRegionType | |||
) |
Set a region's splitstyle.
pName | Name of Region to set splitstyle. | |
pRegionType | Split style give to region. |
bool SetView | ( | str | pName, | |
FBVisualComponent | pComponent | |||
) |
Set view.
pName | Name of Region. | |
pComponent | Component to set as view. |
bool SetView | ( | str | pName, | |
FBVisualComponent | pComponent | |||
) |
Set view.
pName | Name of Region. | |
pComponent | Component to set as view. |
Change a region's size.
pName | Name of region to resize. | |
pW | New region width. | |
pH | New region height. |