Lazarus 1.8.0 release notes

From Lazarus wiki
Jump to: navigation, search

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

Statistics:

  1. commits: xxx
  2. log: svn log -r xxxx:xxxx
  3. resolved bug tracker issues: xxx

LCL Interfaces Changes

  • Qt5: new widgetset based on Qt5 libraries.

LCL Changes

  • TCustomForm
    • new position poWorkAreaCenter - center form on working area (depends on DefaultMonitor)
    • new compiler define LCLRealFormBounds. If you compile your application with LCLRealFormBounds on, the TCustomForm bounds (Width/Height) will be real outer bounds and not client bounds. Also constraints will affect real bounds. For now, it is supported only by win32.
    • Scaled property: the LCL is DPI-aware. Please see High_DPI#High_DPI_in_Lazarus_1.7_and_above for more information.
  • TToolButton
    • new style tbsButtonDrop - paints a drop down arrow on the right side of the button. In contrast to tbsDropDown the button has only single clicking area that invokes the DropDownMenu if assigned.
    • new event OnArrowClick. It is called if Style=tbsDropDown when the user clicks the arrow button area of toolbutton. Breaking change: OnClick was called in 1.6!
  • TToolBar
    • new DropDownWidth property to setup the width of the toolbutton arrow area for Style=tbsDropDown.
  • ClipBoard
    • The ClipBoard now supports copying and pasting text in HTML format by means of the methods GetAsHtml and SetAsHtml.
  • Menus (TPopupMenu, TMainMenu, TMenuItem)
    • Menus now support OwnerDraw with (almost) Delphi's approach. If you set TMenu.OwnerDraw to true the OnMeasureItem and OnDrawItem from TMenu and TMenuItem will be called. OnDrawItem from Lazarus has the same parameters as OnAdvancedDrawItem from Delphi. You can use the events also from TMenu, which is an LCL addition to Delphi. For now only win32 is supported.

IDE Changes

  • lazbuild
    • new option --add-package-link to register given lpk files without building.
  • Quick Fixes
    • new QuickFix for any fpc hint, note or warning: add compiler directive {$warn id off}
  • Code creation
    • new shortcut Ctrl+ Shift+X that shows a CodeCreation dialog with more options. Ctrl+ Shift+C never shows a dialog now.
    • You can choose the default visibility of the methods in Tools / Options / Codetools / Class Completion / Default section of methods.
  • Word+Identifier completion: If the option Codetools / Identifier Completion / Replace whole words is enabled, pressing Return replaces the whole word at cursor, pressing Shift+Return replaces only the left side. If the option is disabled it works the other way round: Return replaces left side, Shift+Return replaces whole word.
  • "case ofall" code template indentation change
    • Old behavior: the created case-list was always flat
    • New behavior: by default it is now indented according to source editor options.
    • Reason: the indented case-list is Delphi-standard
    • Remedy: edit the ofall template and use the WithoutExtraIndent parameter: "$OfAll(WithoutExtraIndent)"
  • Ctrl-Enter alias "Open file at cursor" was improved when cursor in a Pascal file: It now recognizes properly $I and $R directives, uses nodes, string literals and comments.
  • Editor
    • New colored outline of source structure. (like cnpack, if then block outline)

IDE Interfaces Changes

  • New function LazarusIDE.FindUnitsOfOwner listing all units of a project/package. [1]

Components

LazControls

  • Added T(Float)SpinEditEx, a widgetset independant implementation T(Float)SpinEdit with some extended capabilities:
    • NullValue property.
    • Configurable behaviour when the text inside the control is not a number.

ToDoListLaz

  • Now searches all used units of projects. Excluding used packages, including all units listed in the project inspector.

Changes affecting compatibility

LazUtils

Wrappers for string functions are disabled

Various units in LCL, LazUtils and Codetools have wrappers for string functions in LazUTF8 and LazFileUtils. They are now disabled. They can still be enabled by defining "EnableWrapperFunctions".

The wrapper functions were already deprecated in Lazarus 1.6 with a proper hint about where to find the actual function. This allowed a transition period for everybody who updates to every major Lazarus version.

FindDefaultExecutablePath searches on Windows in BaseDir

  • Applies: Non Unix systems.
  • Old behavior: BaseDir was only searched if '.' was in %PATH% - same as Unix shells.
  • New behavior: BaseDir is always searched (if set) on non Unix.
  • Reason: Windows console searches in current directory so Windows users expect to find executable in base directory.
  • Remedy: Use instead SearchFileInPath(Executable,BaseDir,GetEnvironmentVariableUTF8('PATH'),PathSeparator,[sffDontSearchInBasePath]);

LCL incompatibilities

TLCLPlatform definition was moved

