Public Types | Public Member Functions | Public Attributes

FBLayout Class Reference

This reference page is linked to from the following overview topics: Layouts.


Search for all occurrences

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

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.

Definition at line 776 of file fbcontrols.h.

#include <fbcontrols.h>

Inheritance diagram for FBLayout:
Inheritance graph
[legend]

List of all members.

Public Types

enum  FBSplitStyle { kFBNoSplit = 0, kFBHSplit = 1, kFBVSplit = 2, kFBHVSplit = 3 }
 

Type of split style (sub-division) for layout.

More...

Public Member Functions

 FBLayout (HIObject pObject=NULL)
 Constructor.
virtual bool AddRegion (const char *pName, const char *pTitle, int pX, FBAttachType pXType, const char *pXRelative, float pMultX, int pY, FBAttachType pYType, const char *pYRelative, float pMultY, int pW, FBAttachType pWType, const char *pWRelative, float pMultW, int pH, FBAttachType pHType, const char *pHRelative, float pMultH)
 Add a region to the layout.
virtual bool MoveRegion (const char *pName, int pX, int pY)
 Move a region.
virtual bool SizeRegion (const char *pName, int pW, int pH)
 Change a region's size.
virtual bool RemoveRegion (const char *pName)
 Remove a region.
virtual bool RenameRegion (const char *pOldName, const char *pNewName)
 Rename a region.
virtual bool GetRegion (const char *pName)
 Verify if a region with pName exists.
virtual bool GetRegionPositions (const char *pName, bool pComputed, int *pX, int *pY, int *pW=NULL, int *pH=NULL)
 Get region pName information (position and size)
virtual void ClearControl (const char *pName)
 Remove a control from a region in a visual component.
virtual FBVisualComponentGetControl (const char *pName)
 Get control of a region in a visual component.
virtual HIKtObject GetHIKtObject (const char *pName)
 Set or Get internal toolkit: object.
virtual bool SetHIKtView (const char *pName, HIKtView pView)
 Set internal toolkit view.
virtual HIKtView GetHIKtView (const char *pName)
 Get internal toolkit view.
virtual bool SetBorder (const char *pName, FBBorderStyle pType, bool pShowTitle, bool pInSet, int pWidth, int pSpacing, float pMaxAngle, int pCornerRadius)
 Set border properties for a region.
virtual bool SetSplitStyle (const char *pName, FBSplitStyle pRegionType)
 Set a region's splitstyle.
virtual FBSplitStyle GetSplitStyle (const char *pName)
 Get a region's splitstyle.
virtual bool SetRegionTitle (const char *pName, const char *pTitle)
 Set a region's title.
void SetAutoRestructure (bool pAutoRestructure)
 Suspend all automatic layout recomputation.
void Restructure (bool pNoMove)
 Force a recomputation of all region placements in the layout.
 IObject_Declare (K_IMPLEMENTATION)
virtual bool SetControl (const char *pName, FBVisualComponent *pComponent)
 Set control of a region to a visual component.
virtual bool SetControl (const char *pName, FBVisualComponent &pComponent)
virtual bool SetView (const char *pName, FBVisualComponent *pComponent)
 Set view.
virtual bool SetView (const char *pName, FBVisualComponent &pComponent)

Public Attributes

FBPropertyEvent OnInput
 Event: Input.
FBPropertyEvent OnPaint
 Event: Paint layout.
FBPropertyEvent OnIdle
 Event: Idle.
FBPropertyEvent OnShow
 Event: Show layout.
FBPropertyEvent OnResize
 Event: Resize layout.

Member Enumeration Documentation

Type of split style (sub-division) for layout.

Enumerator:
kFBNoSplit 

No split.

kFBHSplit 

Horizontal split.

kFBVSplit 

Vertical split.

kFBHVSplit 

Horizontal and Vertical split.

Definition at line 781 of file fbcontrols.h.

    {   
        kFBNoSplit  = 0,    
        kFBHSplit   = 1,    
        kFBVSplit   = 2,    
        kFBHVSplit  = 3     
    };

Constructor & Destructor Documentation

FBLayout ( HIObject  pObject = NULL)

Constructor.


Member Function Documentation

virtual bool AddRegion ( const char *  pName,
const char *  pTitle,
int  pX,
FBAttachType  pXType,
const char *  pXRelative,
float  pMultX,
int  pY,
FBAttachType  pYType,
const char *  pYRelative,
float  pMultY,
int  pW,
FBAttachType  pWType,
const char *  pWRelative,
float  pMultW,
int  pH,
FBAttachType  pHType,
const char *  pHRelative,
float  pMultH 
) [virtual]

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).
virtual bool MoveRegion ( const char *  pName,
int  pX,
int  pY 
) [virtual]

Move a region.

