Skip to content

v1.2.0 — Hungarian notation refactor

Choose a tag to compare

@FiveTechSoft FiveTechSoft released this 27 May 17:06
· 10 commits to main since this release

Breaking changes — property rename to Hungarian

Every public control class in source/core/classes.prg migrates from Delphi-style property names to Harbour Hungarian notation. The dual-name aliases (Glyph/Picture, Color/nClrPane, …) are dropped — code using the old names must be updated.

Renamed accessors

  • TControl / TForm: Name → cName, Left → nLeft, Top → nTop, Width → nWidth, Height → nHeight, Text → cText, Enabled → lEnabled, Color → nClrPane, Title → cTitle, AppTitle → cAppTitle, FontName → cFontName, FontSize → nFontSize, BorderStyle → nBorderStyle, Position → nPosition, Cursor → nCursor, Sizable → lSizable, AppBar → lAppBar, ToolWindow → lToolWindow, KeyPreview → lKeyPreview, ShowHint → lShowHint, Hint → cHint, AutoScroll → lAutoScroll, DoubleBuffered → lDoubleBuffered, AlphaBlend → lAlphaBlend, ClientWidth/Height → nClientWidth/nClientHeight, ModalResult → nModalResult, ControlAlign → nControlAlign
  • TButton / TBitBtn: Default/Cancel/Kind/ModalResultlDefault/lCancel/nKind/nModalResult; Glyph dropped, use cPicture
  • TSpeedButton: Kind/FlatnKind/lFlat; Glyph dropped
  • TImage: Picture dropped, use cPicture
  • TShape / TBevel: Shape/PenColor/PenWidth/StylenShape/nPenColor/nPenWidth/nStyle
  • TEarthView / TMap: Lat/Lon/Zoom/MapTypenLat/nLon/nZoom/nMapType
  • TStringGrid: ColCount/RowCount/FixedRows/FixedCols all n-prefixed
  • TMaskEdit: EditMask/MaskKindcEditMask/nMaskKind
  • TCheckBox / TRadioButton: Checked → lChecked
  • TTimer: Enabled → lEnabled
  • TApplication: Title → cTitle

OnXxx event setters and the semantic Value alias on TEdit/TMemo/TComboBox/TListBox are preserved.

Build pipeline catches up

  • include/hbbuilder.ch DSL (DEFINE FORM, BUTTON, CHECKBOX, RADIOBUTTON) expands to the new setters — fixes the IDE startup crash TFORM:_FONTNAME on the FONT clause.
  • Code generators in source/hbbuilder_{win,macos,linux}.prg emit the renamed identifiers; RestoreFormFromCode parsers recognise them.

Samples

Every project under samples/projects/ now builds with a bare harbour.exe invocation (40/40):

  • #include \"hbbuilder.ch\" injected where missing.
  • dotnet/java/rust/ruby editor strings converted to e\"…\\\"…\" extended literals.
  • Duplicate MsgInfo in helloworld/Project1.prg removed.
  • Stray ---- separators and out-of-order OF/PROMPT clauses cleaned up.

macOS build script

  • build_mac.sh now detects mysql-client and libpq dynamically. When either is absent, cocoa_mysql.c / cocoa_pgsql.c compile under -DHB_NO_MYSQL / -DHB_NO_PGSQL and emit HB_FUNC stubs for every HBMYSQL_* / HBPGSQL_* entry declared EXTERNAL in classes.prg. The IDE still links and runs; TMySQL / TPostgreSQL calls return nil/0/empty until brew install enables them.
  • detect_brew_prefix now returns 0 on all paths so set -e does not abort the build before the optional-DB logic runs.

Stress

Test Result
Samples × 5 iterations (Windows) 200/200 OK, 2.81s avg
IDE startups × 10 (Windows) 10/10 alive, 21 MB stable, ~3.5s
classes.prg × 4 platform defines 0 errors
macOS build (iMac 13.7.8) OK, IDE runloop entered

Commits

  • 2e106a8 refactor: TForm/TControl/TButton/... props to Hungarian notation
  • 31b0027 docs(win): update stale Delphi-style refs in hbbuilder_win.prg comments
  • 5b64876 fix(samples): standalone harbour compile across all projects
  • 8137118 build(mac): make mysql-client and libpq optional
  • 21c97fb fix(mac build): detect_brew_prefix must not abort under set -e