Python Reference Guide
 
Loading...
Searching...
No Matches
FBLayout Class Reference

Used to build the user interface. More...

#include <pyfbsdk.h>

Inheritance diagram for FBLayout:

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)
 
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)
 
bool SizeRegion (str pName, int pW, int pH)
 Change a region's size.
 
- Public Member Functions inherited from FBVisualComponent
 FBVisualComponent ()
 Constructor.
 
bool AddChild (FBVisualComponent pChild, int pId=0)
 Add a child component.
 
FBVisualComponent GetChild (int pId=0)
 Get a child component.
 
QWidget GetQWidgetAddress ()
 Get internal QWidget.
 
bool IsView ()
 Is component a view?
 
 Refresh (bool pNow=False)
 Refresh component.
 
 ViewExpose ()
 Exposed view callback function.
 
 ViewInput (int pMouseX, int pMouseY, FBInputType pAction, int pButtonKey, int pModifier)
 Input callback function.
 
- Public Member Functions inherited from FBComponent
 FBComponent ()
 Constructor.
 
str ClassName ()
 Get the class name.
 
 DisableObjectFlags (FBObjectFlag pFlags)
 Disable a specific Object Flags.
 
 EnableObjectFlags (FBObjectFlag pFlags)
 Enable a specific Object Flags.
 
bool FBCreate ()
 Open Reality Creation function.
 
 FBDelete ()
 Open Reality deletion function.
 
 FBDestroy ()
 Open Reality destruction function.
 
FBObjectFlag GetObjectFlags ()
 Get all Object Flags (concatenated).
 
bool GetObjectStatus (FBObjectStatus pStatus)
 Check to see if an object status is enabled.
 
FBFileReference GetOwnerFileReference (p0)
 Get the owner FileReference object.
 
 HardSelect ()
 HardSelect.
 
bool HasObjectFlags (FBObjectFlag pFlags)
 Check whether a specific object flag is enabled.
 
bool Is (int pTypeId)
 Returns true if object is of type TypeId.
 
bool ProcessNamespaceHierarchy (FBNamespaceAction pNamespaceAction, str pNamespaceName, str pReplaceTo=None, bool pAddRight=True)
 ProcessNamespaceHierarchy.
 
bool ProcessObjectNamespace (FBNamespaceAction pNamespaceAction, str pNamespaceName, str pReplaceTo=None, bool pAddRight=True)
 ProcessObjectNamespace.
 
int PropertyAdd (FBProperty pProperty)
 Add a property to the component's property manager.
 
bool PropertyAddReferenceProperty (FBProperty pReferenceProperty)
 Add a reference property to the component's property manager.
 
FBProperty PropertyCreate (str pName, FBType pType, str pDataType, bool pAnimatable, bool pIsUser=False, FBProperty pReferenceSource=None)
 Create user or dynamic property.
 
 PropertyGetModifiedList (FBArrayTemplate< FB > pPropList, FBPlugModificationFlag pModificationFlags)
 Get list of properties which have been modified since last loading.
 
 PropertyRemove (FBProperty pProperty)
 Remove a Property from the component's Property manager.
 
 SetObjectFlags (FBObjectFlag pFlags)
 SetObjectFlags.
 
 SetObjectStatus (FBObjectStatus pStatus, bool pValue)
 Enable/Disable a specific Object Status.
 

Public Attributes

FBEvent OnIdle
 Event: Idle.

 
FBEvent OnInput
 Event: Input.

 
FBEvent OnPaint
 Event: Paint layout.

 
FBEvent OnPreShow
 Event: PreShow layout.

 
FBEvent OnResize
 Event: Resize layout.

 
FBEvent OnShow
 Event: Show layout.

 
- Public Attributes inherited from FBVisualComponent
str RegionName
 Read Write Property: Region name.
 
int RegionOffsetX
 Read Write Property: Region X offset.
 
int RegionOffsetY
 Read Write Property: Region Y offset.
 
int RegionOffsetWidth
 Read Write Property: Region width offset.
 
int RegionOffsetHeight
 Read Write Property: Region height offset.
 
float RegionRatioX
 Read Write Property: Ratio for X attachment.
 
float RegionRatioY
 Read Write Property: Ratio for Y attachment.
 
float RegionRatioWidth
 Read Write Property: Ratio for Width attachment.
 
float RegionRatioHeight
 Read Write Property: Ratio for Height attachment.

 
