TDockPnel

Source: source/internal/tdockpnel.prg

Inherits from: TControl

TDockPnel is a dockable panel control that provides a floating/tool window with a title bar and an inner content area. It supports multiple content modes (nMode: 1=TPanel, 2=TScrollPanel, 9=TDialog) and various control types (nType: 1=ButtonBar, 2=TTitle, 3=TRibbonBar, 4=TFolderEx, 5=TXBrowse). The panel can be docked to any edge and supports splitter-based resizing.

Key DATA Members

DATATypeDescription
nModeNumericContent mode: 1=TPanel, 2=TScrollPanel, 9=TDialog
oPnelP / oPnelHObjectPanel body and header controls
nHTitNumericTitle bar height
nTypeNumericControl type: 1=ButtonBar, 2=TTitle, 3=TRibbonBar, 4=TFolderEx, 5=TXBrowse
nClrPane / nClrTextNumericPanel area colors
nClrPaneH / nClrTextHNumericHeader area colors
lBottomLogical.T. to dock at the bottom edge
lSplitVLogical.T. for a vertical splitter handle

Methods

MethodDescription
New( oWnd, nT, nL, nB, nR, cT, nBord, nClrT, nClrP, lClient )Create a dockable panel with position, caption, border, and colors
Activate()Show and activate the panel window
SetCaption( c )Set the title bar caption text
SetPosTitle( l )Set the title position (logical flag)
SetBorderSize( n )Set the border width in pixels
SetColors( nT, nP, nTH, nPH )Set text and pane colors for body and header
SetTypeCtrl( n )Set the control type (1-5)
SetCtrlsPnel( u )Attach a control or array of controls to the panel
SetImgsFiles( aBtns )Set button images from file paths
SetImgsResources( aBtns )Set button images from resource names
SetSplitV( nPos, lLeft, nW, nClrS )Configure a vertical splitter at position nPos
SetStyle( n )Set visual style (1-52 predefined styles)

Example: Dock Panel with XBrowse

#include "FiveWin.ch"

function Main()

   local oWnd, oDock, oBrw

   DEFINE WINDOW oWnd TITLE "Dock Panel Demo" SIZE 800, 600

   // Create a dock panel with XBrowse content
   oDock := TDockPnel():New( oWnd, 30, 10, 400, 600, "Data Browser", ;
                              1, CLR_BLACK, RGB(240,240,255), .F. )

   oDock:nType := 5   // TXBrowse content

   // Configure XBrowse columns
   oBrw := TXBrowse():New( oDock:oPnelP )
   oBrw:AddCol( "Name" )
   oBrw:AddCol( "Value" )
   oBrw:lRecordSelector := .F.

   oDock:SetCtrlsPnel( oBrw )
   oDock:SetColors( CLR_BLACK, RGB(240,240,255), CLR_WHITE, RGB(50,100,200) )
   oDock:Activate()

   ACTIVATE WINDOW oWnd MAXIMIZED

return nil

Notes

See Also