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.

PropertyTypeDefaultDescription
nTabIndexNumeric0Currently active tab (0-based)
nTabCountNumeric0Number of tabs (read-only)
nTabPositionNumeric00=Top, 1=Bottom, 2=Left, 3=Right
lHotTrackLogical.F.Highlight tabs on mouse hover
EventCategoryDescription
OnChangeActionActive tab changed
OnChangingActionTab is about to change (can cancel)
PlatformNative Widget
WindowsWC_TABCONTROL (SysTabControl32)
macOSNSTabView
LinuxGtkNotebook
// 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.

PropertyTypeDefaultDescription
lShowLinesLogical.T.Show connecting lines between nodes
lShowButtonsLogical.T.Show expand/collapse buttons
lCheckBoxesLogical.F.Show checkboxes next to items
lSortedLogical.F.Auto-sort nodes alphabetically
oSelectedTreeNodeNILCurrently selected node
EventCategoryDescription
OnChangeActionSelected node changed
OnExpandingActionNode about to expand
OnCollapsingActionNode about to collapse
OnDblClickActionNode double-clicked
OnEditedActionNode label edited
PlatformNative Widget
WindowsWC_TREEVIEW (SysTreeView32)
macOSNSOutlineView
LinuxGtkTreeView (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.

PropertyTypeDefaultDescription
aColumnsArray{"Column1","Column2","Column3"}Column headers (max 8)
aItemsArray{}Rows; each element is an array of strings, one per column (max 64 rows)
aImagesArray{}PNG/ICO paths for ImageList (max 16); required for Icon/SmallIcon modes
nViewStyleNumeric20=Icon, 1=List, 2=Report, 3=SmallIcon
MethodDescription
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
EventCategoryDescription
OnClickActionItem clicked
OnDblClickActionItem double-clicked
OnColumnClickActionColumn header clicked (for sorting)
OnChangeActionSelection changed
PlatformNative Widget
WindowsWC_LISTVIEW (SysListView32) with LVS_REPORT + LVS_EX_FULLROWSELECT|GRIDLINES
macOSNSTableView multi-column
LinuxGtkTreeView + 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:

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:

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.

PropertyTypeDefaultDescription
nMinNumeric0Minimum value
nMaxNumeric100Maximum value
nPositionNumeric0Current progress value
lMarqueeLogical.F.Indeterminate (animated) mode
PlatformNative Widget
WindowsPROGRESS_CLASS (msctls_progress32)
macOSNSProgressIndicator
LinuxGtkProgressBar
// 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).

PropertyTypeDefaultDescription
cTextString""Plain text content
cRTFTextString""Rich text (RTF) content
lReadOnlyLogical.F.Prevent editing
lWordWrapLogical.T.Wrap long lines
nSelStartNumeric0Selection start position
nSelLengthNumeric0Selection length
EventCategoryDescription
OnChangeActionContent changed
OnSelChangeActionSelection changed
OnKeyDownKeyboardKey pressed
PlatformNative Widget
WindowsRICHEDIT_CLASS (RichEdit20W)
macOSNSTextView (RTF enabled)
LinuxGtkTextView (with Pango markup)

TTrackBar CT_TRACKBAR = 34

Slider control for selecting a numeric value within a range. Used for volume, zoom, and similar adjustments.

PropertyTypeDefaultDescription
nMinNumeric0Minimum value
nMaxNumeric100Maximum value
nPositionNumeric0Current slider position
nTickFreqNumeric1Tick mark frequency
lHorizontalLogical.T.Horizontal orientation
EventCategoryDescription
OnChangeActionSlider position changed
PlatformNative Widget
WindowsTRACKBAR_CLASS (msctls_trackbar32)
macOSNSSlider
LinuxGtkScale

TUpDown CT_UPDOWN = 35

Spin button (up/down arrows) typically paired with an edit control for numeric input.

PropertyTypeDefaultDescription
nMinNumeric0Minimum value
nMaxNumeric100Maximum value
nPositionNumeric0Current value
nIncrementNumeric1Step increment
oBuddyControlNILAssociated edit control
lWrapLogical.F.Wrap from max to min
EventCategoryDescription
OnChangeActionValue changed (up/down clicked)
PlatformNative Widget
WindowsUPDOWN_CLASS (msctls_updown32)
macOSNSStepper
LinuxGtkSpinButton

TDateTimePicker CT_DATETIMEPICKER = 36

Date and/or time picker with a dropdown calendar. Provides locale-aware formatting.

PropertyTypeDefaultDescription
dValueDateDate()Selected date/time
dMinDateDateNILMinimum selectable date
dMaxDateDateNILMaximum selectable date
cFormatString""Custom display format (e.g. "yyyy-MM-dd")
nKindNumeric00=Date, 1=Time, 2=DateTime
EventCategoryDescription
OnChangeActionSelected date/time changed
OnDropDownActionCalendar dropdown opened
OnCloseUpActionCalendar dropdown closed
PlatformNative Widget
WindowsDATETIMEPICK_CLASS (SysDateTimePick32)
macOSNSDatePicker
LinuxGtkCalendar + 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.

PropertyTypeDefaultDescription
dValueDateDate()Selected date
dMinDateDateNILMinimum selectable date
dMaxDateDateNILMaximum selectable date
lMultiSelectLogical.F.Allow selecting a date range
lShowTodayLogical.T.Highlight today's date
EventCategoryDescription
OnSelectActionDate selected
OnSelChangeActionSelection range changed
PlatformNative Widget
WindowsMONTHCAL_CLASS (SysMonthCal32)
macOSNSDatePicker (NSClockAndCalendarDatePickerStyle)
LinuxGtkCalendar
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).

On This Page

TTabControl CT_TABCONTROL = 33 TTreeView CT_TREEVIEW = 20 TListView CT_LISTVIEW = 21 TProgressBar CT_PROGRESSBAR = 22 TRichEdit CT_RICHEDIT = 23 TTrackBar CT_TRACKBAR = 34 TUpDown CT_UPDOWN = 35 TDateTimePicker CT_DATETIMEPICKER = 36 TMonthCalendar CT_MONTHCALENDAR = 37