TFolderEx

Source: source/classes/tfoldex.prg

Inherits from: TControl

TFolderEx is an extended tabbed folder control that supports multiple tab layouts (top, left, bottom, right), gradient rendering, bitmaps per tab, animation, drag-reordering, per-tab enable/disable/hide, and multi-line tabs. It is the primary tab control used in modern FWH applications, offering a rich alternative to the standard TFolder.

Key DATA Members

DATATypeDescription
aDialogsArrayArray of child dialog objects for each tab page
aPromptsArrayArray of tab caption strings
aEnableArrayArray of logical values: enabled state per tab
aBitmapsArrayArray of bitmap handles for each tab icon
aAlignArrayPer-tab text alignment: AL_LEFT, AL_RIGHT, AL_CENTER
nLayOutNumericTab position: TOP (1), LEFT (2), BOTTOM (3), RIGHT (4)
nOptionNumericCurrently selected tab index (1-based)
nOverNumericTab index that the mouse is currently hovering over
nSeparatorNumericPixel gap between adjacent tabs
nRoundNumericCorner radius for tab backgrounds
aGradSelArrayGradient for the selected tab
aGradUnselArrayGradient for unselected tabs
aGradOverArrayGradient for the hovered tab
aGradDisArrayGradient for disabled tabs
lAnimationLogicalEnable animated transition when switching tabs
lMultiLineLogicalAllow tabs to wrap to multiple rows
lStretchLogicalStretch tabs to fill the available width

Methods

MethodDescription
New( nRow, nCol, nW, nH, oWnd, aBitmaps, lPixel, lDesign, aPrompts, nFolH, nLayOut, ... )Create an extended folder with prompts, bitmaps, layout direction and gradients
SetOption( nOption )Activate a tab by its 1-based index
AddItem( cPrompt, cBmp, oDlg )Add a new tab with prompt, optional bitmap and dialog page
DelItem( nOption )Remove a tab and its associated dialog page
MoveTab( nNewPos )Move a tab to a new position (drag reorder support)
DisableTab( nOption )Disable a specific tab
EnableTab( nOption )Enable a previously disabled tab
HideTab( nOption )Hide a specific tab
ShowTab( nOption )Show a previously hidden tab
AnimateOpt( nOption, nOldOption )Play the animated transition between old and new tab
ChangeOrder()Apply the current order array (aOrder) to rearrange tabs
SetBitmap( cBmp, nOption )Change the bitmap for a specific tab
SetLayOut( nLayOut, ... )Change the tab layout direction (TOP/LEFT/BOTTOM/RIGHT) and update gradients
SetDefColors( aGradSel, aGradUnsel, aGradOver, aGradDis )Set default gradient arrays for all tab states

Example: 3-Tab Folder with Icons

#include "FiveWin.ch"

function Main()

   local oWnd, oFolder, oDlg1, oDlg2, oDlg3

   DEFINE WINDOW oWnd TITLE "TFolderEx Demo" SIZE 600, 400

   oDlg1 := TDlg():New( 0, 0, 300, 200, "General", , , , , , , oWnd )
   oDlg2 := TDlg():New( 0, 0, 300, 200, "Options", , , , , , , oWnd )
   oDlg3 := TDlg():New( 0, 0, 300, 200, "About",   , , , , , , oWnd )

   @ 20, 20 FOLDEREX oFolder ;
        PROMPTS "General", "Options", "About" ;
        DIALOGS oDlg1, oDlg2, oDlg3 ;
        SIZE 560, 360 OF oWnd ;
        LAYOUT TOP

   ACTIVATE WINDOW oWnd CENTERED

return nil

Notes

See Also