Native Platform Controls
The Win32 / Cocoa / GTK3 tab provides complex controls that map directly to each platform's advanced native widgets. These controls offer rich functionality with full OS integration.
TTabControl CT_TABCONTROL = 33
Tabbed page container. Each tab hosts a panel of controls, enabling multi-page interfaces.
| Property | Type | Default | Description |
nTabIndex | Numeric | 0 | Currently active tab (0-based) |
nTabCount | Numeric | 0 | Number of tabs (read-only) |
nTabPosition | Numeric | 0 | 0=Top, 1=Bottom, 2=Left, 3=Right |
lHotTrack | Logical | .F. | Highlight tabs on mouse hover |
| Event | Category | Description |
OnChange | Action | Active tab changed |
OnChanging | Action | Tab is about to change (can cancel) |
| Platform | Native Widget |
| Windows | WC_TABCONTROL (SysTabControl32) |
| macOS | NSTabView |
| Linux | GtkNotebook |
// Create a tabbed form
@ 10, 10 TABCONTROL oTab OF oForm SIZE 400, 300
oTab:AddTab( "General" )
oTab:AddTab( "Details" )
oTab:AddTab( "Notes" )
TTreeView CT_TREEVIEW = 20
Hierarchical tree display with expandable/collapsible nodes. Ideal for file browsers, category trees, and organizational charts.
| Property | Type | Default | Description |
lShowLines | Logical | .T. | Show connecting lines between nodes |
lShowButtons | Logical | .T. | Show expand/collapse buttons |
lCheckBoxes | Logical | .F. | Show checkboxes next to items |
lSorted | Logical | .F. | Auto-sort nodes alphabetically |
oSelected | TreeNode | NIL | Currently selected node |
| Event | Category | Description |
OnChange | Action | Selected node changed |
OnExpanding | Action | Node about to expand |
OnCollapsing | Action | Node about to collapse |
OnDblClick | Action | Node double-clicked |
OnEdited | Action | Node label edited |
| Platform | Native Widget |
| Windows | WC_TREEVIEW (SysTreeView32) |
| macOS | NSOutlineView |
| Linux | GtkTreeView (tree model) |
// Build a category tree
@ 10, 10 TREEVIEW oTree OF oForm SIZE 200, 300
oRoot := oTree:AddItem( "Products" )
oRoot:AddChild( "Electronics" )
oRoot:AddChild( "Clothing" )
oRoot:Expand()
TListView CT_LISTVIEW = 21
Multi-column list in report mode (LVS_REPORT). Each item is a row with N cells; column headers come from aColumns.
| Property | Type | Default | Description |
aColumns | Array | {"Column1","Column2","Column3"} | Column headers (max 8) |
aItems | Array | {} | Rows; each element is an array of strings, one per column (max 64 rows) |
aImages | Array | {} | PNG/ICO paths for ImageList (max 16); required for Icon/SmallIcon modes |
nViewStyle | Numeric | 2 | 0=Icon, 1=List, 2=Report, 3=SmallIcon |
| Method | Description |
SetColumns( aCols ) | Set headers from string array |
SetItems( aRows ) | Replace all rows; SetItems({}) clears |
AddItem( aCells ) | Append a row at the end |
SetImages( aPaths ) | Load PNG/ICO into ImageList 32x32 + 16x16; row N uses icon N % count |
| Event | Category | Description |
OnClick | Action | Item clicked |
OnDblClick | Action | Item double-clicked |
OnColumnClick | Action | Column header clicked (for sorting) |
OnChange | Action | Selection changed |
| Platform | Native Widget |
| Windows | WC_LISTVIEW (SysListView32) with LVS_REPORT + LVS_EX_FULLROWSELECT|GRIDLINES |
| macOS | NSTableView multi-column |
| Linux | GtkTreeView + GtkListStore |
xBase syntax
// Define ListView with 3 columns
@ 50, 20 LISTVIEW oLV OF oForm SIZE 480, 250 ;
COLUMNS "Name", "Age", "City"
oLV:AddItem( { "Alice", "30", "New York" } )
oLV:AddItem( { "Bob", "25", "Los Angeles" } )
oLV:AddItem( { "Charlie", "40", "Chicago" } )
Editing in the Inspector
When a TListView control is selected in the designer, the inspector exposes two editable properties:
- aColumns — click the
... button to open the array editor. One column header per line.
- aItems — click the
... button to open the dedicated ListView Items Editor: a grid showing the columns from aColumns, one row per item, double-click any cell to edit it in place. Buttons + Add / - Del / Up / Down manage rows. Enter commits, Esc cancels.
The code generator emits the @ ... LISTVIEW ... COLUMNS ... command followed by one :AddItem({...}) call per row.
Storage format
Internally aColumns and aItems are serialized as strings:
aColumns: headers separated by | — e.g. "Name|Age|City"
aItems: rows separated by |, cells within each row by ; — e.g. "Alice;30;NY|Bob;25;LA"
View styles
The nViewStyle property appears in the inspector as a dropdown with the enumerated values (vsIcon, vsList, vsReport, vsSmallIcon). Changing the value at runtime refreshes the control immediately. The Icon and SmallIcon modes require an ImageList to display icons.
Editing images in the Inspector
The aImages property opens a dedicated ListView Images Editor dialog when you click ...: list of paths plus + Add (file picker .png/.ico/.bmp), - Del, Up, Down buttons. Images load at runtime via GDI+, scaled to 32x32 (vsIcon) and 16x16 (vsSmallIcon). Per-row assignment is round-robin: row[N]:icon = aImages[N mod len(aImages)].
// Define ListView with icons
@ 50, 20 LISTVIEW oLV OF oForm SIZE 480, 250 ;
COLUMNS "Name", "Age" ;
ITEMS "Alice;30", "Bob;25" ;
IMAGES "user.png", "admin.png"
oLV:nViewStyle := 0 // Icon mode: shows 32x32 PNGs
TProgressBar CT_PROGRESSBAR = 22
Visual indicator of operation progress. Supports determinate (percentage) and indeterminate (marquee) modes.
| Property | Type | Default | Description |
nMin | Numeric | 0 | Minimum value |
nMax | Numeric | 100 | Maximum value |
nPosition | Numeric | 0 | Current progress value |
lMarquee | Logical | .F. | Indeterminate (animated) mode |
| Platform | Native Widget |
| Windows | PROGRESS_CLASS (msctls_progress32) |
| macOS | NSProgressIndicator |
| Linux | GtkProgressBar |
// Progress bar for file processing
@ 200, 20 PROGRESSBAR oProgress OF oForm SIZE 300, 20 RANGE 0, 100
oProgress:nPosition := 45
TRichEdit CT_RICHEDIT = 23
Rich text editor supporting bold, italic, underline, colors, fonts, and paragraph formatting (RTF).
| Property | Type | Default | Description |
cText | String | "" | Plain text content |
cRTFText | String | "" | Rich text (RTF) content |
lReadOnly | Logical | .F. | Prevent editing |
lWordWrap | Logical | .T. | Wrap long lines |
nSelStart | Numeric | 0 | Selection start position |
nSelLength | Numeric | 0 | Selection length |
| Event | Category | Description |
OnChange | Action | Content changed |
OnSelChange | Action | Selection changed |
OnKeyDown | Keyboard | Key pressed |
| Platform | Native Widget |
| Windows | RICHEDIT_CLASS (RichEdit20W) |
| macOS | NSTextView (RTF enabled) |
| Linux | GtkTextView (with Pango markup) |
TTrackBar CT_TRACKBAR = 34
Slider control for selecting a numeric value within a range. Used for volume, zoom, and similar adjustments.
| Property | Type | Default | Description |
nMin | Numeric | 0 | Minimum value |
nMax | Numeric | 100 | Maximum value |
nPosition | Numeric | 0 | Current slider position |
nTickFreq | Numeric | 1 | Tick mark frequency |
lHorizontal | Logical | .T. | Horizontal orientation |
| Event | Category | Description |
OnChange | Action | Slider position changed |
| Platform | Native Widget |
| Windows | TRACKBAR_CLASS (msctls_trackbar32) |
| macOS | NSSlider |
| Linux | GtkScale |
TUpDown CT_UPDOWN = 35
Spin button (up/down arrows) typically paired with an edit control for numeric input.
| Property | Type | Default | Description |
nMin | Numeric | 0 | Minimum value |
nMax | Numeric | 100 | Maximum value |
nPosition | Numeric | 0 | Current value |
nIncrement | Numeric | 1 | Step increment |
oBuddy | Control | NIL | Associated edit control |
lWrap | Logical | .F. | Wrap from max to min |
| Event | Category | Description |
OnChange | Action | Value changed (up/down clicked) |
| Platform | Native Widget |
| Windows | UPDOWN_CLASS (msctls_updown32) |
| macOS | NSStepper |
| Linux | GtkSpinButton |
TDateTimePicker CT_DATETIMEPICKER = 36
Date and/or time picker with a dropdown calendar. Provides locale-aware formatting.
| Property | Type | Default | Description |
dValue | Date | Date() | Selected date/time |
dMinDate | Date | NIL | Minimum selectable date |
dMaxDate | Date | NIL | Maximum selectable date |
cFormat | String | "" | Custom display format (e.g. "yyyy-MM-dd") |
nKind | Numeric | 0 | 0=Date, 1=Time, 2=DateTime |
| Event | Category | Description |
OnChange | Action | Selected date/time changed |
OnDropDown | Action | Calendar dropdown opened |
OnCloseUp | Action | Calendar dropdown closed |
| Platform | Native Widget |
| Windows | DATETIMEPICK_CLASS (SysDateTimePick32) |
| macOS | NSDatePicker |
| Linux | GtkCalendar + GtkPopover |
// Date picker for invoice date
@ 80, 120 DATETIMEPICKER oDtp OF oForm SIZE 150, 24
oDtp:cFormat := "dd/MM/yyyy"
TMonthCalendar CT_MONTHCALENDAR = 37
Inline monthly calendar control. Displays a full month grid for date selection.
| Property | Type | Default | Description |
dValue | Date | Date() | Selected date |
dMinDate | Date | NIL | Minimum selectable date |
dMaxDate | Date | NIL | Maximum selectable date |
lMultiSelect | Logical | .F. | Allow selecting a date range |
lShowToday | Logical | .T. | Highlight today's date |
| Event | Category | Description |
OnSelect | Action | Date selected |
OnSelChange | Action | Selection range changed |
| Platform | Native Widget |
| Windows | MONTHCAL_CLASS (SysMonthCal32) |
| macOS | NSDatePicker (NSClockAndCalendarDatePickerStyle) |
| Linux | GtkCalendar |
9 Native Platform Controls
These controls use advanced OS-specific widgets for maximum native look and feel.
HarbourBuilder automatically maps each control to the correct widget on Windows (Win32), macOS (Cocoa), and Linux (GTK3).