FBAttachType RegionAttachTypeX
 Read Write Property: X Attachment type.
 
FBAttachType RegionAttachTypeY
 Read Write Property: Y Attachment type.
 
FBAttachType RegionAttachTypeWidth
 Read Write Property: Width Attachment type.
 
FBAttachType RegionAttachTypeHeight
 Read Write Property: Height Attachment type.
 
FBVisualComponent RegionAttachToX
 Read Write Property X Attachment source.
 
FBVisualComponent RegionAttachToY
 Read Write Property: Y Attachment source.
 
FBVisualComponent RegionAttachToWidth
 Read Write Property: Width Attachment source.
 
FBVisualComponent RegionAttachToHeight
 Read Write Property: Height Attachment source.

 
int RegionPosMaxX
 Read Write Property: Region X position Max
 
int RegionPosMinX
 Read Write Property: Region X position Min
 
int RegionPosMaxY
 Read Write Property: Region Y position Max
 
int RegionPosMinY
 Read Write Property: Region Y position Min
 
str BorderCaption
 Read Write Property: Caption to display in border.
 
bool BorderShowCaption
 Read Write Property: Show caption?
 
FBBorderStyle BorderStyle
 Read Write Property: Style of border.
 
bool BorderInSet
 Read Write Property: Is border inset?
 
int BorderWidth
 Read Write Property: Width of border.
 
int BorderSpacing
 Read Write Property: Spacing of border.
 
float BorderMaxAngle
 Read Write Property: Max angle for rounding.
 
int BorderCornerRadius
 Read Write Property: Corner radius (rounded).

 
str Caption
 Property: Widget caption.

 
bool Enabled
 Read Write Property: Is visual enabled?

 
int Height
 Read Write Property: Height.

 
str Hint
 Read Write Property: Hint to show.

 
int Left
 Read Write Property: Left coordinate.

 
bool ReadOnly
 Read Write Property: Is visual component read only?

 
int Top
 Read Write Property: Top coordinate.

 
bool Visible
 Read Write Property: Is visual component visible?

 
int Width
 Read Write Property: Width.

 
- Public Attributes inherited from FBComponent
FBListComponent Components
 List: List of components.

 
str LongName
 Read Write Property: Name and namespace for object.

 
str Name
 Read Write Property: Unique name of object. See sample: RemoveSuffixFromNameOfSceneElements.py.
 
FBListComponent Parents
 List: Parents.

 
FBManager PropertyList
 Read Only Property: Manages all of the properties for the component.

 
bool Selected
 Read Write Property: Selected property.

 
int TypeInfo
 Contains the Type information of the object.

 
- Public Attributes inherited from FBPlug
str ClassGroupName
 ClassGroupName of the object.

 
int TypeInfo
 TypeInfo.

 

Detailed Description

Used to build the user interface.


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, FBBoxLayout and FBGridLayout 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: ShotTrackSetupTool.py, Attach.py, Border.py, Layout.py.

Constructor & Destructor Documentation

◆ FBLayout()

FBLayout ( )

Constructor.

Member Function Documentation

◆ AddRegion()

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.

Parameters
pNameName of region.
pTitleTitle to display.
pXX: Position.
pXTypeX: Type of attachment.
pXRelativeX: Item to attach to.
pMultXX: Multiplier of relative value.
pYY: Position.
pYTypeY: Type of attachment.
pYRelativeY: Item to attach to.
pMultYY: Multiplier of relative value.
pWW: Width of region.
pWTypeW: Type of attachment.
pWRelativeW: Item to attach to.
pMultWW: Multiplier of relative value.
pHH: Height of region.
pHTypeH: Type of attachment.
pHRelativeH: Item to attach to.
pMultHH: Multiplier of relative value.
Returns
Operation was successful (true or false).

◆ ClearControl()

ClearControl ( str  pName)

Remove a control from a region in a visual component.

Parameters
pNameName of region to remove control.

◆ GetControl()

FBVisualComponent GetControl ( str  pName)

Get control of a region in a visual component.

Parameters
pNameName of region to find.
Returns
The component if it is found.

◆ GetRegion()

bool GetRegion ( str  pName)

Verify if a region with pName exists.

Parameters
pNameName of region to check.
Returns
Operation was successful (true or false).

◆ GetRegionPositions()