TLCLPlatform was moved from InterfaceBase to a new LCLPlatformDef unit in r53711. Also a related LCLPlatformDisplayNames was moved from LazConf to the same unit.

  • Old behavior: Unit InterfaceBase was used for TLCLPlatform type.
  • New behavior: Unit LCLPlatformDef must be used for it. InterfaceBase may still be needed for other types.
  • Reason: The GUI independent parts of LCL definitions will be needed for command line programs (LazBuild).
  • Remedy: use the right units in your uses-sections.

TToolButton.OnArrowClick added

  • Applies: event called if Style=tbsDropDown when the user clicks the arrow button area of toolbutton.
  • Old behavior: OnClick was called.
  • New behavior: OnArrowClick is called.
  • Reason: there was no easy way to detect click on the arrow sub-button.
  • Remedy: use the same event handler for OnArrowClick and OnClick.

TCustomAbstractGroupedEdit descendants must override GetRealText/SetRealText methods

  • Old behavior: TCustomAbstractGroupedEdit reintroduced the Text property
  • New behavior: TCustomAbstractGroupedEdit uses TControl.Text
  • Reason: unnecessary 2 different properties with the same name and function
  • Remedy: override GetRealText/SetRealText instead of GetText/SetText.

TFontStyle enum item order is changed to match with Delphi

  • Old behavior: the last item was fsUnderline
  • New behavior: the last item is fsStrikeOut
  • Reason: Delphi compatibility.
  • Remedy: check code if it depends on Ord(TFontStyle) - like "StyleStrings: Array[TFontStyle] of string = ('Bold', 'Italic','StrikeOut','Underline');" or saving/retrieving font style as ordinal value.
  • More info: It does not affect LFM streaming. It can make a difference when iterating items.

THintWindow transparent for mouse messages by default

  • Old behavior: THintWindow received mouse messages
  • New behavior: THintWindow passes mouse message through itself to the underlying form/control.
  • Reason: Delphi compatibility.
  • Remedy: to make THintWindow clickable again, add a LM_NCHITTEST message handler to your hint window descendant and return HTCLIENT as message result:
 procedure WMNCHitTest(var Message: TLMessage); message LM_NCHITTEST;
 // ...
 procedure TMyHintWindow.WMNCHitTest(var Message: TLMessage);
 begin
   Message.Result := HTCLIENT;
 end;

TCustomTabControl setting TabIndex or PageIndex by code

  • Old behavior: setting TabIndex or PageIndex by code caused an OnChange event to be fired
  • New behavior: setting TabIndex or PageIndex by code no longer causes an OnChange to be fired
  • Reason: Delphi compatibility.
  • Remedy: set nboDoChangeOnSetIndex in Options (this option is not available in Delphi), call OnChange in you own code when changing TabIndex/PageIndex, or move the code in OnChange to another event if applicable.

TCustomControlFilterEdit.UseFormActivate deprecated

  • Old behavior: setting UseFormActivate to true, the filter edit got focus on Form.Activate
  • New behavior: UseFormActivate does nothing and will be removed after 1.8
  • Reason: it globally misused the TForm.OnActivate event.
  • Remedy: set ActiveControl in Form.DoCreate or use correct TabOrder or similar.

Components incompatibilities

easylazfreetype: TCustomFreeTypeFontCollection.AddFile

  • Old behavior: return Boolean
  • New behavior: return TCustomFontCollectionItem
  • Reason: there was no easy possiblity to work with the added item.
  • Remedy: don't check the result for True, but for "<>nil".

IDE incompatibilities

Form resource strings table LRT format support is dropped, LRJ format introduced instead

  • Old behavior: Form resource strings were extracted into LRT file when saving form.
  • New behavior: Form resource strings are extracted into LRJ file with format unified with RSJ files which are emitted by FPC 3.0.0 and up. LRT support is dropped.
  • Reason: LRT file format was broken by design, e.g. it didn't handle multiline captions properly (see bug 26553 for details).
  • Remedy: Open your project and click "Project" -> "Resave forms with enabled i18n" menu item, then rebuild your project. After this you can safely remove LRT files.

DateTimeCtrls

DateTimeCtrls split into DateTimeCtrls and DateTimeCtrlsDsgn packages

  • Old: one run/design time package DateTimeCtrls
  • New: runtime package=DateTimeCtrls, designtime package=DateTimeCtrlsDsgn
  • Reason: Consistency, separate run and design time code
  • Remedy: DateTimeCtrls components get unregistered. You have to install DateTimeCtrlsDsgn into the IDE.
  • Info: Don't link DateTimeCtrlsDsgn into your application.

LazControls

Register procedures moved into LazControlDsgn package

  • Old: register procedures were in the LazControls package although there was a LazControlDsgn package
  • New: moved register procedures into LazControlDsgn package
  • Reason: Consistency, separate run and design time code
  • Remedy: the components get unregistered. You have to install LazControlDsgn into the IDE.
  • Info: LazControlDsgn is a designtime package.

Previous release notes