Lazarus 5.0 is not yet released. This page is under construction!
Release
editLCL Changes
editTThemeServices
edit- Introduced IsDarkTheme: boolean method. Returns if we are under dark mode (win32) or dark theme (gtk3, qt/qt5/qt6 etc). Base virtual implementation returns if average brightness of important colors (clWindow, clBtnFace, clForm, clMenu) is <= 90. Under windows it returns true if value of registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize\AppsUseLightTheme is equal to 0.
TLabel
edit- The label's
Captiontext can be fully rotated by giving the label'sFont.Orientationa non-zero value (interpreted in units of 1/10 degree, positive in counter-clockwise direction, zero along the 3 o'clock direction). Now this is supported also by multi-lined labels. - In case of
WordWrap=true, the maximum length of the lines must be specified in pixels by means of the newWordWrapLengthproperty. When this length is exceeded the text is wrapped into a new line.
TCustomEdit
edit- Added property "Layout: TTextLayout"
not published yet, set by code only
tlCenter for default
supported on Cocoa
disabled by default
- Added property "Options: TEditOptions"
not published yet, set by code only
[] for default
[teoEnableTextLayout] to enable Layout
TToolBar
edit- Added property "Menu: TMainMenu"
Display the contents of a main menu on the Toolbar
TColorDialog
edit- Added TColorDialogOptions for non-Windows widgetsets.
- New property AlphaChannel (for widgetsets that support this)
TTreeView
edit- Custom-painting was refactored to provide more flexibility. The so-far ignored painting stages
tvsPreEraseandtvsPostErasewere activated for theOnAdvancedCustomDrawItemevent. See TTreeView#Painting_of_the_TreeView - The HideSelection property has been changed to behave like in Delphi.
- Old behaviour: The property was ignored. An unfocused treeview did show the selection even when
HideSelection=true. - New behaviour: Now the selection of an unfocused tree is really hidden when
HideSelection=true. - A "compatibility" property
HideSelectionModewas introduced to switch between old and new behaviour. However, this property was marked as deprecated and will be removed in v5.99.
- Old behaviour: The property was ignored. An unfocused treeview did show the selection even when
- Functionality to save/load a TTreeView's Items to/from an xml file (or stream) are added in the newly added TreeStorage unit.
TShellListView
edit- Supports additional columns now
- Old behaviour: The component had supported only a "Name", "Size" and "Type" column.
- New behaviour: The
Columnsproperty is published now so that columns can be added/deleted in the Object Inspector. Each column has a new fieldColumnID (=cidFileName, cidSize, cidType, cidAttr, cidDateModified, cidCustom)to define which piece of information should be extracted from the file's search record stored in theFileInfofield of theListItem. In the special case ofColumnID=cidCustom, an additional integer fieldCustomIDmust provide an identification value for the newOnGetCellTextevent in which the text for this particular column cell can be defined.
TSpeedButton, TBitBtn
edit- New property DrawEffectsEnabled to override the theme settings to create visual feedback for mouse-down and mouse-over actions in these buttons when no dedicated icons are available for these states. Allowed values are
deeAlways,deeNever,deeSystem,deeApplication(default).deeSystemcorresponds to the old behaviour controlled by the theme services.deeApplicationmeans that the application-wide setting inApplication.GlyphDrawEffectsEnabledwill be used; the available options here aregdeAlways,gdeNever,gdeSystem(default).
TApplication.OnLog
edit- New event OnLog was added to TApplication. If assigned, the event fires when the user calls TApplication.Log.
TCustomListBox
edit- Support for "virtual mode" has been added (Windows only ATM)
- New event OnData: fired in virtual mode when reading Items[Index]
- New event OnDataObject: fired in virtual mode when reading Items.Objects[Index]
- New event OnDataFind: fired in virual mode when calling Items.IndexOf()
- In virtual mode you cannot add, delete, change, clear, sort (etc.) Items or Items.Objects
TWidgetSet
edit- New methods SetDCOpacity(DC: HDC; AOpacity: Byte) and GetDCOpacity(DC: HDC): Byte; set/get opacity of device context (implemented for all qt, gtk3 and cocoa).
IDE Changes
edit- Find/rename identifier dialog:
- added option Find overrides too to find all overrides of a method and their references.
- now supports ampersands in many places, e.g. &type
- can now rename units and programs
- supports dotted unit names, e.g. rename Tools to My.Utils and vice versa.
- finds references of Result and Self and understands their special meaning.
- File Save as now updates all references even dotted unitnames.
- Unit dependency graph can (optionally) show required package for each unit.
- ideintf:
- SaveEditorFileAs, save a file with an open editor as a specified filename. Updates project and/or packages, lfm and lrs files, project user resources, sanity checks like duplicates, updates editor, renames a pascal unit and references.
- RenameIDEFile: As SaveEditorFileAs, except it works also for files not having an open editor.
- SaveProjectAs: Renames the main source file and lpi file. Updates project and its paths (if moved to another folder). It does not move all project files.
Source Editor
edit- Added support for word-wrap
- Additional Syntax highlighting for Pascal
- Nested Brackets
- Params and types in function headers; Names and Types in var/const/type declarations
- Generic/Specialize params
- Custom words. (Specify Identifiers, keyword or symbols) https://wiki.freepascal.org/IDE_Window:_Editor_Options_HighlightColors#Custom_Words
- Colors for TODO, DONE, NOTE comments (if TodoListLaz package is installed)
- Overview gutter shows all occurrences of "word at caret" in entire file.
- Automatic brace/quote completion https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/23884#note_2980032156
- Optional package: spell checking for source editor
Debugger
edit- "Excluded routines" for stepping
When doing "step into" the debugger can now ignore some routines (matching name or file)
E.g. for an RTL with debug info, fpc_object_check can be added to be ignored
- More drag and drop of watches
- Watches can be dragged from: Locals and Inspect-grid.
- Inspect and Evaluate accept dropping watches
- Watches, Expand <> Collapse is now remembered and restored (not persistent, only while project is open)
When Running/Stepping between location that have expandable data, the watch will be expanded again as soon as the data allows for it.
- Watches: Option for a watch that has "identifier not found" to search in calling stackframes.
If the current procedure does not have any var (including globals) named "Foo" in scope, then the watch can display the value of Foo in any of the callers.
- Step Over/In/Out: if the step is interrupted (e.g. at a breakpoint or exception) it can be continued with "continue last step"
- Move "ignored exceptions" to "breakpoint window" for easier access. IDE_Window:_Breakpoints
- Exception-Filter now can be in breakpoint groups for automatic enabling/disabling
- Exception-Filter now can have conditions (fpdebug, limited gdb) / evaluating global variables only
- Breakpoints/Exceptions: power on/off to switch all breakpoint/exception-handling off. Assignable to keycombo.
- Linux: debug app with terminal as launcher app. https://forum.lazarus.freepascal.org/index.php?topic=74772
Messages window
edit- Selection with mouse and keyboard works over all messages, including many message groups. Usually the groups are from different package compilations. All usual keyboard shortcuts work now.
- Behaves well also with external tool output. Earlier everything was considered coming from FPC and was filtered out.
- The window does not show up automatically if a user so chooses, or it shows only with fatal errors.
Linux default widgetset
edit- Default widgetset under linux is gtk3. Supports x11 and wayland desktops. You may need to install `libgtk-3-dev` on your linux machine.
Components
editSynEdit
edit- Word-wrap can now be used with Folding. (some config in code required)
- Rewrite of TSynMarkupHighlightAll
- Now supports "On Idle" scan
- Scans whole text when checking for second occurrence of search term
- "Word at Caret" has provider for Overview-Gutter (show all positions in entire file)
- Improvements to Highlighters
- XML (comments, processing instructions, namespace)
- Pascal
- "Custom Words": user defined context (keyword, ident, comment,...) sensitive full-words
- "at" in "raise exception at 123"
- Declaration Sections: show ident, value, type in var/const/type blocks and function declarations
- Color params/constraints in generic/specialize
- Labels (if immediately followed by colon)
- Comments, individual colors for slash, brace and ansi comment.
- Colors for nested brackets (rainbow brackets)
- SQL add dialect for MSSQL 2022
- Overview Gutter
- Show all positions of the "current word" (the word at the cursor) or the current selection (if the markup of current word is enabled in text too)
TAChart
edit- New series type, TStateSeries, for displaying the state of machines etc. Also usable for a simple Gantt chart.
- Adaptive sampling of x intervals in
TFuncSeriesandTExpressionSeriesprovides smaller x intervals at places where the function is steep resulting in improved rendering of narrow peaks and in speed increase. This is done by switching the newStepModeproperty fromsmConstant(current behaviour) tosmAdaptive. The adaptive mode is controlled by the new propertiesEpsilonandPixelOversampling. - Improved rendering of broken lines: new property EnhancedBrokenLines of new TEnhancedChartPen used by some TLineSeries and other line-oriented series types.
- The new boolean property GridCentered of
TChartAxisallows to draw the axis grid lines between the axis marks to separate the bars in bar charts visually. - The title of a chart axis (
TChartAxisTitle) can now be placed also at the beginning and end of the axis line (in addition to the centered position). This is controlled by the new propertyAnchor = (taStart, taCenter, taEnd). Another new property,AnchorDistance, allows to control the distance of the title from the start and end of the axis line. The same properties have been introduced forTChartTitleto control the title position across the chart's client width. Previously, this behaviour had been enabled by theFullWidthproperty, which has been marked as beingdeprecatednow. - The new
TChartAxisTitleproperty FixedSize, if > 0, reserves a well-defined amount of space for the axis title perpendicular to the axis direction. Together withTChartAxis.LabelSizeit helps to achieve better alignment of multiple charts, independent of the count of title lines and length of axis labels. - Axis drawing has been split into two steps, one for the grid and minorgrid, and one for the axis line and axis title to avoid painting over items of a previously. The old drawing method in which both steps are executed for the same axis in a single call,
Draw, has been marked as beindeprecated.
ToDoList
edit- The main GUI was improved to be more logical.
- Multiline ToDo items are supported. They are enclosed inside { } comments.
- Editing an existing ToDo item is now possible using the same dialog that is used to add a new item. It can be done with a button in ToDo list, or from the editor popup menu when cursor is inside a ToDo item.
Codetools
edit- Lots of improvements affecting code completion.
- Codetools also deals with Find/rename identifier dialog and dotted unit names which were mentioned earlier.
- Timestamp calculations use UTC time instead of local time. This affects the IDE, too. It means that files are not mysteriously reloaded when traveling over time zones or working when the daylight saving shift happens.
Metafile support
edit- An experimental version of cross-platform metafile and canvas classes were added:
TlmfImageand TlmfCanvas (components/LazMetaFile). Still some issues, but hopefully will be improved.
LazUtils
edit- FileUtil.DeleteDirectory() function has new parameters:
- Force: Boolean. If set to True it will also (try to) delete read-only files and folders.
An overload with the old signature exists, which preserves the old behaviour (not deleting read-only files/folders). This overload is deprecated and will be removed in the next major release. - Culprit: String (out parameter). If the function fails, it contains the name of the first file or folder that could not be deleted.
An overload without that parameter will remain.
- Force: Boolean. If set to True it will also (try to) delete read-only files and folders.
- The deprecated UTF8Character* functions were removed from LazUTF8. They are replaced with UTF8Codepoint* functions. The word "Character" is very ambiguous in Unicode.
- The deprecated THandle = type PtrUInt redefinition was removed from LCLType. It was misleading and error prone because THandle in Sysutils is a LongWord. It can also map to different types in different operating systems. LCL uses TLCLHandle which is PtrUInt.
Changes affecting compatibility
editLazUtils incompatibility
editsffFindProgramInPath
edit- Previous: sffFindProgramInPath did include sffDontSearchInBasePath only on Unix
- New behaviour: It now includes sffFindProgramInPath on all platforms
- Reason: Security
- Remedy: You can use: sffFindProgramInPath-[sffDontSearchInBasePath]
FindDefaultExecutablePath
edit- Previous behaviour: In win32/64 FindDefaultExecutablePath searched in current directory.
- New behaviour: It does not.
- Reason: Security
- Remedy: Use SearchFileInPath directly:
Result:=SearchFileInPath(Executable, BaseDir, GetEnvironmentVariableUTF8('PATH'), PathSeparator, sffFindProgramInPath-[sffDontSearchInBasePath]);
LCL incompatibility
editTCanvas.PolyBezier
edit- Previous behaviour: In win32/64 widgetset no curve was drawn when the "Continuous" argument was true and the number of provided points did not correspond to a full number of bezier segments.
- New behaviour: Such extra points are ignored now so that a bezier curve will be drawn.
- Reason: Different behaviour to all other widgetsets. Now all widgetsets behave in the same way.
- Remark: The new behaviour is not compatible to Delphi any more, but it is hard to believe that the old behaviour is used to advantage anywhere.
- Remedy: Do not draw the PolyBezier if
Continuous_argument and ((N-1) mod 3 <> 0)where N is the number points passed to PolyBezier.
TCanvas.Arc
edit- Previous behaviour: Arcs drawn by the TCanvas.Arc method had different start and end points depending on the widgetset used.
- New behaviour: The start and end point calculation was changed to deliver consistent results. Non-circular arcs with non-orithogonal start/end points will look slightly different now.
- Reason: If you really need the old behaviour you must provide conversions from polar to eccentric angles.
LazControls incompatibility
editTTreeFilterEdit
edit- The "Item" property of class TTreeFilterBranch has been changed
- Old: property Items: TStringList
- New: property Items: TStrings
TTreeFilterBranch = class
public
property Items: TStrings ...;
- TStringList exposed properties that - if changed - would have affected the correct operations of TTreeFilterBranch.
- If any code relied on properties not present in TStrings, then it should use a TStringlist of its own, and assign the results, once completely prepared.
- It is not possible to cast the "Items" property as "TStringList(FilterBranch.Items)". The underlying implementation does not use a Stringlist. Such a type-cast will crash.
SynEdit
editFor a list of compatibility affecting changes in SynEdit see SynEdit_Changes
IDE Intf
editTDebuggerIntf / DbgIntfDebuggerBase
edit- FileOverwriteStdIn (Out/Err) changed to TargetIoStdInMode/...
- Reason: A simple bool no longer is enough, this is now an enum.
- Remedy Change the name in any code accessing it. Use "Value = enum" to determine the wanted behaviour. If you need compatibility for both, then add a class helper
- FileNameStdIn/Out/Err changed to TargetIoStdInFileName
- Reason: Stay in sync with above name
- Remedy Change the name in any code accessing it. Use "Value = enum" to determine the wanted behaviour. If you need compatibility for both, then add a class helper
MenuIntf
edit- Obsolete "mnuComponent" variable has been removed
- Reason: An alternative "mnuPackage" equivalent exists for nearly 19 years.
- Remedy: Use "mnuPackage" instead.
IDE incompatibility
editA long lasting refactoring effort was completed. LCL dependency was removed from IDE packages which logically don't depend on LCL. It was also removed from LazBuild and thus the NoGui widgetset hack is not used there any more.
Some units and type definitions were moved during refactoring. The original ones are forwarded and marked as deprecated. It means people should pay attention to "deprecated" messages and change their code to eliminate them. Then in later versions (6.0) those "deprecated" definitions will be removed. After that the code will probably stay stable as no big refactoring is needed.
TPropertyEditorHook.AddHandlerPersistentDeleted
editThe parameter APersistent was changed from TPersistent to Pointer to avoid object checks on freed memory.
LPI (Lazarus project file) format changed
editThe LPI format changed between file version 12 and 13. Lazarus 5.x reads all legacy files correctly.
To be on the safe side, the "Maximize compatibility of project files" settings is now always checked by default - both for legacy and new projects. If you want to take advantage of the new format and you are aware of the legacy compatibility issue, you have to uncheck the "Maximize compatibility of project files" settings manually in "Project Options -> Miscellaneous".
- Remedy: Keep the default "Maximize compatibility of project files" settings in "Project Options -> Miscellaneous" if your project has to be opened in Lazarus 4.x and older.
"Maximize compatibility of project files" settings changed
editThe "Maximize compatibility of project files" doesn't store indexed XML lists anymore. As a result, Lazarus older than 2.2.0 won't be able to open Lazarus 5.0 project files. https://wiki.lazarus.freepascal.org/Lazarus_2.2.0_release_notes
- Remedy: There is no. Lazarus 2.0.x is already 6 years old and not supported anymore.
aggpas incompatibility
edit- The
arcprocedure in unit agg_2D was modified to use theFillAndStrokeparameter for more flexibility. The old version had the parameterStrokeOnlyinstead. The change thus may break existing code. The old behaviour can be restored by callingagg2D.noFillbeforearc.