What's New in FWH 26.05
This page summarizes the changes and additions in FiveWin for Harbour/xHarbour version 26.05 (May 2026), relative to the previous release 26.03 (March 2026).
What's new by version: 26.10 · 26.09 · 26.08 · 26.07 · 26.06
Agent Class — Autonomous AI Agent
A new class source\classes\agent.prg implements an autonomous AI coding agent
for Harbour/FiveWin — the same agentic engine that powers
Agents Web.
- Loop —
Run()/Step(): observe → decide → act. 14 steps max, DeepSeek V4 via libcurl. - 15 built-in tools — list_files, read_file, write_file, delete_file, shell, python, sql, web_search, web_fetch, register_tool, unregister_tool, user_tools, create_skill, toggle_skill, classify_disk.
- Dynamic tools —
RegisterTool()lets the agent create its own tools from scripts.UnregisterTool()removes them without deleting the script. Tools persist inagent_state/user_tools.json. - Skills — reusable instructions injected into the system prompt.
5 built-in (reviewer, summarizer, refactor, documenter, tester) + disk skills.
ToggleSkill()activates/deactivates without deleting the file. - Multi-agent —
DispatchAgents()launches up to 4 sub-agents in parallel viahb_threadStart(). Each with its own instance, no dispatch/ask_user. Shared contract for consistency. - Planning —
GeneratePlan()asks the LLM for 3-6 JSON steps.ExecutePlan()runs them sequentially, marking each done. - Persistence —
SaveState()/LoadState()save user tools and active skills to disk. Survives between sessions.
Requires Harbour MT VM (libhbvmmt) for multi-agent dispatch.
Full reference:
Agent class documentation.
See sample: samples\agenticai\agenticai2.prg.
Remote View — Browser Live View & Control
A new subsystem (source/internal/remoteview/) lets any browser on the
LAN see and control a live FWH window in real time. The window is captured by GDI+,
differentially encoded as JPEG patches, and streamed over a WebSocket to an HTML5
canvas. Mouse clicks, movement, wheel, and keyboard input flow back from the browser
to the real window via PostMessage. Two modes:
- Single-client —
RemoteViewStart(hWnd, nPort)uses a WM_TIMER pump in the GUI thread. The timer survives modal loops (MsgInfo, dialogs, menus), so the browser stays live. No-mtrequired. - Multi-client —
RemoteViewServe(hWnd, nPort)runs inside a Harbour thread (hb_threadStart), each on its own port with TLS-isolated state. Multiple browsers can view and control the same window simultaneously. Requires Harbour MT VM (-mt).
The capture engine composites owned popups (child dialogs, MessageBoxes) on top of the main window, and supports full title-bar interaction: drag to move, resize edges, min/max/close buttons, and double-click to toggle maximize — all DWM-aware for Windows 10/11. Smart differential capture with FNV-1a hashing skips identical frames to save bandwidth.
API: RemoteViewStart(hWnd, nPort), RemoteViewStop(),
RemoteViewSetOffset(nX, nY), RemoteViewServe(hWnd, nPort, nOffX, nOffY),
RemoteViewStopAll(). See the full
Remote View documentation.
Samples: samples/RemoteView/testrv.prg, testrv2.prg (dialog),
testrvmt.prg (multi-client), testrvweb.prg (Remote View +
TWebView2). Already integrated in
samples/database/fivedburv.prg (FiveDBU)
via ON INIT RemoteViewStart().
Compiler coverage: Remote View was verified to capture and stream on
every Harbour and xHarbour variant, 32 and 64-bit, across the BCC, MSVC and MinGW C
compilers. The testrv window title now reports the running build (for
example “Harbour MSVC 64”). The single exception is
xHarbour Commercial (VC98 toolchain): ordinary FiveWin apps run there,
but the GDI+ window capture that Remote View relies on misbehaves at runtime, so Remote
View itself is not supported on that build.
Comprehensive HTML Documentation
The most visible change: a complete HTML documentation site covering 200+ classes across three languages (English, Spanish, Portuguese). The docs include class hierarchy diagrams, DATA/Methods tables, code examples, and a clickable feature mindmap. Live at fivetechsoft.github.io/FWH_docs and auto-synced from the main repo via GitHub Actions.
New Classes
TKnob — rotary knob control (UI)
A modern custom rotary knob control by Silvio Falconi
(source/classes/tknob.prg), aimed at audio, MIDI and synthesizer style
interfaces. Derived from TControl and drawn entirely with GDI (no extra
DLL): LED or LINE indicator, illuminated outer ring with glow, optional external
ticks, unipolar (0..127) and bipolar (-30..+30) modes, mouse drag and wheel control
(CTRL for a finer step), double-click reset, enable/disable state, inner
value text plus external label with separate fonts, and bSetGet /
bChanged / bAction callbacks. A declarative
@ <row>,<col> KNOB command is provided in include/tknob.ch.
See TKnob. Demos:
samples/knobtst1.prg, samples/knobtst2.prg.
THFTask & TChatAgent — FWAI utilities (AI)
Two more "FWAI" utility classes. THFTask
(source/classes/thftask.prg) is one thin class over the HuggingFace
Inference API for the common NLP tasks — Classify,
ZeroShot, NER, Summarize,
Translate, Sentiment — each returning plain Harbour
values; transport is injectable (::bSender) for tests or a custom HTTP
layer. TChatAgent (source/classes/tchatagent.prg) is a
minimal "chat over your data" agent with tool-calling: New( bChat, bTool )
takes an LLM codeblock and a data-query codeblock, and the LLM replies
TOOL <query> or ANSWER <text> until answered.
Both are documented at THFTask / TChatAgent.
Also: GPT2Model (pretrained GPT-2 inference)
is now a library class. Tests: samples/ai/thftasktest.prg,
samples/ai/chatagenttest.prg.
TSemanticIndex — semantic search over DBF/SQL (AI)
The first of the "FWAI" utility classes (source/classes/tsemanticindex.prg):
meaning-based search for ordinary data apps. Instead of LIKE '%word%',
it ranks records by how close their text is in meaning to a query, using
embedding vectors and cosine similarity. Backend-agnostic —
New( bEmbed ) takes a { |cText| -> vector } codeblock,
so embeddings can come from TEmbeddings
(HuggingFace) or a local model.
USE customers
oEmb := TEmbeddings():New()
oIdx := TSemanticIndex():New( { |c| oEmb:GetEmbeddings( c ) } )
oIdx:IndexDbf( "NOTES" )
aHits := oIdx:Search( "unhappy about late delivery", 10 ) // { { RecNo, score }, ... }
See TSemanticIndex. Test: samples/ai/semindextest.prg.
Real pretrained GPT-2 runs in pure FWH/Harbour (AI)
A milestone for the FWH AI track: samples/ai/gpt2test.prg builds a
GPT2Model on FW_Tensor, loads the actual GPT-2 small weights
(model.safetensors, 124M params, ~500 MB) one tensor at a time
via FWT_LoadSafe (no full-file load), and runs the complete forward
pass on CPU — pre-norm, multi-head causal attention, GELU MLP, weight-tied
head. Verified numerically against a numpy GPT-2 reference: "The capital of
France is" → " the" (token 262), an exact argmax match, in
under a second. A multi-token generation loop (greedy / temperature / top-k) then
produces real text, e.g. "The capital of France is the capital of the French
Republic, and". Download model.safetensors from
huggingface.co/gpt2 — it is not
shipped with FWH.
FW_Tensor & TFWLanguageModel — toward local transformers (AI)
Two steps toward running real transformer models inside FWH apps.
FW_Tensor (source/function/fwtensor.c) is a flat,
garbage-collected float32 tensor: it stores data as a contiguous buffer
instead of Harbour nested arrays, so large weight sets fit in reasonable memory
and can be read straight from a safetensors file
(FWT_New, FWT_FromArray, FWT_ToArray,
FWT_Shape, FWT_Size, FWT_Get/Set,
FWT_MatMul, FWT_LoadSafe). It also ships the full
transformer forward-pass op set: FWT_Add, FWT_Scale,
FWT_AddBias, FWT_GELU, row-wise FWT_Softmax
and FWT_LayerNorm, FWT_Transpose,
FWT_GatherRows (embedding lookup), and
FWT_SliceCols/FWT_SetCols (attention head split/merge).
Test: samples/ai/fwtensortest.prg (10/10). This is Phase 1 of the
PyTorch-lite effort — see
docs/{en,es,pt}/ai/pytorch-lite-roadmap.html for why each step is
needed.
TFWLanguageModel (source/classes/fwlangmodel.prg) is
a one-line autoregressive language model: it wraps
HFTokenizer +
Transformer and a compact vocabulary
built from your corpus, with chunked training over longer text:
oLM := TFWLanguageModel():New( "gpt2.tokenizer.json", 2, 64, 2, 64 )
oLM:Train( cCorpus, 100, 0.01 )
? oLM:Generate( "To be", 12, 0.8, 20 )
Demo training on real Shakespeare text: samples/ai/shakegpt.prg.
Also new: hb_MatrixSeed( n ) for reproducible weight initialization.
HFTokenizer — HuggingFace BPE Tokenizer (AI)
The goal of the FWH AI classes is to bring the power of transformers into your
FiveWin applications — and to do so by reusing, as much as possible, the
resources of the HuggingFace ecosystem. HFTokenizer is the first
milestone of that effort: a pure Harbour implementation of the HuggingFace
byte-level BPE tokenizer used by GPT-2. It loads a standard
tokenizer.json from the HuggingFace Hub and reproduces GPT-2
tokenization bit-for-bit (e.g. "hello world" →
{ 31373, 995 }, with exact Decode(Encode(text))
round-trips).
A tokenizer → Transformer
bridge tokenizes real text, builds a compact vocabulary of only the tokens that
appear, trains the autoregressive Transformer, and decodes generated ids back to
text — so a model can be trained and run on real language instead of toy
ids. See HFTokenizer for the full
pipeline and integration roadmap. Samples: samples/ai/hftoktest.prg,
samples/ai/hflmtest.prg.
TGroupEx — Accordion-Style Group
Contributed by Silvio Falconi (Italy). An accordion-style collapsible group
with a painted rounded header, optional icon, and expand/collapse button.
Multiple TGroupEx panels can be linked with LINK GROUPS to behave
as a vertical accordion where opening one redistributes the others. The last
panel can optionally stretch to fill the remaining height. Three visual themes
available. Sample: samples/test/ui/testgrpex.prg.
BWCC 64-bit dll/bwcc64.dll
A clean-room 64-bit reimplementation of Borland Windows Custom Controls (BWCC) for 64-bit applications. Exports all 45 functions of the original 32-bit DLL:
- Controls: BorBtn (with predefined OK/Cancel/Yes/No/Help glyphs), BorCheck, BorRadio, BorStatic, BorShade
- Dialog classes: BorDlg, BorDlg_Gray, BorDlg_Std with dithered-gray pattern brush and template mangling
- BorBtn glyphs: resolved from module resources by integer ID, decimal-string name, or button caption
- BWCCMessageBox: Borland-styled message box with BWCC icon and BorBtn buttons
Native Dark Mode
Print Preview (TPreview) now supports native dark mode via
FW_SetDarkMode(.T.). The window background, toolbar, status bar,
and thumbnail panel auto-darken with no application code changes. The horizontal
menu bar is darkened using a new C function FW_DarkMenuBar() that
subclasses the preview window and owner-draws the top-level menu items in dark
colors. Submenus use the 2013 style for dark popups.
Notable Fixes
TXBrowse "Zero divisor" in SelectRow() without totaled columns
Fixed a Zero divisor runtime error when calling
oBrw:SelectRow( n ) (or clicking the checkbox column created by
SetMultiSelectCol()) on a multi-select browse that has no
SetSum() / totaled columns. SelectRow() now saves and
recalculates totals only when ::aSumCols is not empty,
ReCalcTotals() returns immediately when there are no totaled
columns, and the standard-deviation footer guards its division (the
nCount - 1 divisor could be zero with a single counted row).
Ctrl+click, Shift+click, double click and header select-all/clear keep
aSelected consistent with no changes required in user code.
TWBrowse array bound error on drag / inertial scroll
Fixed Error BASE/1132 (array bound error) when dragging or
flick-scrolling a TWBrowse near the end of the data.
LButtonUp() (inertial scroll) and MouseMove() (drag)
advanced ::nAt directly by the visible row count, bypassing the
[1, nLen] clamp that SetArray()'s bSkip
already enforces. When fewer records remained than visible rows,
::nAt overshot ::nLen and the next bLine
evaluation indexed past the end of the array. The three direct writes now apply
the same clamp: ::nAt := Min( Max( ::nAt, 1 ), Eval( ::bLogicLen, Self ) ).
FW_SaveImage alpha bitmap crash
Fixed a silent process exit when FW_SaveImage() saved 32-bit alpha
HBITMAPs to JPG, PNG, GIF or TIFF. A March 2025 memory-leak fix in
GDIP_SAVEIMAGE() double-deleted the GDI+ bitmap after
BitmapFromAlphaBmp(), which already frees the original internally.
Typical scenario: FW_BarCodeBmp() + bmp2alpha() +
FW_SaveImage( hBmp, cFile + '.jpg' ). Restored the correct
assignment in source/winapi/gdipfwh.cpp.
TTrayIcon on Windows 11
Fixed popup menu not appearing under Windows 11. Win11 refuses to display
TrackPopupMenu owned by a hidden/disabled window. A new oWndParent
DATA stores the main window and Command() activates it instead of
the internal hidden window. The cursor position returned by GetCursorPos is now
properly converted to client coordinates.
Dark Mode Bug Fixes
- TMenu:SetDarkMode no longer recurses infinitely. The
method now recurses into the actual submenu via
oItem:bActioninstead ofoItem:oMenu, which pointed back to the parent. - TBar:SetDarkMode fixed crash on uninitialized
bClrGradwhen called before the bar is painted.
TXBrowse:SetColFromMySQL
Fixed the method discarding an explicit header argument in the classic
two-parameter call. The column-spec parser now checks
ValType(cHeader) != 'C' before overwriting, so user-supplied
headers are preserved.
BWCC Button Glyph Resolution
Generic BorBtn buttons now show bitmaps from the owning module's resources, trying three conventions: RT_BITMAP matching the control ID, state-base bitmap IDs, and bitmap name matching the button caption. Both integer IDs and decimal-string names are matched, covering Borland resource tools.
FiveDBU — Enhanced Database Utility
Major upgrade to samples/database/fivedbu.prg, the flagship DBU sample
for DBF, ADO, ODBC and MariaDB. The monolithic source is now split into testable
modules under samples/database/fivedbu/:
fivedbu.ch— color constants and macrosfivedbu_lib.prg— pure helpers (no UI)tfivedbu.prg—TFiveDBUclass; preferences in%APPDATA%\fivedbu.inifivedbu_test.prg— automated integration test mode
--testmode —fivedbu.exe --testruns 32 integration tests (MDI, browse, structure dialog, folder, array browse). Log:tests/fivedbu_test.log.- Dark mode — checkbox in Preferences; persists to INI;
BrwApplyColors()applies dark or pijama striping on DBF browses. - Free SQL —
RSFreeSql()toolbar button on ADO/ODBC browses: run arbitrary SQL (SELECTopens a new browse; DML reports rows affected). - ADO/Maria import —
ImpExpImportAdo()imports CSV/TXT into ADO or MariaDB rowsets; export writes CSV/TXT with header. - Scoped relations —
RelEdit()checkbox forDbInfo(DBI_SCOPEDRELATION)on DBF parent-child links. - MariaDB MRU — recent Maria connection strings in the Database menu (like ADO/ODBC MRU).
- Soundex search — optional phonetic lookup via
FiveDBU_Soundex()(Harbour-safe empty-string handling).
FWUnit adds tst_fivedbu.prg (15 asserts on
FiveDBU_ChrKeep, FiveDBU_Soundex, FiveDBU_ParseLine,
FiveDBU_FieldList, FiveDBU_IsSelectSql). Full suite:
158/158 on hm32. Build:
samples\build_new.bat fivedbu hm32.
FWString fix — removed a trailing-comma NIL row in
source/function/strings.prg that caused BASE/1068 when
FWString("&Window") was called from TMENU:AddMdi.
CP1252 accent encoding restored for Spanish, Portuguese, French, German and Italian.
samples/database/fivedburv.prg is the same DBU with
Remote View integrated
(ON INIT RemoteViewStart()).
New Samples
calexmaria — TCalex + MySQL/MariaDB Calendar
New sample samples/misc/calexmaria.prg demonstrating the TCalex
appointment-scheduling control with full CRUD against a MySQL or MariaDB
backend. Features Month, Week and Day views, a drag-and-drop appointment-move
workflow (right-click "Pick up" an appointment, then left-click the
target day), and an RC dialog resource for editing date/time, subject, notes
and color-coded status. Connection via maria_Connect() with
environment-variable overrides for host, database, user, password and port.
See the Samples Guide
and MariaDB / MySQL pages.
Documentation Improvements
| Category | Pages Added | Highlights |
|---|---|---|
| Internet / AI | 19 | TSocket, TSmtp, TPop3, TFtp, TWebClient, TOpenAI, TOpenCode, TDeepSeek, TGemini, TOLlama, TGrok, TKimi, TEmbeddings, TNeuralNetwork, TProxy, TRas, TMail, TWhatsApp, TNewsServer |
| UI Controls | 55+ | TGraph, TGantt, TToast, TRating, TWebcam, TGif, TScintilla, TSwitch, TCalendar, TSlider, TImageList, TExplorerBar, TMetroPanel, TScrollPanel, TBarTabs, TProgressWheel, TTagCloud, TScrollMsg, TNavigator, TActiveX, TAnimate, TCoverFlow, TOutLook, TReBar, TSplitter, TStatusBar, TMsgBar, TTrayIcon, TUpDown, TVideo, TXImage, TWBrowse, TPages, TPanel, TTabs, TTrackBar, THotKey, TIPAddress, TRichEdit5, TBar, TButtonBmp, TMeter, TCBrowse, TSelex, TSkin, TFolderEx, TTitle |
| Data Access | 15+ | TArrayData, TDbOdbc, TStruct, TDataRow, TRecSet (expanded), TOrdInfo, TLocks, TSqlError, MariaDB ORM, ORM Classes, PostgreSQL, TTable, TIndex, TDict |
| Printing | 12+ | TPreview, TPdf, FWPdf, VRD, TRColumn, TRLine, TRGroup, TRFile, Barcode, TPrinter (expanded), TReport (expanded) |
| Graphics / GDI | 12 | TPen, TBrush, TBrushEx, TFont, TCursor, TRect/TPoint, GDI+ classes, TEnhMetaFile, TMetaFile, TProgress, TIcon, Graphics Rendering |
| Utilities | 18+ | TFile, TIni, TReg32, TClipBoard, TLinkList, TMRU, TBlock, TLayout, Excel, FWStack, TBackup/TRestore, TComm, TComObject, TDbg, TExStruct, TXmlWriter, TTime, TParser |
| Reference | 8 | TMenu/TMenuItem, TVistaMenu, TForm, TDde, TImageBase64, TCalInfo, TYacc/TLex, TBlockChain |
| Core (expanded) | 3 | TWindow, TDialog, TControl — expanded with missing methods and dark mode API |
New Functions Documented
- Network: IsInternet(), LocalIP(), PublicIP(), IsLocalIP(), IsExternalIP()
- ADO/Database: 30+ FW_Ado* and FW_Dbf* functions
- Date/Time: FW_ADDMONTH, FW_AGE, FW_YMDLAPSED, FW_DateToUnix, UTC_TIMESTAMP, 10+ more
- Image/Drawing: FW_DrawImage, FW_Box, FW_SayText, GradientFill, FW_ReadImage, FW_SaveImage, 10+ more
- Data Format: FW_TRANSFORM, FW_ValToCSV, FW_ArrayToHTML, FW_JsonDecode, 10+ more
- System Info: ScreenWidth, IsWindows11, FW_ActiveMonitors, WndCenterEx, 10+ more
Summary
FWH 26.05 represents a major documentation effort with 200+ new HTML class reference pages, combined with the new Remote View subsystem for browser-based window control, the TGroupEx accordion control, full BWCC 64-bit support, native dark mode for Print Preview, and multiple bug fixes. The new documentation is published at fivetechsoft.github.io/FWH_docs and auto-updates on every push.