Sign in Join
Wiki copytemporary

Lazarus 2.2.0 release notes: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## LazUtils Changes
22
33### FileExistsUTF8 uses SysUtils.FileExists
44
55- Old behavior: FileExistsUTF8 supported Unicode in fpc 2.6.x under Windows
66- New behavior: FileExistsUTF8 now calls SysUtils.FileExists, which supports Unicode under Windows since fpc 3.0
77- Reason: Simplified
88
99### Masks unit
1010
1111- An mechanism to disable sets in a specified mask is implemented. For this purpose a new parameter Options: TMaskOptions is introduced. Specifying moDisableSets in the Options parameter will disable interpreting '\[' as the begin of a set in the specified mask.
1212- Example: MatchesMask('\[x\]','\[x\]',\[moDisableSets\]) will return True.
1313
1414### LazFreeType
1515
1616- Freetype font rendering units were moved to a package of its own "components/freetype/freetypelaz.lpk"
1717- Reason: Units have grown to an impressive number
1818
1919### PasWStr unit removed
2020
2121- The PasWStr unit has been removed.
2222- Reason: it contained functional code only if the compiler was pre 3.0.
2323- Remedy: remove PasWStr from your uses clause.
2424
2525## LCL Interfaces Changes
2626
2727### Internal component registration and TLCLComponent.NewInstance was optimized
2828
2929LCL components are registered and mapped to a widgetset by TLCLComponent.NewInstance. This is an undocumented implementation detail and should not affect any components outside of LCL itself. However some external components could support widgetsets the same way. Then "class procedure WSRegisterClass; override;" is needed having a call to "RegisterWSComponent()". It was added to component OpenGlContext in trunk r63636. Please use it as an example if needed.
3030
3131### Widgetsets
3232
3333- Qt5 widgetset needs libQt5Pas v 1.2.8 since result of QWidget_winId() is changed from PtrInt to PtrUInt.
3434 - Windows: Qt5Pas1.dll is already in lazarus trunk binaries directory.
3535 - Linux: distributions should rebuild libQt5Pas packages.
3636 - macOS: you should rebuild libQt5Pas against downloaded Qt5Pas libs (Qt5-5.6 is minimum).
3737
3838- Qt5 added QLCLOpenGLWidget into libQt5Pas v.1.2.8 for full OpenGL component support.
3939
4040- Qt, Qt5 and Gtk2: Form dimensions are accurate now on x11 (frame around form).
4141 - Solution is provided by creating dummy widget before Application.MainForm.Handle is created. This can be disabled via command line switch "-disableaccurateframe". This feature is used inside WidgetSet.GetWindowRect() only.
4242
4343- Qt and Qt5: Form dimensions are accurate now on MS Windows and macOS.
4444 - This is accomplished by creating winID if form isn't mapped yet inside WidgetSet.GetWindowRect().
4545
4646## LCL Changes
4747
4848### TLazIntfImage.Create with size and description flags need no CreateData anymore
4949
5050- Old: After creating of a TLazIntfImage with size and flags CreateData has to be called
5151- New: Creating of a TLazIntfImage with size and flags internal calls CreateData
5252- Reason: Simplify, see [Issue \#35035](https://bugs.freepascal.org/view.php?id=35035)
5353
5454### TValueListEditor
5555
5656- Old behaviour: having the current NameValueSeparator (by default: '=') in the Key column was allowed.
5757- New behaviour: you cannot have a NameValueSeparator in the Key column. If you type the NameValueSeparator in the Key column, the focus will move to the Value Column. If you paste it into the column, it will be removed (without any feedback or warning).
5858- Reason: By design a Key can never have a NameValueSeparator in it. Having it there causes havoc. See [this forum post](https://forum.lazarus.freepascal.org/index.php?topic=51977.0;topicseen).
5959- Note: This new behaviour is not Delphi compatible (which is a conscious design decision), Delphi raises an exception if you try to type or paste a NameValueSeparator in the Key column.
6060- Revision: r64089 and r64090.
6161
6262### TShellTreeView
6363
6464- New event OnAddItem gives possibility for finer control over what to add to the tree.
6565- Shell icons are displayed automatically in Windows when no imagelist is attached and when UseBuiltInIcons is true.
6666
6767### TShellListView
6868
6969- New event OnAddItem gives possibility for finer control over what to add to the listview.
7070- New property MaskCaseSensitivity to allow e.g. case-insensitive masks on *nix. The property defaults to platfom standard behaviour.
7171- Shell icons are displayed automatically in Windows when no imagelist is attached and when UseBuiltInIcons is true.
7272
7373### New Screen temporary cursor
7474
7575Screen has new methods:
7676
7777- BeginTempCursor / EndTempCursor
7878- BeginWaitCursor / EndWaitCursor
7979- BeginScreenCursor / EndScreenCursor
8080
8181These should be used for temporary cursor changes instead of setting the Screen.Cursor property directly. They ensure that valid cursor values are restored.
8282
8383### TMaskEdit
8484
8585- New property ValidationErrorMode to allow not raising an exception when validation fails, but instead firing an OnValidationError event.
8686- New property EnableSets to allow specifying sets in the EditMask property.
8787
8888### TGroupBox, TRadioGroup, TCheckGroup
8989
9090- Old behaviour Win32: You could set property Color and it was directly displayed.
9191- New behaviour Win32: If you want to change the color, you have to set ParentBackground := False;
9292- Reason: TGroupBox and TRadioGroup are now transparent like in Delphi (Delphi does not have a TCheckGroup). See [Issue \#37151](https://bugs.freepascal.org/view.php?id=37151)
9393
9494### TFrame
9595
9696- Old behaviour Win32: You couldn't change the color of TFrame.
9797- New behaviour Win32: If you want to change the color, you have to set ParentBackground := False;
9898- Reason: Default TFrame is transparent, but you can change the color if you want. See [Issue \#35229](https://bugs.freepascal.org/view.php?id=35229)
9999
100100### T(Float)SpinEdit
101101
102102- New property EditorEnabled to disable direct user input in the edit. If set to False, users can only change the value by using the spinners or the arrowkeys.
103103
104104### TListBox
105105
106106- Old: ScrollWidth always was received from OS.
107107- New: If ScrollWidth is set, this value is taken. If default 0 is set, at runtime the ScrollWidth is received from OS.
108108- Reason: Enabling of ScrollBar. See [Issue \#19079](https://bugs.freepascal.org/view.php?id=19079)
109109
110110## IDE Changes
111111
112112- Added IDE macro \$(OutputFile) for the outputfile of the project. This usually corresponds to \$(TargetFile), except when having a host application, in which case \$(TargetFile) is the host application, while \$(OutputFile) is the project executable (or library).
113113- Codetools support for anonymous functions
114114- "Close tabs to the right" in Source-Notebook
115115- Buttons for closing pages on the left, right and others in Search Results window
116116- An options page "Environment \> IDE Startup" in the IDE Options dialog. Allows selecting a project type to be created when the IDE starts.
117117- Object Inspector
118118 - Keep Expanded/Collapsed states in the component tree after adding or deleting a component or changing Z-order.
119119 - Remember Expanded/Collapsed states in the component tree when switching between designer forms.
120120 - Editor window for collections, like Fields, Columns, Params etc. shows now collections of same type when switching between controls of same class.
121121
122122- Project Inspector
123123 - GUI for Min / Max version of a package requirement, similar what the Package Editor has.
124124- Editor
125125 - Added commands (key-shortcut) for
126126 - Swap line/selection up/down (selection is extended to full lines)
127127 - Duplicate line/selection (selection is extended to full lines)
128128 - Copy/Cut append to clipboard (with space separator, unless already present)
129129 - Copy/Cut (append) line/selection to clipboard (selection is extended to full lines, and also always includes line with caret)
130130 - Option to prevent Select-All/Paragraph/ToBrace from scrolling
131131 - Identifier Completion to trigger on any input, not just on dot. (Optional, must be enabled first)
132132
133133- Extension of master PO files (a.k.a. templates) is changed from .po to .pot.
134134 - Example for IDE translation:
135135
136136
137137
138138Previously we had:
139139
140140
141141
142142Template: lazaruside.po
143143
144144German: lazaruside.de.po
145145
146146Russian: lazaruside.ru.po
147147
148148Spanish: lazaruside.es.po
149149
150150
151151
152152Now we have (note extension of the template):
153153
154154
155155
156156Template: lazaruside.pot
157157
158158German: lazaruside.de.po
159159
160160Russian: lazaruside.ru.po
161161
162162Spanish: lazaruside.es.po
163163
164164:* Reasons:
165165
166166:** .pot is an 'industry standard' extension for PO template files. As a consequence, PO editors can now open our templates 'out of the box' and automate creation of translations.
167167
168168:** It is much simpler to detect template files now that dotted unit names are allowed.
169169
170170:* Remedy: You can safely remove .po template files from your project after you rebuild your project with the new IDE (at this point .pot files should be generated).
171171
172172- Project Groups:
173173 - Option frame under Tools / Options
174174 - Load last open project group on start (option to disable)
175175 - More / Undo menu item to undo a delete
176176 - More / Info menu item to show some stats. At the moment it shows all source directories.
177177 - Find in Files has a new option "Search in project group".
178178 - Option to redirect the IDE command Compile/Build project to Compile/Build the selected target in the project group editor. For example Ctrl-F9 can compile the whole project group.
179179- Designer
180180 - Change background color of non form designer to clWindow. Color is now changeable per option.
181181 - Remove environment option "Reduced designer painting" to prevent painting artefacts. See [Issue \#23741](https://bugs.freepascal.org/view.php?id=23741) or [Issue \#33781](https://bugs.freepascal.org/view.php?id=33781)
182182- Package Manager
183183 - When creating new package or component, suggested name is not localized anymore (always 'NewPackage' for every language). This change prevents crashes on attempt to create a new package when IDE interface language has non-latin alphabet.
184184
185185- macOS: relocation of the Lazarus IDE "Lazarus \> Tools \> Options" menu to "Lazarus \> Preferences".
186186
187187#### Debugger
188188
189189- LazDebugger-FP (FpDebug) v1.0 is now the default for **new** installations on Windows and Linux. Users with existing config should change their settings.
190190- GDB(mi): comes now with gdb version 9.2 modified for use with unicode. (for 32 and 64 bit)
191191
192192:* GDB(mi) Debugger: Stepping from exception to finally/except now works under Win64 SEH. (Requires updated GDB)
193193
194194:* GDB(mi) Debugger: Updated GDB for Win64 to 8.2
195195
196196:* GDB(mi) Applying a condition to a breakpoint will now mark the breakpoint as invalid, if gdb does not accept the condition. The breakpoint may still break (or not), but the condition was not set.
197197
198198:* Debugger Config: The IDE now provides the ability to set up different debugger-configs as named profiles.
199199
200200:* "Run to Cursor" in addition to the existing "Step over to Cursor", the debugger (gdbmi/fpdebug) now provide "Run to Cursor".
201201
202202## Components
203203
204204- OpenGL: full support for Qt5 widgetset
205205
206206### AnchorDocking
207207
208208- New button to minimize a docked site.
209209- Allow ManualDock for target AnchorDockPanel.
210210- New option "Multiline Tabs" for docked pages added.
211211- New option "Floating windows on top" added. If there are undocked windows shown, show these on top of main window. In a own application, there can be set DockMaster.MainDockForm, then all floating windows are shown on top of it. If MainDockForm is not set, Application.MainForm is used.
212212- AnchorDocking can load layouts HighDPI aware
213213
214214### Spotter
215215
216216- New IDE addon, showing a search list of all IDE commands.
217217
218218### TAChart
219219
220220- New chart tools "TAxisClickTool", "TTitleFootClickTool" and "TLegendClickTool": Create OnClick events when the user clicks on a chart axis or its title, the chart title or footer, or the chart legend, respectively. Good for creating an interactive GUI for formatting charts.
221221- New property "AllowPanning" to turn built-in panning on/off.
222222- New property "LimitToExtent" for zooming tools, avoids zooming out of the chart's full extent.
223223- New property "Wordwrap" for chart axis titles as well as chart title and footer.
224224- New series type "TPolygonSeries" which draws a filled closed polygon. Can be the basis of GIS and contour plots.
225225- Property editor for TSeriesPointerStyle.
226226- TBarSeries:
227227 - New property "BarShape" for drawing alternative shapes (cylinder, hexagonal prism, pyramid or cone) instead of rectangular bar.
228228- TPieSeries:
229229 - Impoved painting of 3D pie series due to new properties: "DepthBrightnessDelta" allowing to darken or brighten the sides of the pie slices, "Orientation" and "ViewAngle" for different views of the series
230230 - New property "InnerRadiusPercent" allowing to draw a chart (donut).
231231 - New property "MarkPositionCentered" for attaching data point labels to the pie center instead of the pie perimeter.
232232 - New property "StartAngle" to define the position of the first pie slice.
233233 - New property "AngleRange" to define tha total angular range between first and last slice.
234234- TListChartSource can be sorted by X, Y, XList, YList, Color, Text, or in a user-specific way defined by the event OnCompare.
235235- New "TSortedChartSource" which, if inserted between original chart source and series, allows sorting of TUserDefinedChartSource or TCalculatedChartSource by the same criteria as TListChartSource.
236236- New property "AdjustSides" of TChartExtentLink allowing to automatically align the sides of aligned charts to each other (in case of differently sized axis labels and/or titles).
237237- New component "TChartLiveView" which represents a scrolling viewport for a large amount of data arriving by and by.
238238
239239### TSpinEditEx
240240
241241- New property "ThousandSeparator" to allow displaying the value with thousandseparators inserted.
242242
243243### TFloatSpinEditEx
244244
245245- Entering text in scientific notation (e.g. "1.23E3") is now supported.
246246- New property DisplayMode that controls in wether or not to use scientific notation. If set to dmAuto the following new properties control how the value is displayed:
247247 - Property ExponentialFormatLimitPos controls from which positive exponent on scientific notation is used for displaying.
248248 - Property ExponentialFormatLimitNeg controls from which negative exponent on scientific notation is used for displaying.
249249- New property Precision controls the precion used when value is displayed in scientific notation.
250250
251251### DockedFormEditor
252252
253253- New package DockedFormEditor added. For more info see [[DockedFormEditor]].
254254 - Replacement for Sparta_DockedFormEditor. All Sparta packages are now marked as deprecated and will be removed in a future Lazarus version.
255255 - Optional Anchor Designer included.
256256
257257### Jedi Code Format
258258
259259- Various improvement for the parser. It now supports most modern Object Pascal syntax.
260260
261261### Delphi Compiler Tool
262262
263263Use the Delphi command line compiler in Lazarus: [[Lazarus Delphi Compiler Tool]]
264264
265265## Changes affecting compatibility
266266
267267### LazUtils
268268
269269#### PO files
270270
271271- Trailing lineendings are not forcibly added to multiline strings in PO files anymore. Now multiline strings in PO files match exactly corresponding resource strings.
272272
273273:* Reasons:
274274
275275:** PO format does not prohibit multiline strings without trailing lineendings (and e.g. recent versions of Poedit do not complain about them).
276276
277277:** New behavior unbreaks loading multiline translations from MO files.
278278
279279:* Note that all multiline strings with mismatching trailing lineendings will be marked as fuzzy during translation update.
280280
281281#### LConvEncoding
282282
283283##### Global variable ConvertEncodingErrorRaisesException replaced with ConvertEncodingErrorMode
284284
285285The unit had global variable ConvertEncodingErrorRaisesException (boolean) which is now replaced by the enumeration:
286286
287287``` pascal
288288type
289289 TConvertEncodingErrorMode = (
290290 ceemSkip,
291291 ceemException,
292292 ceemReplace,
293293 ceemReturnEmpty
294294 );
295295var
296296 ConvertEncodingErrorMode: TConvertEncodingErrorMode = ceemSkip;
297297```
298298
299299#### UITypes unit is deprecated
300300
301301The UITypes unit is deprecated in favor of System.UITypes, which is available in FPC 3.2.0 and up.
302302
303303- Reason: System.UITypes is a superset of UITypes and contains some additional constants (Delphi-compatible).
304304- Remedy: Use System.UITypes unit instead of UITypes unit in your programs.
305305
306306### LCL incompatibilities
307307
308308#### TMaskEdit: hexadecimal and binary characters
309309
310310Mask support for hexadecimal and binary characters was added (this is a Lazarus extension, Delphi does not support this).
311311
312312- Old behavior: the characters 'h', 'H', 'b' and 'B' had no special meaning in the EditMask property.
313313- New behavior: these characters now are mask characters for hexadecimal and binary input respectively.
314314- Reason: nice to have feature (QT5 supports it natively).
315315- Remedy: if you need one of these characters as a literal in your EditMask: escape them with a '\\'.
316316
317317#### TMaskEdit: 'C' in EditMask now actually means a character (other than blank) is needed
318318
319319- Old behaviour: both 'c' and 'C' in EditMaks were treated as "any Utf8 char but not necessary".
320320- New behaviour: 'C' is now treated as "any Utf8 char, but NOT SpaceChar".
321321- Reason: Delphi compatibility.
322322- Remedy: use 'c', not 'C', if any character (including SpaceChar) should be accepted.
323323
324324#### TMaskEdit: Validate takes in account Upper- and LowerCase for 'c' and 'C' in EditMask
325325
326326- Old behavior: upper- or lowercase was checked (if so specified by '\>' or '\<' in EditMask) for 'a', 'A', 'l', 'L', 'h' and 'H', but not for 'c' and 'C'.
327327- New behaviour: upper- or lowercase is now also checked for 'c' and 'C'.
328328- Reason: consistency.
329329- Remedy: if you need the old behaviour, insert '\<\>' before 'c' or 'C'.
330330
331331#### TCanvas.PolyBezier default behavior
332332
333333The default value of the Continuous parameter was changed because it breaks Delphi compatibility.
334334
335335- Old behavior: There are several overloads and optional parameters of the canvas' `PolyBezier` method. In the Delphi-compatible call having only the points array as a parameter, the `Continuous` argument has the default value `false`.
336336- New behavior: The argument `Continuous` has the value `true` now.
337337- Reason: The Delphi `PolyBezier` behavior is different from the Lazarus behaviour with the same call parameters; it draws the Bezier curve like Lazarus using `Continuous = true`.
338338- Remedy: To obtain the old behavior expand the parameter list by the `Continuous` parameter set to `false`.
339339
340340#### TImageList stores compressed images in LFM
341341
342342- Old: TCustomImageList stored binary bitmap data of the base resolution.
343343- New: The binary bitmap data streamed to LFM is compressed with ZLib.
344344- Reason: smaller LFM and EXE files.
345345- Effects: Lazarus 1.8 cannot open LFMs with a TImageList from Lazarus 2.2. Lazarus 2.0 can open them.
346346- Remedy: If you want to open a Lazarus 2.2 project in Lazarus 1.8, you first have to open it in Lazarus 2.0, open all forms containing LFMs with a TImageList and resave them. Then you can open these resaved LFMs in Lazarus 1.8.
347347
348348#### TCalendar: option dsStartMonday of DisplaySettings replaced by Delphi-compatible FirstDayOfWeek property
349349
350350- Old behavior: Changing the start day of a week to Monday works only in QT and QT5 widgetsets. And even there it does not allow for other weekdays like Saturday as needed for the Arabian world. Moveover the option is not compatible with Delphi which uses a separate property FirstDayOfWeek.
351351- New behavior: The option dsStartMonday has been removed, use the property FirstDayOfWeek instead. It allows switching to other weekdays as well. The default option, dowDefault, makes the weeks begin with the day defined by the widgetset/OS - which is the old behavior in those cases where dsStartMonday did not work.
352352- Reason: Improved Delphi compatibility, more than two weekdays should be allowed as start of the week.
353353- Remdy: In most cases dsStartMonday probaby has not been set because it did not work. If it was set, ignore the property when reading (or remove the line dsStartMondy = true from the lfm file), and set FirstDayOfWeek to dowMonday in the Object Inspector.
354354- Note 1: The FirstDayOfWeek property is still not supported by all widgetsets. It is respected only for win32, qt and qt5.
355355- Note 2: The name of the default option of FirstDayOfWeek, dowDefault, is not exactly Delphi-compliant (dowLocaleDefault) because a "Locale" does not exist in all widgetsets. Since the default value is not stored anyway this incompatibility may be tolerable.
356356
357357#### TRadioGroup's OnEnter and OnExit events
358358
359359- Old behavior: The OnEnter and OnExit events are triggered by TRadioGroup when another item is selected. As a consequence, these events fire twice when the control receives or loses focus. This is against Delphi behavior.
360360- New behavior: New events OnItemEnter and OnItemExit were added; they fire when the ItemIndex changes and carry the corresponding radiobutton in the Sender parameter.
361361- Reason: No logical behavior; Delphi compatibility.
362362- Remedy: Ony applications evaluating these events for the internal selection change are affected. The new events OnItemEnter and OnItemExit should be used instead.
363363
364364#### ShortcutToText / TextToShortcut
365365
366366- Old behaviour:
367367 - the textual representation of the VK_OEM_PLUS was '+'.
368368 - the result of TextToShortcut('+') was 187.
369369 - the result of TextToShortcut('=') was 0.
370370- New behaviour:
371371 - the textual representation of the VK_OEM_PLUS now is '='.
372372 - the result of TextToShortcut('+') is now 0.
373373 - the result of TextToShortcut('=') is now 187.
374374- Reason: Delphi compatibility.
375375- Remedy: change any shortcuts with value '+' to '='
376376
377377#### TTabControl / x,y in mouse-events (move,down,up,drag) and IndexOfTabAt
378378
379379- Old behaviour
380380 - When the mouse was over the tab, the x/y params to any mouse event where given relative to the embedded PageControl.
381381
382382
383383 For the remaining ClientArea x/y were relative to the TabControl
384384
385385 I.e. X/Y over the tabs where: Negative values for tabs on top / 0..20 for tabs on bottom
386386
387387 This meant that the same x/y in a TabControl could be received for the mouse over a header (tabs at bottom) and the mouse in the client area. (Y=0 to Y=approx-20 did exist twice)
388388
389389 - IndexOfTabAt did expect the x/y as given in the event. ScreenToClient(Mouse.CursorPos) could not be used, as it always returned x/y relative to the TabControl, and never relative to the embedded PageControl
390390- New behaviour
391391 - All X/Y are reported relative to the TabControl. There are no longer any negative values for Y.
392392 - IndexOfTabAt expects coordinates relative to the TabControl
393393- Reason:
394394 - This fixes ambiguity for X/Y value that could occur twice
395395 - IndexOfTabAt can now accept the event-X/Y as well as the ScreenToClient(Mouse.CursorPos)
396396- Remedy:
397397 - If you called IndexOfTabAt with the event X/Y =\> all keeps working
398398 - If you did any amendments to any X/Y (other than calling ClientToScreen), that is if you added/subtracted some constant to "make them work" =\> remove your workaround
399399- See also
400400 - <https://bugs.freepascal.org/view.php?id=38403>
401401 - Cocoa: <https://bugs.freepascal.org/view.php?id=38553>
402402
403403#### Conversion of '\n' sequences in LCLTaskDialog.TTaskDialog
404404
405405- Old behaviour:
406406 - '\n' sequence was converted to linefeed in the following fields: Title, Inst, Content, Verify, Info, InfoExpanded, InfoCollapse, Footer.
407407- New behaviour:
408408 - '\n' sequence is no longer converted to linefeed in these fields.
409409- Reason: Conversion of '\n' to linefeed mangled strings like
410410 ``` pascal
411411 'Save "c:\new_folder\new.work"?'
412412 ```
413413- Remedy: replace '\n' sequences which should be converted to linefeeds with LineEnding constants, i.e. instead of
414414
415415'Line1\nLine2'
416416
417-</syntaxhighlight>
418-
419417use
420418
421419``` pascal
422420'Line1'+LineEnding+'Line2'
423421```
424422
425423- See also <https://bugs.freepascal.org/view.php?id=38676>
426424
427425#### TScrollingWinControl.ScrollInView and successors (e.g. TScrollBox, TForm)
428426
429427- Old behavior: Scrolling of a control in view was possible without ScrollBars visible.
430428- New behavior: Scrolling of a control in view is only possible when ScrollBar is visible.
431429- Reason: A scrolling feature is only with ScrollBars usefull. Also some controls are painted wrong, when no scrollbar is visible.
432430- See also
433431 - <https://bugs.freepascal.org/view.php?id=38838>
434432 - <https://forum.lazarus.freepascal.org/index.php/topic,54354>
435433
436434#### TColorDialog.Title
437435
438436- Old behavior: On Windows, the Title of the TColorDialog was ignored and painted by the OS as the localized text "Color".
439437- New behavior: Now the Title property of the TColorDialog is used like in other widgetsets. The default title is the unlocalized text "Select color" which can be considered to be inconsistent in localized applications.
440438- Reason: An unused property is always confusing to the users.
441439- Remedy: Enter the Title manually when an application requires the localized native title, or use the translation utilities to translate the LCL resource strings.
442440
443441#### GTK2 widgetset version requirement
444442
445443- Old behavior: At least GTK2 2.8 was required.
446444- New behavior: At least GTK2 2.24 is required.
447445- Reason: All supported distribution versions already have GTK2 2.24.
448446- Remedy: GTK2 2.22 may still work (untested). Older GTK2 (2.20 and earlier) versions may still work (untested, so completely at your own risk) after reverting commit 0172124a423be.
449447
450448### Components incompatibilities
451449
452450#### TAChart
453451
454452##### Chart.AllowZoom changed
455453
456454The property AllowZoom of TChart is meant to give the user the chance to turn the builtin zooming feature on or off.
457455
458456- Old behavior: AllowZoom operates also on an external toolset.
459457- New behavior: AllowZoom is effective only for the built-in toolset.
460458- Reason: More consistent handling of properties
461459- Remedy: Use the property Enabled of the external zoom tool to switch zooming off, or don't add a zoom tool at all.
462460
463461##### DataPointDrawTool.OnDraw event deprecated
464462
465463The event OnDraw of the data point draw tools (TDataPointCrosshairTool, TDataPointDistanceTool) will be removed and replaced by the new event OnCustomDraw.
466464
467465- Old behavior: OnDraw uses the chart's Drawer for painting the crosshair or distance bars.
468466- New behavior: the Drawer to be used is passed as a parameter.
469467- Reason: When a chart is painted to an external file the chart's Drawer still refers to the screen; therefore, the datapoint cross hair or distance bars are missing in the external file.
470468- Remedy: Copy the old OnDraw event handler code to the new OnCustomDraw handler, but replace "Chart.Drawer" by the "ADrawer" given as a event parameter.
471469
472470##### TChartAxis.OnMarkToText event deprecated
473471
474472The event OnMarkToText of the chart's axes will be removed and replaced by the new event OnGetMarkText.
475473
476474- Old behavior: The old OnMarkToText event does not have a Sender parameter.
477475- New behavior: The new OnGetMarkText event has the affected axis as Sender parameter.
478476- Reason: When dealing with multiple charts and/or multiple axes, it is currently required to create an individual handler for each axis because it is not possible to determine the axis for which to create axis marks for. This is not required any more with the new event.
479477- Remedy: Copy the old OnMarkToText handler code to the new OnGetMarkText handler.
480478
481479##### OpenGL-related units moved to separate packge TAChartOpenGL
482480
483481- Old behavior: OpenGL-related units had been available in the main TAChartLazarusPackage directly. The drawer unit TADrawerOpenGL was not added to the uses list automatically and required a special treatment (see old OpenGL demo project).
484482- New behavior: OpenGL-related units are now contained in the new package TAChartOpenGL.
485483- Reason: Compilation issues when the system did not contain OpenGL libraries.
486484- Remedy: Add package TAChartOpenGL to the requirements of the project. Only needed when project uses the OpenGL drawer.
487485
488486##### Chart colors changed
489487
490488- Old behavior and reason: Some chart elements had hard-coded rgb colors, such as Chart.Title.Font.Color = clBlue, or ChartAxis.TickColor = clBlack. Therefore, these elements could hardly be discerned when the system runs in "dark mode".
491489- New behaviour: Such critical colors are system colors now which have a decent appearance in both dark and bright mode
492490- Remedy: If the old colors are really needed reset them in the object inspector.
493491
494492#### VirtualTreeViews: Renamed to "laz." prefix
495493
496494VirtualTreeViews is essentially needed by OnlinePackageManager. Having this original package within the Lazarus installation makes is impossible for users to install a different version of this package.
497495
498496- Old behavior: Projects with VirtualTreeViews required the "virtualtreeview_package" and had the unit "virtualtrees" in the uses clause. The registered component classes were named "TVirtualStringTree", "TVirtualDrawTree", "TVTHeaderPopup".
499497- New behavior: The package was renamed to "laz.virtualtreeview_package". All file names were changed to have a "laz." prefix, i.e. the uses clause will have to contain "laz.virtualtrees". The registered components are named "TLazVirtualStringTree", "TLazVirtualDrawTree", and "TLazVTHeaderPopup".
500498- Reason: Avoid naming conflicts when another version of VirtualTreeViews is installed
501499- Remedy: For existing projects requiring the VirtualTreeViews distributed with Lazarus,
502500 - open the lfm file in an external editor and replace "TVirtualStringTree" by "TLazVirtualStringTree", as well as - if available - "TVirtualDrawTree" by "TLazVirtualDrawTree" and "TVTHeaderPopup" by "TLazVTHeaderPopup".
503501 - open the project in the IDE, remove package "VirtualTreeView_package" from the project requirements and replace it by "laz.virtualtreeview_package"
504502 - in the pas file's "uses" clause, replace "virtualtrees" by "laz.virtualtrees"
505503 - in the pas file replace "TVirtualStringTree" by "TLazVirtualStringTree" (and accordingly for the other VTV components).
506504
507505#### SynEdit
508506
509507SynEdits TextView system has undergone some changes. TextViews (TSynEditStrings) map the physical text (as saved/loaded to/from a file) to what is visible on the screen.
510508
511509This also affects the coordinate system. In addition to [Logical/Physical](https://wiki.lazarus.freepascal.org/SynEdit#Logical.2FPhysical_caret_position) SynEdit now also has ViewedXY. "Viewed" also maps the Y coordinate.
512510
513511##### SynEdit.TextView / TSynEditFoldedView
514512
515513The protected property SynEdit.TextView is no longer of type TSynEditFoldedView. It may hold any other TextView-class instead.
516514
517515- Old behaviour: TSynEditFoldedView was accessible via SynEdit.TextView
518516- New behaviour: SynEdit.TextView can be any TextView
519517- Remedy: SynEdit.TextViewsManager.SynTextViewByClass\[TSynEditFoldedView\]
520518
521519Class hierarchy
522520
523521- TSynEditFoldedView is now a TSynEditStrings.
524522
525523TSynEditFoldedView.Lines/Count
526524
527525- Old behaviour: Lines/Count referred to visible lines only
528526- New behaviour: Lines/Count referred to al lines.
529527- Remedy: Use ViewedLines / ViewedCount
530528
531529Mapping
532530
533531- Old behaviour: TextToViewIndex/ViewToTextIndex =\> ViewPos was 1 based
534532- New behaviour: TextToViewIndex/ViewToTextIndex =\> ViewPos was 0 based
535533- Remedy: Use ToPos() / ToIdx()
536534
537535- Old behaviour: TextPosAddLines with 1 based lines/result
538536- New behaviour: AddVisibleOffsetToTextIndex with 0 base lines/result
539537- Remedy: Rename and use ToPos() / ToIdx()
540538
541539Callbacks
542540
543541- Old behaviour: AddFoldChangedHandler was reporting changes to folding.
544542- New behaviour: AddChangeHandler(senrLineMappingChanged)
545543
546544##### senrTextBufferChanging / senrTextBufferChanged
547545
548546Callbacks on the TextView/TextBuffer were only valid for the current Buffer. If SynEdit shared/unshared the textbuffer, then all handlers needed to be re-registered.
549547
550548This is no longer needed.
551549
552550===== ScreenRowToRow/RowToScreenRow =\> ScreenXYToTextXY/TextXYToScreenXY =====
553551
554552ScreenRowToRow/RowToScreenRow were deprecated, use ScreenXYToTextXY/TextXYToScreenXY
555553
556554The new functions take a point, instead of just a line/row. This reflects the idea that a single text-line can visible occupy several lines. Or mapping can otherwise relay on the x pos, depending on whatever TextViews are used.
557555
558556===== RowColumnToPixels =\> ScreenXYToPixels =====
559557
560558RowColumnToPixels is deprecated, use ScreenXYToPixels
561559
562560##### SynEditExport
563561
564562- Old behaviour: TSynCustomExporter.ExportRange raised an EAbort exception when ALines or Highlighter is unassigned, or when the content of the range to be exported was in fact empty.
565563- New behaviour:
566564 - A verbose exception (ESynExport) is raised when either ALines or Highlighter are unassigned.
567565 - No exception is raised if the range to be exported is empty, it will simply export nothing in that case.
568566- Reason:
569567 - Raising EAbort if the range to be expoterd is empty doesn't really make sense, at least it should not be forbidden.
570568 - Not having a Highlighter or not having Lines is a critical error, and as such must raise a verbose exception.
571569- Remedy: if your code relied on this behaviour (rasing EAbort), you will have to adjust it.
572570
573571#### T(Float)SpinEditEx.ReadOnly now also disables the use of arrowkeys
574572
575573- Old behaviour: if ReadOnly is True, the value of the control could still be changed using the up or down arrow keys.
576574- New behaviour: if ReadOnly is True, the value of the control cannot be changed using the the up or down arrow keys.
577575- Reason: internal consistency and consistency with T(Float)SpinEdit.
578576- Revision: r64952.
579577
580578#### T(Float)SpinEdit(Ex) default value for MaxValue changed
581579
582580- Old behaviour: the default value of MaxValue was 100
583581- New behaviour: the default value for MaxValue is 0. As a consequence the control is no longer "limited" by default.
584582- Reason: compatibility with Delphi's TSpinEdit.
585583- Remedy: in Object Inspector set MaxValue to 100 (if so desired) and re-save the form.
586584- Revision: r64969, r64972
587585
588586==== T(Float)SpinEditEx MaxValue is no longer enforced to be \>= MinValue ====
589587
590588- Old behaviour: if you set MaxValue to a value less than MinValue, MaxValue got the same value as MinValue.
591589- New behaviour: MaxValue is allowed to be less than MinValue.
592590- Reason: old behaviour cased bugs in loading.
593591- Remedy: if your code depended on the old behaviour, you'll have to adjust is.
594592- Note: since the control is only "limited" if MaxValue \> MinValue, it should not really make a difference.
595593- Revision: r65065.
596594
597595#### TSpinEditExBase: call to abstract method SameValue in descendent classes (FPC 3.2.2 only)
598596
599597- Old behaviour: The component used Math.SameValue to compare two values. FPC 3.2.2, however, sometimes refuses compilation because it cannot determine which one of the many overloads of Math.SameValue should be used.
600598- New behaviour: The component has its own method SameValue now. It had to be declared as abstract to keep compilation with FPC 3.2.0 and older. Therefore, all descendants of TSpinEditExBase must override this method.
601599- Remedy: If your descendent class of TSpinEditExBase reports a runtime error "abstract method called" you must implement the method SameValue for it, based on the data type specializing the generic data variable. It is needed only for FPC 3.2.2.
602600- Note: This issues only affects third-party components descending from TSpinEditExBase.
603601- Introduced by revisions <https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/182cc8b8e6d6a671eb62f7177ff86ee948814de8> and <https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/7f45938388be4b3ee50b2cd1ed1d04d991f92143>
604602
605603#### TLabel: DoMeasureTextPosition removed, added DoDrawText instead
606604
607605- Old behavior: TCustomLabel had the DoMeasureTextPosition virtual method that allowed to set the X/Y position of the text.
608606- New behavior: TCustomLabel now has the DoDrawText virtual method that allows to override the whole text painting and automatic sizing of the label.
609607- Reason: It is now possible to override the painting/sizing the label with own text drawing routine, which wasn't easily possible before. Now the TLabel is also Delphi-compatible.
610608- Remedy: if your TCustomLabel descendant used to override DoMeasureTextPosition, it needs to override DoDrawText now and handle the whole paint process.
611609- Note: This issue only affects third-party components descending from TCustomLabel. See more info: <https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39523#note_798080430>
612610
613611### IDE incompatibilities
614612
615613#### LPI&LPS project files: XML structure changed
616614
617615- Old behavior: Child elements had an index suffix.
618616- New behavior: Child elements have no suffix.
619617- Problems: New LPI files cannot be opened in legacy Lazarus installations.
620618- Reason: VCS like the new structure better.
621619- Remedy: Save your LPI files in compatibility mode. (Project options -\> Miscellaneous -\> Maximize compatibility of project files). Users of old Lazarus versions can convert the file format by means of the **[[fixlp]]** utility.
622620
623621#### LPK package files: XML structure changed
624622
625623- Old behavior: Child elements had an index suffix.
626624- New behavior: Child elements have no suffix.
627625- Problems: New LPK files cannot be opened in legacy Lazarus installations.
628626- Reason: VCS like the new structure better.
629627- Remedy: Save your LPK files in compatibility mode. (Package options -\> Usage -\> Maximize compatibility of package file). Users of old Lazarus versions can convert the file format by means of the **[[fixlp]]** utility.
630628
631629### Packages incompatibilities
632630
633631#### ProjectGroups: LPG XML structure changed
634632
635633- Old behavior: The \<Mode?\> elements were not placed within the \<BuildModes\> element. Child elements had an index suffix.
636634- New behavior: Child elements have no suffix.
637635- Problems: New LPG files cannot be opened in legacy Lazarus installations.
638636- Reason: VCS like the new structure better.
639637- Remedy: There is no.
640638
641639## Other release notes
642640
643641---
644642*From the Free Pascal wiki, page "Lazarus 2.2.0 release notes", as it stood on 2024-03-17 after a change by Wp, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
645643Category: Lazarus
646644Category: Release Notes

Back to history