bool GetRegionPositions ( str  pName,
bool  pComputed,
int  pX,
int  pY,
int  pW = None,
int  pH = None 
)

Get region pName information (position and size)

Parameters
pNameName of region.
pComputedIs the information retrieved relative or absolute?
pX(C++ only) Position in X of the region.
pY(C++ only) Position in Y of the region.
pW(C++ only) Width of the region.
pH(C++ only) Height of the region.
Returns
(C++) Operation was successful (true or false). (Python) A tuple containing the following information (pX, pY, pW, pH) or None if the operation was not successful.
Python
The function takes only the first two parameters and returns a Python tuple or None. ex: lTuple = lAnimationLayer.GetRegionPositions( name, computed )

◆ GetSplitStyle()

FBSplitStyle GetSplitStyle ( str  pName)

Get a region's splitstyle.

Parameters
pNameName of Region to get splitstyle from.
Returns
Split style of specified region.

◆ MoveRegion()

bool MoveRegion ( str  pName,
int  pX,
int  pY 
)

Move a region.

Parameters
pNameName of region to move.
pXNew X position.
pYNew Y position.
Returns
Operation was successful (true or false).

◆ RemoveRegion()

bool RemoveRegion ( str  pName)

Remove a region.

Parameters
pNameName of region to remove.
Returns
Operation was successful (true or false).

◆ RenameRegion()

bool RenameRegion ( str  pOldName,
str  pNewName 
)

Rename a region.

Parameters
pOldNameRegion's old name.
pNewNameRegion's new name.
Returns
Operation was successful (true or false).

◆ Restructure()

Restructure ( bool  pNoMove)

Force a recomputation of all region placements in the layout.

◆ SetAutoRestructure()

SetAutoRestructure ( bool  pAutoRestructure)

Suspend all automatic layout recomputation.

Parameters
pAutoRestructureIf true, Suspend all automatic layout recomputation, else restore it.

◆ SetBorder()

bool SetBorder ( str  pName,
FBBorderStyle  pType,
bool  pShowTitle,
bool  pInSet,
int  pWidth,
int  pSpacing,
float  pMaxAngle,
int  pCornerRadius 
)

Set border properties for a region.

Parameters
pNameName of Region to change border properties.
pTypeBorder style to use.
pShowTitleShow region title?
pInSetIs region inset?
pWidthBorder width.
pSpacingBorder spacing.
pMaxAngleMax angle for rounding.
pCornerRadiusCorner radius for rounding.
Returns
Operation was successful (true or false).

◆ SetControl() [1/2]

bool SetControl ( str  pName,
FBVisualComponent  pComponent 
)

Set control of a region to a visual component.

Parameters
pNameName of region to affect.
pComponentComponent to control region.
Returns
Operation was successful (true or false).

◆ SetControl() [2/2]

bool SetControl ( str  pName,
FBVisualComponent  pComponent 
)

◆ SetRegionTitle()

bool SetRegionTitle ( str  pName,
str  pTitle 
)

Set a region's title.

Parameters
pNameName of region to change title.
pTitleNew title for region.
Returns
Operation was successful (true or false).

◆ SetSplitStyle()

bool SetSplitStyle ( str  pName,
FBSplitStyle  pRegionType 
)

Set a region's splitstyle.

Parameters
pNameName of Region to set splitstyle.
pRegionTypeSplit style give to region.
Returns
Operation was successful (true or false).

◆ SetView() [1/2]

bool SetView ( str  pName,
FBVisualComponent  pComponent 
)

Set view.

Parameters
pNameName of Region.
pComponentComponent to set as view.
Returns
Operation was successful (true or false).

◆ SetView() [2/2]

bool SetView ( str  pName,
FBVisualComponent  pComponent 
)

◆ SizeRegion()

bool SizeRegion ( str  pName,
int  pW,
int  pH 
)

Change a region's size.

Parameters
pNameName of region to resize.
pWNew region width.
pHNew region height.
Returns
Operation was successful (true or false).

Member Data Documentation

◆ OnIdle

FBEvent OnIdle

Event: Idle.

◆ OnInput

FBEvent OnInput

Event: Input.

◆ OnPaint

FBEvent OnPaint

Event: Paint layout.

◆ OnPreShow

FBEvent OnPreShow

Event: PreShow layout.

◆ OnResize

FBEvent OnResize

Event: Resize layout.

◆ OnShow

FBEvent OnShow

Event: Show layout.