This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a port of the Free Vision (FV) text-mode UI framework from Free Pascal to modern Delphi (10.x, 11.x, 12.x). Free Vision is a classic console-based GUI toolkit originally from Turbo Pascal.
Key constraint: The port maintains the legacy Turbo Pascal OBJECT syntax - do not convert to CLASS.
The original sourcecode for free vision is in C:\temp\fpc\fpc\packages\fv reference it as necessary.
Use the MCP build tool with Win32 platform and Debug configuration:
mcp__dbuildmcp__msbuild with projectfile="C:/projects/fv-delphi/FVTest.dproj", platform="Win32", config="Debug"
Important: Always use Win32/Debug during development. The project targets 32-bit Windows.
There is no automated test suite. Testing is done via the interactive FVTest.exe application:
# Run after building
FVTest.exeThe test app exercises all ported widgets through menu options (Test menu). Debug output is written to fvtest.log.
- FVCommon.pas - Platform types (
Sw_Word,Sw_String = ShortString,PString) - Objects.pas - Base object system, streams, collections (
TObject,TStream,TCollection) - Video.pas - Console output via Windows Console API
- Drivers.pas - Input handling (keyboard, mouse, event queue)
- Views.pas - View hierarchy (
TView,TGroup,TWindow,TDesktop) - Menus.pas - Menu system (
TMenuBar,TMenuBox,TStatusLine) - App.pas - Application framework (
TProgram,TApplication) - Dialogs.pas - Dialog controls (
TDialog,TButton,TInputLine,TCheckBoxes, etc.)
- MsgBox.pas, StdDlg.pas - Standard dialogs (message boxes, file dialogs)
- Validate.pas - Input validators
- Gadgets.pas -
TClockView,THeapView - Tabs.pas - Tab control
- TimedDlg.pas - Auto-closing dialogs
- ColorTxt.pas, InpLong.pas, AsciiTab.pas - Specialized widgets
- Use
ShortString(aliased asSw_String) for FV string types - Use
PString(pointer to ShortString) withNewStr/DisposeStrfrom Objects.pas - Use
THandlefromWinapi.Windowsfor file handles - CPU-native types:
CPUWord,CPUInt,PtrInt
- Range checking OFF (
{$R-}) in units with pointer arithmetic - This is a Delphi-only project targeting Windows
- Views are owned by their parent
TGroupand disposed automatically - Use
New(PTypeName, Init(...))pattern for object creation - Call
Dispose(Ptr, Done)for cleanup
See PORTING_STATUS.txt for detailed status. Core functionality is complete. Recently ported:
- Editors.pas - Text editor (compiles, needs testing)
- ColorSel.pas - Color selection dialogs
- Outline.pas - Tree view (with mousewheel support)
- Console window resize causes visual artifacts (resize not handled)
- Some units use FPC-specific features like
get_caller_framethat need alternatives in Delphi