Sign in Join
Wiki copytemporary

Lazarus 2.0.0 release notes: what changed

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

OldNewLine
11**Lazarus 2.0.0 was released on 2019-02-05** [[http://forum.lazarus.freepascal.org/index.php/topic,44161.0.html release announcement]]
22
33# LCL Interfaces Changes
44
55# LCL Changes
66
77### TScrollingWinControl ([[TForm]], [[TScrollBox]], [[TFrame]])
88
99- ScreenToClient and ClientToScreen are now calculated without scrollbar offset. Done for Delphi compatibility.
1010
1111### Support for mouse wheel horz scrolling
1212
1313Added TControl events for horizontal mouse wheel moving (special mice with horz scroll buttons for PC, and modern mice for Mac). OnMouseWheelHorz, OnMouseWheelLeft, OnMouseWheelRight. Events are used in some non native LCL components (TreeView, UpDown, SpinEdit). Native components should handle horz scrolling already.
1414
1515### Compiler defines to exclude some graphics support
1616
1717Added flags to exclude support for some graphics formats to create smaller applications:
1818
1919- -dDisableLCLGIF
2020- -dDisableLCLJPEG
2121- -dDisableLCLPNM
2222- -dDisableLCLTIFF
2323
2424### TCustomImageList / TImageList
2525
2626- the image list now supports multiple resolutions of one image. See [[TImageList|Multiple-resolution TImageList in Lazarus 1.9 and newer]] for more details. As a result all LCL controls support High-DPI glyphs on Windows+Linux and Retina on Mac without any additional code.
2727- every LCL control that supports ImageList has now a new ImagesWidth property to decide what custom width at 96 PPI (100% scale) is to be used. Example: TToolBar.Images/.ImagesWidth, TListView.LargeImages/.LargeImagesWidth, .StateImages/.StateImagesWidth.
2828- set the TCustomImageList.Scaled=True property to let the image list automatically pick up the right resolution for your control.
2929
3030### TSpeedButton, TBitBtn
3131
3232- New properties Images, ImageIndex and ImageWidth. With them full ImageList support was added.
3333 - no need to save the same Glyph in LFM all over the application
3434 - automatic high-DPI image handling
3535
3636### TWinControl.DoubleBuffered, .ParentDoubleBuffered and TApplication.DoubleBuffered
3737
3838- Note: DoubleBuffered is a LCLWin32-only feature
3939- Old behavior: DoubleBuffered wasn't properly implemented and it was forced True
4040- New behavior:
4141 - A Delphi-compatible DoubleBuffered/ParentDoubleBuffered concept was created (it is equal to the Font/ParentFont concept).
4242 - The LCL has the TApplication.DoubleBuffered extension over Delphi that allows you to set form's default DoubleBuffered value globally for the whole application (set Application.DoubleBuffered before creating the first form). The value is then applied to all controls on the form with ParentDoubleBuffered:=True.
4343 - DoubleBuffered is True by default unless in remote session (this is different to Delphi where DoubleBuffered is False by default).
4444 - If you need one specific control to be DoubleBuffered:=False even for Application.DoubleBuffered:=adbDefault, make sure you set control.DoubleBuffered:=False and .ParentDoubleBuffered:=False.
4545
4646### TListView
4747
4848Added CustomSort method like in Delphi.
4949
5050### TTreeView
5151
5252- Implemented HotTrack property (show blue underline for item under cursor).
5353- Implemented auto-scrolling up/down during drag-drop (when mouse reaches the edge of treeview).
5454
5555### FilterOptions in filter controls
5656
5757Base class for filter controls TCustomControlFilterEdit has new property FilterOptions, which is set of such flags:
5858
5959` TFilterStringOption = (fsoCaseSensitive, fsoMatchOnlyAtStart);`\
6060` TFilterStringOptions = set of TFilterStringOption;`
6161
6262Two flags are implemented for 3 filter controls in LazControls: TListFilterEdit, TListViewFilterEdit, TTreeFilterEdit.
6363
6464### Advanced menus Assign
6565
6666- Supported TMenuItem.Assign(TMenuItem): this copies all props of menuitem.
6767- Supported TMenu.Assign(TMenu): this copies all items with all nested subitems from one menu to another (TMainMenu, TPopupMenu).
6868
6969### TPageSetupDialog
7070
7171- TPageSetupDialog: added Margin* and Units properties.
7272- Big rework of Unix TPageSetupDialog, it is now complete like it's on Windows (on Windows it was native, on Unix - emulation).
7373
7474# IDE Changes
7575
7676- several **High-DPI IDE improvements** and retina support on Cocoa
7777- **Delphi Attributes**: Find declaration, parameter hints, \$modeswitch prefixedattributes.
7878- The IDE parses the custom compiler options for the **fpc switch -FN\<namespaces\>**, to define the default namespaces, so you can omit the namespaces in the uses sections.
7979- [[pas2js]] support:
8080 - New IDE package **[[lazarus pas2js integration|pas2jsdsgn]]** (not installed by default):
8181 - You can create a browser or nodejs webapplication
8282 - on *'Run* starts the webapp in your webbrowser
8383 - pas2js settings are automatically fetched, same as fpc settings
8484 - quickfixes work with pas2js messages
8585- added quickfix for fpc message "inherited method is hidden": add modifier *override*, *overload*, or *reintroduce* shortcuts.
8686- added designer menu item to hide icons for components like TOpenDialog. Option: **Show non visual components**
8787- extended filter for the identifier completion window - include identifiers containing prefix. (Settings: IDE Options -\> Codetools -\> Identifier Completion -\> Sorting -\> Include identifiers containing prefix.) See <https://bugs.freepascal.org/view.php?id=32974>.
8888- the identifier completion window includes also text (words) from the currently opened units. It can be disabled or set-up in IDE Options -\> Codetools -\> Identifier Completion -\> Include words
8989- the Publish Project/Package feature and GUI window was revamped. Now all project/package member files are included automatically. More files can be added using a filter. The directory structure is maintained even if some files are in directories "above" the main directory.
9090- the "New Component" window and user interface is improved. It also now supports 3 icons for different resolutions.
9191- the Run -\> Compile many Modes... feature now remembers its previously selected modes.
9292- the Search -\> Procedure List... window now remembers the state of its filter buttons.
9393
9494## Editor
9595
9696- Added new **"smart move cursor"** moving commands to editor mappings. They introduce word jumping positions both at word starts and ends. They are useful as alternative Ctrl+Left/+Right/+Shift+Left/+Shift+Right key
9797- Added Goto/Toggle bookmark submenu to toolbar.
9898
9999
100100Ctrl-b pops up "goto bookmark" list, with location for each bookmark. Ctrl-Shift-b pops up "toggle bookmark" list.
101101
102102- Sublime like handling of selection with right/left navigation keys. Remove selection and keep caret at ex-boundary of selection. To activate check both: "Caret skips selection" and "Caret left/rigt clears selection (no move)". See [mantis 26477](https://bugs.freepascal.org/view.php?id=26477)
103103- More options to fine tune outline colors
104104
105105## Debugger
106106
107107- Auto closing of the asm window, if it was opened by breaking at a none source line. <https://bugs.freepascal.org/view.php?id=27800#c109463>
108108- Dragging selected identifier from source editor to watches window, to create a watch
109109
110110### LLDB based Debugger (New)
111111
112112The main target for this debugger is the Mac environment, which comes with a pre-installed lldb. For other platforms the use of the GDB based debugger is highly recommended.
113113
114114The LLDB debugger depends on the availability and correct function of the lldb executable.
115115
116116- Alpha: LLDB based debugger for MacOs (no code-signing required)
117117
118118
119119This is a raw LLDB wrapper. All watches must be lldb compatible. This may require C-style expressions entered into the watch window.
120120
121121This debugger is experimental and provided "as is".
122122
123123- Beta: LLDB + FpDebug based debugger for MacOs (no code-signing required)
124124
125125
126126This is the recommended LLDB based debugger.
127127
128128To use the lldb based debugger:
129129
130130Open the IDE and install the package "LazDebuggerFpLLdb"
131131
132132- It should be in the list of available packages, but if not it is in components/lazdebuggers/lazdebuggerfplldb
133133- Make sure to use the one with "Fp" in the name. (There also is LazDebuggerLLdb, but it is not as good.)
134134- Restart the IDE.
135135
136136Go to Tools \> Options \> Debugger
137137
138138- In the "debugger type" dropdown, you should find and select "LLDB debugger (with fpdebug)"
139139- The edit below this (where you normally have the path to gdb), should be changed to the path of lldb.
140140
141141
142142(lldb comes with the tools from Apple; and as such it is already codesigned by Apple).
143143
144144In case of problems please see: <http://forum.lazarus-ide.org/index.php/topic,42869.0.html>
145145
146146### GDB based Debugger
147147
148148GDB Debugger new options
149149
150150- Added option "FixStackFrameForFpcAssert" to workaround fpc wrong frame pointer (display correct line after assert failed)
151151- Added option "FixIncorrectStepOver" to workaround "step over" issues experienced on some platforms (step-over acts like step-in) <http://forum.lazarus-ide.org/index.php/topic,44121>
152152- Added option "AssemblerStyle": ATT vs Intel
153153- Added option "DisableStartupShell": Required on MacOs.
154154- Added more size limits for data evaluation (avoid errors, timeouts and extremely slow responses)
155155
156156
157157Some users may experience a small speed gain, when setting both of the "...LengthForStaticArray" values to an equal value, and both of the "...ValueMemLimit" to an equal value (the mem and length may differ,this has no effect)
158158
159159- MaxDisplayLengthForStaticArray: Similar to existing "MaxDisplayLengthForString". This should apply to static array, but it is up to gdb which types it applies it to.
160160- MaxLocalsLengthForStaticArray: The same, but applied while getting values for the locals window, and the function parameters show in the stack window. Should be more restrictive.
161161- GdbValueMemLimit: For all types. Do not evaluate values, if gdb would need more memory. Setting this to big may crash gdb. Big values may also lead to slow response times (several minutes during which the IDE would be blocked)
162162- GdbLocalsValueMemLimit: For locals and stack.
163163
164164- DebugServer: Added "target-download" if remote supports it.
165165
166166# IDE Interfaces Changes
167167
168168- Added **FormEditingHook.SaveComponentAsPascal**, which stores a designer form as Pascal statements using **TCompWriterPas**. You have various options to define the format and it tells you what units are needed for the Pascal code. There is an example adding a designer menu item to copy the Pascal statements to the clipboard *examples/pascalstream/CopyAsPasPkg/copyaspasdemounit1.pas*.
169169
170170- Added interface class TLazCompilationToolOptions with a Command and CompileReasons. Used in CompilerOptions.ExecuteBefore and .ExecuteAfter.
171171
172172# Components
173173
174174### TOpenGLControl
175175
176176- New property Options of type set, currently with ocoMacRetinaMode as the only member. If set, ocoMacRetinaMode determines that the OpenGL controls will use retina support (high resolution mode).
177177- Control can use Qt5 widgeset now, Qt4 is also fixed for modern OpenGL contexts.
178178
179179### TAChart
180180
181181- The new TExpressionSeries and TExpressionColorMapSeries plot mathematical functions at design-time.
182182- TLineSeries has a new property "ColorEach" which can be used to color the line segments individually.
183183- TCubicSplineSeries has a new property "SplineType" which allows to select between the "natural" and the "monotone Hermite" splines (the latter avoiding overshoot of the interpolation).
184184- TAreaSeris has a new property "Banded" which suppresses painting of the bottom layer of stacked areas and makes the series look like a band or a stack of bands.
185185- The new property "MarkDistancePercent" of TPieSeries can be used, for example, to center a label within its pie for all chart sizes.
186186- TLineSeries, TCubicSplineSeries, TBSplineSeries and TFitSeries now can display error bars.
187187- The TFitSeries fitting engine was extended to be able to exclude specific parameters from fitting and to do a statistical analysis of the fit results (error estimates of the determined fit parameters, confidence limits, goodness of fit).
188188- TBarSeries has new property "MarkPositionCentered" which allows to center series marks within each bar. Available also for TAreaSeries where it works accordingly. NOTE: In intermediate trunk versions and some of the release candidates, this effect could be achieved partly by using option lmpInsideCenter of TMarkPositions - this option has been dropped now.
189189
190190### TCustomEdit
191191
192192- Qt5 widgetset native implementation of TextHint property, Qt4 uses emulated TextHint.
193193
194194# Changes affecting compatibility
195195
196196## Installer
197197
198198### Debian package fpc was renamed to fpc-laz
199199
200200This about the packages provided by the Lazarus team on sourceforge.
201201
202202- Old: fpc_3.0.4-3_amd64.deb, fpc_3.0.4-3_i386.deb
203203- New: fpc-laz_3.0.4-1_amd64.deb, fpc-laz_3.0.4-1_i386.deb
204204- Reason: avoiding name clash with Ubuntu/Debian repository package "fpc"
205205- Remedy: adapt your scripts
206206
207207Note, that the fpc-src package keeps its name, as the Ubuntu/Debian package is fpc-source, so there is no name clash here.
208208
209209## LazUtils
210210
211211## LCL incompatibilities
212212
213213### TToolBar children ignore Align
214214
215215Controls placed within TToolBar cannot be aligned with the Align property.
216216
217217- Old behavior: The Align property of TToolBar children was taken into account.
218218- New behavior: The Align property is ignored.
219219- Reason: It caused endless alignment loops when the control's size was changed by code in Create.
220220- Remedy: use a parent container for TToolBar and align the controls within this container.
221221
222222### TCustomComboBox.ReadOnly was deprecated
223223
224224- Old behavior: When True, only items from the list are accepted, by direct selection from the list or AutoComplete.
225225- New behavior: it does nothing and will be removed.
226226- Reason: Delphi-compatibility, confusing naming, WS compatibility (different behavior on Win32/Qt/Gtk)
227227- Remedy: Use extended styles for the same feature.
228228
229229### Predefined clipboard format pcfDelphiBitmap was removed
230230
231231- Old behavior: The enumeration TPredefineClipboardFormat contained an element pcfDelphiBitmap which once had to be introduced due to streaming differences of bitmaps between Delphi and LCL.
232232- New behavior: pcfDelphiBitmap has been removed. (Rare) code relying on exact count and position of the elements of this enumeration will fail.
233233- Reason: No longer needed and causing trouble in clipboard access.
234234- Remedy: None - revisit your code.
235235
236236### TEdit.Action visibility lowered to public
237237
238238- Old behavior: TEdit.Action was published.
239239- New behavior: TEdit.Action is now public.
240240- Reason: Delphi compatibility.
241241- Remedy: set Action in code.
242242
243243### [[TControl]].ScaleFontsPPI, .DoScaleFontPPI parameter change
244244
245245- Old behavior: No AToPPI parameter
246246- New behavior: AToPPI parameter was added
247247- Reason: font scaling problem [Issue \#32882](https://bugs.freepascal.org/view.php?id=32882). This change will be merged to 1.8.1
248248- Remedy: fix parameters
249249
250250### MouseEntered deprecated/missing
251251
252252- Old behavior: No warning on using MouseEntered
253253- New behavior: Warning: Symbol "MouseEntered" is deprecated: "use MouseInClient instead"
254254- Reason: Delphi compatibility
255255- Remedy: use property MouseInClient instead
256256
257257### TCustomImageList.Add method
258258
259259- Old behavior: the image got sliced if too big or extended if too small.
260260- New behavior: the image is scaled to all resolutions in the image list.
261261- Reason: Image List now supports multiple resolutions.
262262- Remedy: use AddSliced (if the image consists of several icons to be added) or AddSlice (if one image from a custom rect has to be added - also rect outside the image is supported).
263263
264264### TBitBtn.Glyph in combination with TBitBtn.Kind
265265
266266- Old behavior: The Glyph property was filled with a valid bitmap when the Kind property was set to a different value from bkCustom.
267267- New behavior: The Glyph property is empty.
268268- Reason: TBitBtn now supports image list with multiple resolutions. The Glyph (TBitmap) doesn't support multiple resolutions and thus cannot be used anymore to define the TBitBtn image.
269269- Remedy: if you need the image for a specific TBitBtn.Kind get it directly from the LCLGlyphs property defined in ImgList.
270270
271271### TCustomTreeView.OnChanging event: Node parameter
272272
273273- Old behvior: The parameter Node passed to the OnChanging event points to the currently selected node. This is not compatible with Delphi which has the destination node here.
274274- New behavior: The parameter Node passed to the OnChanging event is the node which will be the selected node after the node-changing operation has completed.
275275- Reasons:
276276 - The operation can be aborted by setting "AllowChange" to false. For this decision, knowledge of the node going to be selected is helpfull, at least more helpful than knowledge of the node to be left which still can be accessed as TreeView.Selected at this point. The old behavior does not tell the new node.
277277 - The new behavior is compatible with Delphi
278278- Remedy: If old OnChanging handlers refere to the parameter Node replace Node by TreeView.Selected.
279279
280280### TCustomDialog properties Width and Height visibility lowered to public
281281
282282- Old behaviour: Width and Height were published.
283283- New behaviour: Width and Height are public.
284284- Reason: Delphi compatibility.
285285- Remedy: set the properties in code.
286286
287287### No LCL Application exception dump
288288
289289- Old behavior: In case of an exception a dump was automatically written with [[DebugLn]] (e.g. to a console).
290290- New behavior: There is no automatic exception dump any more.
291291- Reason: The LCL should not emit debugging info by default.
292292- Remedy 1: Add the LCLExceptionStackTrace unit to the uses clause of any of your units.
293293- Remedy 2: To enable LCLExceptionStacktrace globally for all projects, create a new "Additions and Overrides" entry in "Stored in IDE" for "#project" target with the contents "-FaLCLExceptionStacktrace" (see screenshot below). (The drawback of this approach is that this will now also be used for console applications, so they won't compile unless you uncheck the addition in Compiler Options.)
294294
295295### No default LazLogger
296296
297297- Old behavior: LazLogger was registered by default by the LCL.
298298- New behavior: LazLogger is not registered any more, so there is an empty logger (LazLoggerBase) used with no output.
299299- Reason: The LCL should not register any logger by default - the user has to define if he wants to use the logger and what logger he wants to use.
300300- Remedy 1: Add the LazLogger unit to the uses clause of any of your units.
301301- Remedy 2: To enable LazLogger globally for all projects, create a new "Additions and Overrides" entry in "Stored in IDE" for "#project" target with the contents "-FaLazLogger" (see screenshot below). (The drawback of this approach is that this will now also be used for console applications, so they won't compile unless you uncheck the addition in Compiler Options.)
302302
303303### Screenshot for LCLExceptionStackTrace and LazLogger Additions and Overrides
304304
305-<figure>
306-<img src="AdditionsOverridesExUnits.png" title="AdditionsOverridesExUnits.png" />
307-<figcaption>AdditionsOverridesExUnits.png</figcaption>
308-</figure>
305+![](/wiki-images/9/96/AdditionsOverridesExUnits.png)
309306
310307### TCustomTabControl setting TabIndex or PageIndex by code
311308
312309- Old behavior: setting TabIndex or PageIndex by code would invoke a call to CanChangePageIndex/CanChange
313310- New behavior: setting TabIndex or PageIndex by code will not invoke CanChangePageIndex/CanChange. As a result OnChanging is not called in this scenario.
314311- Reason: Delphi compatibility.
315312- Remedy: set nboDoChangeOnSetIndex in Options (this option is not available in Delphi), call OnChanging in you own code when changing TabIndex/PageIndex, or move the code in OnChanging (or an overridden CanChangePageIndex/CanChange) to another event (or method) if applicable.
316313
317314### TCustomGrid: The var parameter ABitmap in event OnUserCheckBoxBitmap used to be preassigned with default bitmap, but now it is nil
318315
319316- Old behaviour: You could draw directly to ABitmap in OnUserCheckBoxBitmap event.
320317- New behaviour: You have to create a bitmap yourself and assign it to ABitmap parameter in OnUserCheckBoxBitmap event.
321318- reason: this is var parameter and its proper usage has always been this way.
322319- remedy: change code to provide the bitmap and assign it to ABitmap parameter in code of OnUserCheckBoxBitmap.
323320
324321More information in [bugreport 35085](https://bugs.freepascal.org/view.php?id=35085).
325322
326323## Components incompatibilities
327324
328325### LazControls: TSpinEditEx no longer inherits from TCustomFloatSpinEditEx
329326
330327- Old behavior: TSpinEditEx inherited from TFloatSpinEditEx.
331328- New behavior: Both TSpinEditEx and TFloatSpinEditEx now inherit from a common (generic) base class: TSpinEditExBase. As a result testing for "is TCustomFloatSpinEdit" now returns False.
332329- Reason: support for Int64 values in TSpinEdit (Double does not have enough precision to cover the Int64 range). Also makes for cleaner code.
333330- Remedy: test for the appropriate (base) class instead.
334331
335332### TAChart: Reticule-related properties deprecated
336333
337334- Old behavior: The reticule could be used to display a crosshair cursor in the chart.
338335- New behavior: The reticule will be removed because the crosshair cursor is included in the more versatile charttools.
339336- Reason: Remove duplicate features.
340337- Remedy: Attach a TChartToolset to the chart, add a DatapointCrosshairTool to the toolset and adjust its properties.
341338
342339### TAChart events On\[After\|Before\]Draw\[Background\|BackwallWall\] deprecated
343340
344341- Old behavior: These events could be used for custom-painting of the chart background or the chart data rectangle background.
345342- New behavior: These events will be removed.
346343- Reason: The events have a parameter Canvas to paint on. TAChart, however, supports additional drawing backends which do not have a canvas.
347344- Remedy: Use the new events On\[After\|Before\]CustomDraw\[Background\|Backwall\] which get the currenty used drawer as a parameter. For drawing use the corresponding drawer methods.
348345
349346### TAChart: The TCubicSplineOption `csoDrawFewPoints` is removed.
350347
351348- Old behavior: The CubicSplineSeries required at least 4 data points for drawing. In case of a TCubicSplineSeries with less data points a polygon was drawn as a replacement using the `BadDataPen` if the option `csoDrawFewDataPoints` was active; if this option was not set the series was not drawn at all.
352349- New behavior: After fixing the cubic spline interpolation in a local version if NumLib's ipf unit it is possible to draw splines also for less than 4 data points. Old code using the `csoDrawFewDatapoints` option will not compile any more.
353350- Reason: The old behavior was a workaround for a NumLib bug.
354351- Remedy: Don't use `csoDrawFewPoints` any more.
355352
356353### TAChart: Other properties removed that had been marked as deprecated for a long time
357354
358355- The following table lists the removed properties/procedures/functions along with their replacements:
359356
360357| removed | use instead |
361358|----|----|
362359| property `TChartTitle.Font` (unit TAChartAxisUtils) | `TChartTitle.LabelFont` |
363360| property `TCustomChartSeries.ShowInLegend` (unit TACustomSeries) | `TCustomChartSeries.Legend.Visible` |
364361| method `TFuncSeries.GetFitEquationText` (unit TAFuncSeries) | `TFuncSeries.EquationText` |
365362| method `TChart.DrawOnCanvas` (unit TAGraph) | `TChart.PaintOnCanvas` |
366363| property `TChartLegend.Margin` (unit TALegend) | `TChartLegend.MarginX` |
367364| event `TLineSeries.OnDrawPointer` (unit TASeries) | `TLineSeries.OnCustomDrawPointer` |
368365| class `TSerie` (unit TASeries) | `TLineSeries` |
369366| class `TLine` (unit TASeries) | `TConstantLine` |
370367| property `TZoomDragTool.Proportional` (unit TATools) | `TZoomDragTool.RatioLimit`, set to `zlrProportional` |
371368
372369## IDE incompatibilities
373370
374371# Previous release notes
375372
376373---
377374*From the Free Pascal wiki, page "Lazarus 2.0.0 release notes", as it stood on 2021-10-11 after a change by Kai Burghardt, 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).*
378375Category: Lazarus
379376Category: Release Notes

Back to history