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
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
| DATA | Type | Description |
|---|---|---|
oRoot | TXmlNode | Root node of the parsed XML document |
nStatus | Numeric | Parse status (0 = success) |
nError | Numeric | Error code if parsing failed |
nLine | Numeric | Line number where error occurred |
Key METHODs
| METHOD | Description |
|---|---|
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/METHOD | Description |
|---|---|
cName | Tag name of the node |
cData | Text content of the node |
aAttributes | Hash of attribute name/value pairs |
oChild | First child node |
oNext | Next 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
| DATA | Type | Description |
|---|---|---|
aPanels | Array | Array of TTaskPanel objects |
nTopColor | Numeric | Top gradient color (default: blue) |
nBottomColor | Numeric | Bottom gradient color |
oVScroll | TScrollBar | Vertical scrollbar (auto-managed) |
Key METHODs
| METHOD | Description |
|---|---|
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/METHOD | Description |
|---|---|
cTitle | Panel title text |
lCollapsed | .T. when collapsed |
nBodyHeight | Height of the content area |
nTitleHeight | Height 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 |
bOnCollapse | Codeblock 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
| DATA | Type | Description |
|---|---|---|
lExpanded | Logical | .T. when panel is expanded (default: .T.) |
cTitle | Character | Panel title text |
cImage | Character | Background image resource name |
nTitleHeight | Numeric | Title bar height (default: 40) |
nTopColor / nBottomColor | Numeric | Gradient colors |
nWidthClosed | Numeric | Width when collapsed |
lGradient | Logical | Use gradient fill (default: .T.) |
nOpacity | Numeric | Transparency level 0-255 (default: 255) |
bToggled | Block | Codeblock evaluated on expand/collapse |
Key METHODs
| METHOD | Description |
|---|---|
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
| DATA | Type | Description |
|---|---|---|
aCovers | Array | Array of cover items (bitmaps + text) |
nAt | Numeric | Currently selected cover index |
bAction | Block | Action when a cover is clicked |
nAngle | Numeric | Perspective angle for side covers |
nCoverWidth / nCoverHeight | Numeric | Dimensions of each cover image |
nCoversL / nCoversR | Numeric | Number of visible covers on each side |
lAnimated | Logical | Enable smooth transition animation |
nSeparation | Numeric | Gap between side covers |
nHorizon | Numeric | Vertical position of the reflection line |
Key METHODs
| METHOD | Description |
|---|---|
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
| DATA | Type | Description |
|---|---|---|
aBars | Array | Array of TBar objects, one per tab |
oTabs | TTabs | The tab control at the top |
oPanel | TPanel | Container panel for tabs + bars |
nBar | Numeric | Currently active bar index |
Key METHODs
| METHOD | Description |
|---|---|
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/METHOD | Description |
|---|---|
cFile | Output file path |
aSheets | Array 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/METHOD | Description |
|---|---|
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
| DATA | Type | Description |
|---|---|---|
oSocket | TSocket | Underlying socket connection |
bOnConnect | Block | Codeblock called when connected |
bOnRead | Block | Codeblock called with response data: { |cData, oSelf| } |
Key METHODs
| METHOD | Description |
|---|---|
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
| DATA | Type | Description |
|---|---|---|
hWebcam | Numeric | Handle to the capture window |
cName | Character | Webcam device name |
cVersion | Character | Webcam driver version |
isConnected | Logical | .T. when preview is active |
isScale | Logical | Auto-scale image to control size |
nRateRefresh | Numeric | Preview refresh rate in ms (default: 66) |
bError | Block | Error handler codeblock |
Key METHODs
| METHOD | Description |
|---|---|
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
| DATA | Type | Description |
|---|---|---|
aStack | Array | Current call stack |
aModules | Array | Loaded source modules |
aBreak | Array | Breakpoint definitions |
aSource | Array | Current source file lines |
lStop | Logical | Stop at next line (single-step mode) |
lGo | Logical | Run until next breakpoint |
Key METHODs
| METHOD | Description |
|---|---|
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
| DATA | Type | Description |
|---|---|---|
aBlocks | Hash | All blocks in the chain (CLASSDATA, shared) |
uDifficulty | Character | Mining difficulty prefix (default: "0000") |
nIterations | Numeric | Number of mining iterations performed |
cPublicKey | Character | Public key for signing |
cSignature | Character | Block signature |
Key METHODs
| METHOD | Description |
|---|---|
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)
in TDialog:Initiate()"] C --> E["SetDarkMode() on each window"] D --> E E --> F["Dark background + light text
on all controls"]
API
| Call | Description |
|---|---|
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.
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
- Drag-and-drop dialog design with live preview
- Property inspector for all control properties
- Automatic
.prgcode generation - Resource file (.rc) import and export
- Support for all FiveWin controls (TGet, TButton, TXBrowse, TFolder, etc.)
- Alignment tools: snap to grid, center, distribute
- Multiple dialog editing in tabs
Getting Started
- Run
visual/visualfw.exefrom the FiveWin directory - Create a new form or open an existing
.prgfile - Drag controls from the toolbox onto the dialog surface
- Set properties in the inspector panel on the right
- Click "Generate Code" to produce the
.prgsource - Build the generated code with your preferred compiler
See the samples/FiveUI/ directory for 17 sample forms created with the
visual designer.