Parameters:
pNameName of region to move.
pXNew X position.
pYNew Y position.
Returns:
Operation was successful (true or false).
virtual bool SizeRegion ( const char *  pName,
int  pW,
int  pH 
) [virtual]

Change a region's size.

Parameters:
pNameName of region to resize.
pWNew region width.
pHNew region height.
Returns:
Operation was successful (true or false).
virtual bool RemoveRegion ( const char *  pName) [virtual]

Remove a region.

Parameters:
pNameName of region to remove.
Returns:
Operation was successful (true or false).
virtual bool RenameRegion ( const char *  pOldName,
const char *  pNewName 
) [virtual]

Rename a region.

Parameters:
pOldNameRegion's old name.
pNewNameRegion's new name.
Returns:
Operation was successful (true or false).
virtual bool GetRegion ( const char *  pName) [virtual]

Verify if a region with pName exists.

Parameters:
pNameName of region to check.
Returns:
Operation was successful (true or false).
virtual bool GetRegionPositions ( const char *  pName,
bool  pComputed,
int *  pX,
int *  pY,
int *  pW = NULL,
int *  pH = NULL 
) [virtual]

Get region pName information (position and size)

Parameters:
pNameName of region.
pComputedIs the information retrieved relative or absolute?
Return values:
pXPosition in X of the region.
pYPosition in Y of the region.
pWWidth of the region.
pHHeight of the region.
Returns:
Operation was successful (true or false).
virtual bool SetControl ( const char *  pName,
FBVisualComponent pComponent 
) [virtual]

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).
virtual bool SetControl ( const char *  pName,
FBVisualComponent pComponent 
) [virtual]
virtual void ClearControl ( const char *  pName) [virtual]

Remove a control from a region in a visual component.

Parameters:
pNameName of region to remove control.
virtual FBVisualComponent* GetControl ( const char *  pName) [virtual]

Get control of a region in a visual component.

Parameters:
pNameName of region to find.
Returns:
The component if it is found.
virtual HIKtObject GetHIKtObject ( const char *  pName) [virtual]

Set or Get internal toolkit: object.

Parameters:
pNameName of region.
Returns:
Handle to internal toolkit object.
virtual bool SetHIKtView ( const char *  pName,
HIKtView  pView 
) [virtual]

Set internal toolkit view.

Parameters:
pNameName of region.
pViewView to set as view for region.
Returns:
Operation was successful (true or false).
virtual HIKtView GetHIKtView ( const char *  pName) [virtual]

Get internal toolkit view.

Parameters:
pNameName of region.
Returns:
Handle to internal toolkit view object.
virtual bool SetView ( const char *  pName,
FBVisualComponent pComponent 
) [virtual]

Set view.

Parameters:
pNameName of Region.
pComponentComponent to set as view.
Returns:
Operation was successful (true or false).
virtual bool SetView ( const char *  pName,
FBVisualComponent pComponent 
) [virtual]
virtual bool SetBorder ( const char *  pName,
FBBorderStyle  pType,
bool  pShowTitle,
bool  pInSet,
int  pWidth,
int  pSpacing,
float  pMaxAngle,
int  pCornerRadius 
) [virtual]

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).
virtual bool SetSplitStyle ( const char *  pName,
FBSplitStyle  pRegionType 
) [virtual]

Set a region's splitstyle.

Parameters:
pNameName of Region to set splitstyle.
pRegionTypeSplit style give to region.
Returns:
Operation was successful (true or false).
virtual FBSplitStyle GetSplitStyle ( const char *  pName) [virtual]

Get a region's splitstyle.

Parameters:
pNameName of Region to get splitstyle from.
Returns:
Split style of specified region.
virtual bool SetRegionTitle ( const char *  pName,
const char *  pTitle 
) [virtual]

Set a region's title.

Parameters:
pNameName of region to change title.
pTitleNew title for region.
Returns:
Operation was successful (true or false).
void SetAutoRestructure ( bool  pAutoRestructure)

Suspend all automatic layout recomputation.

Parameters:
pAutoRestructureIf true, Suspend all automatic layout recomputation, else restore it.
void Restructure ( bool  pNoMove)

Force a recomputation of all region placements in the layout.

IObject_Declare ( K_IMPLEMENTATION  )

Member Data Documentation

Event: Input.

Definition at line 971 of file fbcontrols.h.

Event: Paint layout.

Definition at line 972 of file fbcontrols.h.

Event: Idle.

Definition at line 973 of file fbcontrols.h.

Event: Show layout.

Definition at line 974 of file fbcontrols.h.

Event: Resize layout.

Definition at line 975 of file fbcontrols.h.


The documentation for this class was generated from the following file:

FBLayout FBLayout FBLayout FBLayout FBLayout FBLayout FBLayout FBLayout FBLayout FBLayout
FBLayout FBLayout FBLayout FBLayout FBLayout FBLayout FBLayout FBLayout FBLayout FBLayout