Lazarus 4.0 release notes

From Lazarus wiki
Jump to navigationJump to search

Lazarus 4.0 is not yet released. This page is under construction!

LCL Interfaces Changes

LCL Changes


Support for Queries

  • Because the unit LCLTaskDialog has been deprecated, the query capabilities of LCLTaskDialog.TTaskDialog have been added to Dialogs.TTaskDialog, albeit with a slightly different implementation.
    • New flag tfQuery: adds a query (in the form of a combobox) to the dialog.
      • New property QueryChoices (TStrings): sets the predefined answers.
      • New property QueryItemIndex: sets the ItemIndex of the combobox and holds said ItemIndex when the dialog is closed.
      • New flag tfQueryFixedChoices: control whether or not the user can add his/hers own text to the combobox.
      • New property QueryResult: holds the text of the choice made when the dialog closes.
    • New flag tfSimpleQuery: adds a single line Edit to the dialog. Note: this flag is mutually exclusive with the tfQuery flag.
      • New property SimpleQuery: sets the initial text of the Edit.
      • New property SimpleQueryPassWordChar: sets PassWordChar of the single line query editor.
      • Property QueryResult holds the text of the Edit when the dialog closes.

New events

The following (most of them Delphi compatible) events were implemented:

  • OnDialogConstructed
  • OnDialogCreated
  • OnDialogDestroyed
  • OnVerificationClicked. This also updates the Flags property to reflect the current state of the verification checkbox.
  • OnExpanded. The associated new property Expanded only has meaning in the context of this event.
  • OnTimer
  • OnRadioButtonClicked
  • OnHyperlinkClicked (Windows Vista+ native dialog only). The associated new property URL only has meaning in the context of this event.
  • OnNavigated (Windows Vista+ native dialog only). This event only fires if the dialog has pages (see: MS docs). Pages are not implemented in TTaskDialog, but they might be implemented in a derived class. The event handler must however be in the base class for Delphi compatibility.
  • OnHelp. Does not exist in Delphi (even though Delphi does have a protected method DoOnHelp). Triggers when user presses F1 when the dialog is open.

New properties

  • CollapseButtonCaption: controls the caption of the Expand/Collapse button when the dialog is in expanded state.
  • CustomMainIcon and CustomFooterIcon: icons to be displayed in the dialog (instead of the standard icons) when the flags tfUseHIconMain and tfUseHIconFooter are used.
  • ProgressBar: the progressbar on the dialog. You can set it's properties Position, Min, Max, MarqueeSpeed (native Vista+ only) and State (native Vista+ only). When the dialog is shown, you can send messages (e.g. in OnDialogXXX events) to alter these properties.

Support for messages

  • Support for sending messages (via SendMessage) to the dialog has been added to the emulated dialog. This allows a.o. to enable/disable (radio)buttons, click (radio)buttons and update captions (Title, Text, FooterText and ExpandedText)


  • Added FirstDayOfWeek as a new publishced property since it has been present in TCalendar but could not be accessed easily.


  • New public method function PtInShape(const P: TPoint): Boolean to determine whether the specified point P lies within the shape boundaries.
  • New event OnShapeClick firing when a click on the control occurs within the shape boundaries
  • The control can be selected in the form designer only by clicking somewhere within the shape. Clicking on controls covered by the TShape can still be selected when the click is outside the shape boundary.
  • New event OnShapePoints, together with the new TShapeType element tsPolygon, gives the user the opportunity to define an arbitrary polygon for the component.

IDE Changes

Compiler Options

  • Added project compiler option for SubTarget.
  • Added compiler option Write config instead of command line parameters (@). See here. Useful for passing large amount of paths to the compiler or an easier way to use the Lazarus options in your build scripts.
  • Added predefined variable Laz_FullVersion to conditionals. See here. Useful to define Lazarus version dependent command line parameters.
  • Wildcards * and ** in search paths. See here.


  • Alt + Left-Mouse Gutter click / Ctrl-Alt-F5: Add breakpoint (if not yet set) and ,pen properties of breakpoint.

IDE Interface Changes


Changes affecting compatibility

LCL incompatibility


  • The implementation of TTaskDialog has been refactored.
    • Widgetset specific implementation has been moved to the widgetset.
    • The emulated taskdialog has been moved to a new unit: TaskDlgEmulation.
    • The unit LCLTaskDialog has been deprecated.
    • Remedy: if you use TTaskDialog from (now deprecated) unit LCLTaskDialog, use TTaskDialog from Dialogs unit instead.
  • Execute() now passes the handle of the active form instead of 0.
    • Reason: it makes Execute() honour the tfRelativeToWindow flag.
    • Remedy: if your code relied on passing 0 as the ParentWind parameter use Execute(0) instead.
  • The occurrence of '\n' in e.g. captions is no longer converted to a LineFeed.
    • Reasons:
      • Wrong results if the capion of a (radio)button is set to e.g. 'Save in "c:\new_folder\"'
      • You can have a LineFeed (#10) inside a Pascal string.
    • See also Issue #38676.
    • Remedy: use LineFeed character in captions where applicable.

Components incompatibility

Other release notes