Additional Classes Reference

This page documents important FiveWin classes and features that are not covered in the main class reference pages. Each entry includes a brief description, key DATA and METHODs, and a practical example.

Class Map

graph LR subgraph "UI Components" EXPLBAR["TExplorerBar
Collapsible Panels"] NAV["TNavigator
Navigation Panels"] CFLOW["TCoverFlow
Image Browser"] BTABS["TBarTabs
Tab Button Bar"] end subgraph "Data & Documents" XML["TXmlDocument
XML Parsing"] WBOOK["TWorkBook
Excel XLSX"] BCHAIN["TBlockChain
Blockchain"] end subgraph "Internet & Media" WCLIENT["TWebClient
HTTP Client"] WEBCAM["TWebCam
Camera Capture"] end subgraph "Development" DBG["TDbg
Debugger"] GDIP["Graphics
GDI+ Classes"] end subgraph "Features" DARK["Dark Mode
FW_SetDarkMode()"] VIDE["Visual IDE
Form Designer"] end

TXmlDocument — XML Parsing & Creation

TXmlDocument is provided by Harbour's hbxml contrib library and is used extensively in FiveWin samples (23+ examples). It provides DOM-style XML parsing from files or strings, with iteration via TXmlIterator.

Key DATA

DATATypeDescription
oRootTXmlNodeRoot node of the parsed XML document
nStatusNumericParse status (0 = success)
nErrorNumericError code if parsing failed
nLineNumericLine number where error occurred

Key METHODs

METHODDescription
New( hFile | cString )Parse XML from file handle or string
Read( hFile )Read and parse from an open file handle
ToString()Serialize the document back to XML string
Write( hFile )Write the document to a file handle

TXmlNode (child nodes)

DATA/METHODDescription
cNameTag name of the node
cDataText content of the node
aAttributesHash of attribute name/value pairs
oChildFirst child node
oNextNext sibling node
AddBelow( oNode )Add a child node

Example

#include "FiveWin.ch"

function Main()

   local hFile    := FOpen( "config.xml" )
   local oXmlDoc  := TXmlDocument():New( hFile )
   local oXmlIter := TXmlIterator():New( oXmlDoc:oRoot )
   local oTag

   while ( oTag := oXmlIter:Next() ) != nil
      MsgInfo( oTag:cName + ": " + oTag:cData )
      // Access attributes:
      // HEval( oTag:aAttributes, { |k,v| QOut( k, v ) } )
   end

   FClose( hFile )

return nil

TExplorerBar — Collapsible Panel Container

An Explorer-style sidebar with collapsible task panels. Each panel has a gradient title bar that toggles collapse/expand on click, and a body area where you can place links or any controls. Inherits from TControl.

Source: source/classes/texplbar.prg

Key DATA

DATATypeDescription
aPanelsArrayArray of TTaskPanel objects
nTopColorNumericTop gradient color (default: blue)
nBottomColorNumericBottom gradient color
oVScrollTScrollBarVertical scrollbar (auto-managed)

Key METHODs

METHODDescription
New( nTop, nLeft, nWidth, nHeight, oWnd )Create the explorer bar
AddPanel( cName, cBmpName, nBodyHeight )Add a collapsible panel; returns a TTaskPanel
CloseAll( nExcept )Collapse all panels except the specified one
Update( nPos )Reposition all panels starting at nPos

TTaskPanel (individual panels)

DATA/METHODDescription
cTitlePanel title text
lCollapsed.T. when collapsed
nBodyHeightHeight of the content area
nTitleHeightHeight of the title bar (default: 25)
AddLink( cPrompt, bAction, cBitmap )Add a clickable URL-style link to the panel body
ChangeHeight( nHeight )Dynamically resize the panel
bOnCollapseCodeblock evaluated when panel is collapsed/expanded

Example

#include "FiveWin.ch"

function Main()

   local oWnd, oExBar, oPanel1, oPanel2

   DEFINE WINDOW oWnd TITLE "Explorer Bar Demo" SIZE 300, 500

   oExBar := TExplorerBar():New( 0, 0, 300, 500, oWnd )

   oPanel1 := oExBar:AddPanel( "File Tasks", , 120 )
   oPanel1:AddLink( "Create new folder",  { || MsgInfo( "New Folder" ) } )
   oPanel1:AddLink( "Delete this file",   { || MsgInfo( "Delete" ) } )
   oPanel1:AddLink( "Share this folder",   { || MsgInfo( "Share" ) } )

   oPanel2 := oExBar:AddPanel( "Other Tasks", , 80 )
   oPanel2:AddLink( "Map network drive",  { || MsgInfo( "Map Drive" ) } )
   oPanel2:AddLink( "System properties",  { || MsgInfo( "Properties" ) } )

   ACTIVATE WINDOW oWnd

return nil

TNavigator — Collapsible Navigation Panel

A visually rich collapsible navigation panel with gradient backgrounds, optional bitmap backgrounds, and smooth expand/collapse animation. Similar to Outlook's navigation pane. Inherits from TControl.

Source: source/classes/navpanels.prg

Key DATA

DATATypeDescription
lExpandedLogical.T. when panel is expanded (default: .T.)
cTitleCharacterPanel title text
cImageCharacterBackground image resource name
nTitleHeightNumericTitle bar height (default: 40)
nTopColor / nBottomColorNumericGradient colors
nWidthClosedNumericWidth when collapsed
lGradientLogicalUse gradient fill (default: .T.)
nOpacityNumericTransparency level 0-255 (default: 255)
bToggledBlockCodeblock evaluated on expand/collapse

Key METHODs

METHODDescription
New( nTop, nLeft, nBottom, nRight, oWnd, ... )Create the navigator panel
ToggleSize()Toggle between expanded and collapsed states
CloseAll()Collapse all related navigators
OpenAll()Expand all related navigators
ChangeWidth( nWidth, nHeight )Animate width change

Example

#include "FiveWin.ch"

function Main()

   local oWnd, oNav

   DEFINE WINDOW oWnd TITLE "Navigator Demo" SIZE 800, 600

   oNav := TNavigator():New( 0, 0, 600, 220, oWnd, ;
            .T.,, RGB( 240, 240, 255 ), 40, "Navigation" )
   oNav:nTopColor    := RGB( 100, 150, 230 )
   oNav:nBottomColor := RGB(  50, 100, 200 )

   ACTIVATE WINDOW oWnd

return nil

TCoverFlow — Apple-Style Image Browser

A visually striking coverflow control inspired by Apple's Cover Flow. Displays images in a 3D perspective carousel with smooth left/right animation. Navigate with keyboard arrows or mouse clicks. Inherits from TControl.

Source: source/classes/tcvrflow.prg

Key DATA

DATATypeDescription
aCoversArrayArray of cover items (bitmaps + text)
nAtNumericCurrently selected cover index
bActionBlockAction when a cover is clicked
nAngleNumericPerspective angle for side covers
nCoverWidth / nCoverHeightNumericDimensions of each cover image
nCoversL / nCoversRNumericNumber of visible covers on each side
lAnimatedLogicalEnable smooth transition animation
nSeparationNumericGap between side covers
nHorizonNumericVertical position of the reflection line

Key METHODs

METHODDescription
New( nTop, nLeft, nBottom, nRight, oWnd )Create the coverflow control
AddCover( cBmpFile, cText, nClrText )Add a cover from a bitmap file
AddCoverH( hBmp, cText, nClrText )Add a cover from a bitmap handle
GoLeft()Navigate to the previous cover
GoRight()Navigate to the next cover
GoTo( nCover )Jump to a specific cover index

Example

#include "FiveWin.ch"

function Main()

   local oWnd, oCFlow

   DEFINE WINDOW oWnd TITLE "CoverFlow Demo" SIZE 800, 500

   oCFlow := TCoverFlow():New( 10, 10, 480, 780, oWnd )
   oCFlow:AddCover( "photo1.bmp", "Sunset" )
   oCFlow:AddCover( "photo2.bmp", "Mountains" )
   oCFlow:AddCover( "photo3.bmp", "City Lights" )
   oCFlow:AddCover( "photo4.bmp", "Ocean View" )
   oCFlow:AddCover( "photo5.bmp", "Forest Trail" )
   oCFlow:bAction := { |n| MsgInfo( "Selected cover: " + Str( n ) ) }

   ACTIVATE WINDOW oWnd

return nil

TBarTabs — Tabbed Button Bar

Combines a tab control (TTabs) with multiple button bars (TBar). Selecting a tab switches the visible button bar beneath it, similar to the Office ribbon concept. A lightweight alternative to TRibbon for applications that need categorized toolbar buttons.

Source: source/classes/bartabs.prg

Key DATA

DATATypeDescription
aBarsArrayArray of TBar objects, one per tab
oTabsTTabsThe tab control at the top
oPanelTPanelContainer panel for tabs + bars
nBarNumericCurrently active bar index

Key METHODs

METHODDescription
New( oWnd, nBtnW, nBtnH, aPrompts, acBitmaps, nOption )Create tabbed bar with prompts and bitmaps for each tab
AddBar( cPrompt, cBitmap )Dynamically add a new tab with its own button bar

Example

#include "FiveWin.ch"

function Main()

   local oWnd, oBarTabs

   DEFINE WINDOW oWnd TITLE "BarTabs Demo" SIZE 800, 600

   oBarTabs := TBarTabs():New( oWnd, 64, 32, ;
      { "Home", "Edit", "View" },  ;    // Tab prompts
      { "home.bmp", "edit.bmp", "view.bmp" } )  // Tab bitmaps

   // Add buttons to the first tab's bar:
   DEFINE BUTTON OF oBarTabs:aBars[ 1 ] ;
      RESOURCE "NEW" PROMPT "New" ;
      ACTION MsgInfo( "New!" )

   DEFINE BUTTON OF oBarTabs:aBars[ 1 ] ;
      RESOURCE "OPEN" PROMPT "Open" ;
      ACTION MsgInfo( "Open!" )

   // Add buttons to the second tab's bar:
   DEFINE BUTTON OF oBarTabs:aBars[ 2 ] ;
      RESOURCE "CUT" PROMPT "Cut" ;
      ACTION MsgInfo( "Cut!" )

   ACTIVATE WINDOW oWnd

return nil

TWorkBook / TWorkSheet — Excel XLSX Generation

Create native .xlsx Excel files without requiring Microsoft Office. Built on the xlsxwriter C library (by John McNamara), wrapped for Harbour by Arturo Tamayo. Supports formatting, formulas, images, merged cells, and more.

Source: source/function/fwxlsxlb.prg

TWorkBook — Key DATA/METHODs

DATA/METHODDescription
cFileOutput file path
aSheetsArray of TWorkSheet objects
New( cFile )Create a new workbook (.xlsx)
AddSheet( cName )Add a worksheet, returns TWorkSheet
Format( cPicture, cStyles, nAlign )Create a TFormat for cell formatting
Close()Finalize and write the file to disk

TWorkSheet — Key DATA/METHODs

DATA/METHODDescription
Say( nRow, nCol, uValue, oFormat )Write a value to a cell (auto-detects type)
SayRow( nRow, aValues, aFormat )Write an entire row of values
SayImage( nRow, nCol, cImage )Embed an image in a cell
SayFormula( nRow, nCol, cFormula )Write an Excel formula
MergeRange( r1, c1, r2, c2, cValue )Merge a range of cells
SetColumnSize( nFrom, nTo, nWidth )Set column width
RowHeight( nRow, nHeight )Set row height
Freeze( nRow, nCol )Freeze panes at the given position
CreateFrom( uSource )Populate from a DBF, array, or recordset
SetArrayData( aData, aStruct )Write a 2D array as table data

Example

#include "FiveWin.ch"

function Main()

   local oBook, oSheet, oFmtBold

   oBook := TWorkBook():New( "report.xlsx" )
   oSheet := oBook:AddSheet( "Sales" )

   // Create a bold format
   oFmtBold := oBook:Format( , "B" )   // "B" = Bold

   // Write headers
   oSheet:Say( 0, 0, "Product",  oFmtBold )
   oSheet:Say( 0, 1, "Quantity", oFmtBold )
   oSheet:Say( 0, 2, "Price",    oFmtBold )

   // Write data rows
   oSheet:SayRow( 1, { "Widget A", 150, 29.99 } )
   oSheet:SayRow( 2, { "Widget B",  75, 49.99 } )
   oSheet:SayRow( 3, { "Widget C", 200, 14.99 } )

   // Add a SUM formula
   oSheet:SayFormula( 4, 1, "=SUM(B2:B4)" )

   oSheet:SetColumnSize( 0, 0, 20 )   // Widen column A
   oSheet:Freeze( 1, 0 )              // Freeze header row

   oBook:Close()
   MsgInfo( "report.xlsx created!" )

return nil

TWebClient — HTTP Client (Socket-based)

A lightweight HTTP client built on FiveWin's TSocket class. Performs asynchronous HTTP GET requests with callback-based response handling. For more advanced HTTP needs (POST, headers, SSL), consider using FW_CurlHttp() or TWebView2 instead.

Source: source/classes/twebclie.prg

Key DATA

DATATypeDescription
oSocketTSocketUnderlying socket connection
bOnConnectBlockCodeblock called when connected
bOnReadBlockCodeblock called with response data: { |cData, oSelf| }

Key METHODs

METHODDescription
New()Create a new web client (port 80)
Connect( cHost )Connect to a host (name or IP)
GetPage( cUrl )Send an HTTP GET request

Example

#include "FiveWin.ch"

function Main()

   local oWnd, oWeb

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

   oWeb := TWebClient():New()
   oWeb:bOnConnect := { |o| o:GetPage( "index.html" ) }
   oWeb:bOnRead    := { |cData| MsgInfo( Left( cData, 500 ), "Response" ) }
   oWeb:Connect( "www.fivetechsoft.com" )

   ACTIVATE WINDOW oWnd

return nil

TWebCam — Webcam Capture Control

Captures video from a connected webcam using the Windows Video for Windows (VFW) API. Can display a live preview, save still images as BMP, and record video. Inherits from TControl.

Source: source/classes/twebcam.prg

Key DATA

DATATypeDescription
hWebcamNumericHandle to the capture window
cNameCharacterWebcam device name
cVersionCharacterWebcam driver version
isConnectedLogical.T. when preview is active
isScaleLogicalAuto-scale image to control size
nRateRefreshNumericPreview refresh rate in ms (default: 66)
bErrorBlockError handler codeblock

Key METHODs

METHODDescription
New( oWnd, nTop, nLeft, nW, nH, lInit )Create webcam control; set lInit = .T. to start immediately
Initialize()Connect to the webcam and start live preview
Finalize()Disconnect and stop preview
SaveFile( cFileName )Capture a still image and save as .bmp
StartCapture( cFile )Start recording video to a file
StopCapture()Stop video recording
VideoFormat()Open the video format settings dialog
SetRate( nMs )Change the preview refresh rate

Example

#include "FiveWin.ch"
#include "WebCam.ch"

function Main()

   local oWnd, oCam

   DEFINE WINDOW oWnd TITLE "Webcam Demo" SIZE 680, 540

   oCam := TWebCam():New( oWnd, 10, 10, 640, 480, .T. )

   // Save a snapshot:
   // oCam:SaveFile( "photo.bmp" )

   ACTIVATE WINDOW oWnd ;
      ON INIT oCam:Initialize()

return nil

TDbg — FiveWin Debugger / Object Inspector

A full-featured source-level debugger for FiveWin applications. Provides step-through execution, breakpoints, variable inspection, call stack browsing, watch expressions, and database work area inspection. Written by Carles Aubia.

Source: source/classes/fwdbg.prg

Requirements: Link FWDbg.lib and place FWDbg.dll (or FWDbg64.dll) in your application directory. Add #pragma /b+ to modules you want to debug.

Key DATA

DATATypeDescription
aStackArrayCurrent call stack
aModulesArrayLoaded source modules
aBreakArrayBreakpoint definitions
aSourceArrayCurrent source file lines
lStopLogicalStop at next line (single-step mode)
lGoLogicalRun until next breakpoint

Key METHODs

METHODDescription
Activate()Open the debugger window
DbgBreak()Set/toggle a breakpoint at the current line
DbgGo()Run until next breakpoint
DbgNext()Step to next line
DbgNextRoutine()Step over (skip into subroutines)
DbgVars()Inspect local and private variables
DbgAreas()Browse open database work areas
DbgPrgs()Browse loaded source files
ViewDbf()Open a DBF viewer for the current work area

Example

// To enable debugging, add this pragma at the top of modules to debug:
#pragma /b+

#include "FiveWin.ch"

function Main()

   local cName := "FiveWin"

   // The debugger will activate automatically when the program starts
   // if FWDbg.lib is linked. Use F5=Go, F8=Step, F9=Breakpoint.

   MsgInfo( "Hello " + cName )

return nil

TBlockChain — Blockchain Implementation

A pure Harbour blockchain implementation with SHA-256 hashing, proof-of-work mining, and block validation. Useful for learning blockchain concepts or implementing tamper-proof data chains in your applications. Written by Cristobal Navarro.

Source: source/internal/TBlockChain.prg

Key DATA

DATATypeDescription
aBlocksHashAll blocks in the chain (CLASSDATA, shared)
uDifficultyCharacterMining difficulty prefix (default: "0000")
nIterationsNumericNumber of mining iterations performed
cPublicKeyCharacterPublic key for signing
cSignatureCharacterBlock signature

Key METHODs

METHODDescription
New( cKey )Create a new blockchain with genesis block
AddNewBlock( uOnce, cData )Add a new block with data to the chain
MineBlock( nIndex )Mine a block (find hash matching difficulty)
IsValidBlock( nIndex, cHash )Validate a specific block
IsValidHash( nIndex )Verify the hash of a block
IsValidPrevious( nIndex )Verify the previous-hash link
GetAllBlocks()Return the entire chain
GetLastBlock()Return the most recent block
CountBlocks()Return the number of blocks in the chain
SetDifficulty( cVal )Change mining difficulty (e.g. "000000")

Example

#include "FiveWin.ch"

function Main()

   local oChain := TBlockChain():New( "mychain" )

   // Add blocks with data
   oChain:AddNewBlock( , "First transaction: Alice pays Bob 10" )
   oChain:AddNewBlock( , "Second transaction: Bob pays Carol 5" )

   // Mine a block
   oChain:MineBlock( 2 )

   // Validate
   if oChain:IsValidHash( 2 )
      MsgInfo( "Block 2 is valid! Blocks: " + ;
               Str( oChain:CountBlocks() ) )
   endif

   oChain:End()

return nil

Dark Mode

FiveWin provides built-in dark mode support through the FW_SetDarkMode() function. When enabled, all new dialogs are automatically themed with dark colors in TDialog:Initiate(), and existing open windows are also themed immediately.

Source: source/classes/dialog.prg (line ~1462)

flowchart LR A["FW_SetDarkMode(.T.)"] --> B["Sets lDarkMode = .T."] B --> C["Themes all existing windows"] B --> D["New dialogs auto-themed
in TDialog:Initiate()"] C --> E["SetDarkMode() on each window"] D --> E E --> F["Dark background + light text
on all controls"]

API

CallDescription
FW_SetDarkMode( .T. )Enable dark mode with default colors (text: RGB(220,220,220), back: RGB(30,30,30))
FW_SetDarkMode( .T., nClrText, nClrBack )Enable with custom colors
FW_SetDarkMode( .F. )Disable dark mode (restore system colors)
FW_SetDarkMode()Query current state (returns .T. or .F.)

Example

#include "FiveWin.ch"

function Main()

   local oWnd, oDlg

   // Enable dark mode for the entire application
   FW_SetDarkMode( .T. )

   DEFINE WINDOW oWnd TITLE "Dark Mode App" SIZE 600, 400

   // All dialogs created after this point are automatically dark
   DEFINE DIALOG oDlg TITLE "Settings" SIZE 400, 300 PIXEL TRUEPIXEL OF oWnd
   @ 30, 20 SAY "This dialog is automatically dark!" OF oDlg SIZE 350, 24 PIXEL
   @ 70, 20 GET oGet VAR cName OF oDlg SIZE 350, 24 PIXEL
   @ 120, 160 BUTTON "OK" OF oDlg SIZE 80, 30 PIXEL ACTION oDlg:End()
   ACTIVATE DIALOG oDlg CENTERED

   ACTIVATE WINDOW oWnd

return nil

// Toggle dark mode at runtime:
// FW_SetDarkMode( ! FW_SetDarkMode() )

GDI+ Graphics Classes

FiveWin wraps the Windows GDI+ API through a set of classes for high-quality 2D graphics: anti-aliased lines, alpha-blended images, gradient fills, path-based drawing, and more. All classes live in source/classes/tgdiplus.prg.

classDiagram class Graphics { +hGraphics +New( hDC ) +NewWnd( hWnd ) +DrawLine( oPen, ... ) +DrawRect( oPen, oBrush, ... ) +DrawEllipse( oPen, oBrush, ... ) +DrawImage( oImage, ... ) +DrawText( ... ) +DrawRoundRect( ... ) +Clear( nTrans, nR, nG, nB ) +Rotate( nAngle ) +Scale( nX, nY ) } class Pen { +hPen +New( nTrans, nR, nG, nB, nWidth ) +Destroy() } class Brush { +hBrush +NewSolidBrush( nTrans, nR, nG, nB ) +NewLinearBrush( ... ) +NewTextureBrush( oImage ) +Destroy() } class GDIBmp { +hBmp +New( cFile ) +NewFromHBmp( hBitmap ) +nWidth() +nHeight() +Destroy() } class Path { +hPath +New() +AddLine( ... ) +AddArc( ... ) +CloseFigure() +Destroy() } class Region { +hRegion +New( oPath ) +Destroy() } Graphics --> Pen : uses Graphics --> Brush : uses Graphics --> GDIBmp : draws Graphics --> Path : draws Region --> Path : from

Example

#include "FiveWin.ch"

function Main()

   local oWnd

   DEFINE WINDOW oWnd TITLE "GDI+ Drawing" SIZE 600, 400

   ACTIVATE WINDOW oWnd ;
      ON PAINT DrawGdiPlus( oWnd:hDC )

return nil

function DrawGdiPlus( hDC )

   local oGfx    := Graphics():New( hDC )
   local oPen    := Pen():New( 255, 255, 0, 0, 3 )    // Red pen, 3px wide
   local oBrush  := Brush():NewSolidBrush( 128, 0, 0, 255 )  // Semi-transparent blue
   local oPenGrn := Pen():New( 255, 0, 180, 0, 2 )    // Green pen

   // Draw a filled rectangle with border
   oGfx:DrawRect( oPen, oBrush, 50, 50, 200, 150 )

   // Draw an ellipse
   oGfx:DrawEllipse( oPenGrn, , 300, 80, 180, 120 )

   // Draw a line
   oGfx:DrawLine( oPen, 50, 250, 500, 350 )

   // Draw anti-aliased text
   oGfx:DrawText( 20, 50, "GDI+ in FiveWin!", "Segoe UI", 24, ;
                  Brush():NewSolidBrush( 255, 0, 0, 0 ) )

   // Clean up
   oPen:Destroy()
   oPenGrn:Destroy()
   oBrush:Destroy()
   oGfx:Destroy()

return nil

FiveWin Visual IDE

The FiveWin Visual IDE (visual/visualfw.exe) is a visual forms designer that lets you design dialogs by dragging and dropping controls, then generates the corresponding .prg source code. It also supports resource file editing.

Key Features

Getting Started

  1. Run visual/visualfw.exe from the FiveWin directory
  2. Create a new form or open an existing .prg file
  3. Drag controls from the toolbox onto the dialog surface
  4. Set properties in the inspector panel on the right
  5. Click "Generate Code" to produce the .prg source
  6. Build the generated code with your preferred compiler

See the samples/FiveUI/ directory for 17 sample forms created with the visual designer.

Summary Diagram

mindmap root((More FWH Classes)) UI Components TExplorerBar Collapsible panels TTaskPanel children URL links inside panels TNavigator Gradient panels Expand/collapse Outlook-style TCoverFlow 3D image carousel Animated transitions Keyboard navigation TBarTabs Tabbed toolbars Dynamic tab addition Data & Documents TXmlDocument Harbour hbxml DOM-style parsing TXmlIterator TWorkBook Native XLSX TWorkSheet Formulas and images TBlockChain SHA-256 hashing Proof of work Block validation Internet & Media TWebClient HTTP GET via sockets Async callbacks TWebCam VFW API Live preview Still capture Development Tools TDbg Debugger Breakpoints Variable inspection Call stack GDI+ Classes Graphics, Pen, Brush Path, Region, GDIBmp Anti-aliased drawing Application Features Dark Mode FW_SetDarkMode Auto-themes dialogs Custom colors Visual IDE Form designer Code generation Property inspector