Difference between revisions of "Lazarus 1.2.0 release notes"

From Lazarus wiki
Jump to navigationJump to search
Line 11: Line 11:
  
 
= LCL Changes =
 
= LCL Changes =
 +
 +
* TMemo.WantReturns is implemented
  
 
= IDE Changes =
 
= IDE Changes =

Revision as of 15:48, 22 June 2013

Template:Lazarus 1.2.0 release notes

Lazarus 1.2.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

LCL Changes

  • TMemo.WantReturns is implemented

IDE Changes

  • Editor
    • Interactive Hints (Mouse can enter Hints / Hints have links). Requires package TurboPowerIProDsgn
    • Macro Recorder/Player
      • Multiple macros. Ability to select/change macro from list.
      • Individual key-shortcuts for each Macro
      • Macros can be saved per project or with the global IDE config
      • Package EditorMacroScripting: Allow use of PascalScript in macros.
    • Sticky selection mode
    • Highlight different (user specified) words in different colors See here
    • Auto-continue for comments and strings
    • Inactive code in $IFDEF can be "low-lighted" (greyed out)
    • Markup/Highlight colors can be merged (alpha channel) and prioritised.
  • Debugger
    • Watches window: added detail view, for selected watch
    • Debug Inspector: Ability to directly input expression to monitor
    • Attach and Detach
  • When option "open last project" is enabled (default) and the IDE was closed with no project, no project will open at start. When a virtual (not saved) project was open a new Application project is created.
  • The Package Graph now uses the new TLvlGraphControl, showing all package dependencies including project and IDE.
  • Package Editor: new menu item to find and remove unneeded dependencies
  • IDEIntf: Added boolean parameter BringToFront (defaults to false) to TLazIDEInterface.DoShowSearchResultsView. It specifies whether Search Results dialog should be shown on top or under Source Editor. Behavior of existing code calling this method is not affected.
  • IDEIntf: Added TPropertyEditor.GetVerbCount, GetVerb, PrepareItem, ExecuteVerb to let TPropertyEditors add menu items to the Object Inspector.
  • The page in the "Project options / Compiler options / IDE Macro Values" was replaced with a more powerful page "Additions and Overrides". Things that you can do now, which were not possible before:
    • Append fpc options to packages without touching the lpk
    • Changing the output directory of packages without touching the lpk
    • Define IDE macros only for some packages or only for the project
    • Append compiler options for all projects with build mode "debug"
    • Change the package(s) output directory of all projects and packages with build mode "release"
    • Append compiler options of third party projects and packages without altering their sources
  • The compiler options page Inherited was moved to the Show options dialog.

lazbuild

  • Added options --verbose, --quiet and -q to increase/decrease verbosity. You can pass them multiple times.
  • When compiling a project (.lpi) lazbuild now checks if the project needs compilation and if not will not call the compiler. It also now writes why it recompiles.

Components

TAChart

  • Series:
    • Transparency
    • AddArray, AddNull, AddX and AddY functions, SetText procedure
    • TFitSeries.IEquationText interface
    • TPolarSeries.CloseCircle property
    • TFuncSeries.ExtentAutoY property
    • TBarSeries.GetBarWidth function
  • Tools:
    • New tool: TDataPointDistanceTool
    • EscapeCancels property for dragging tools
    • TDataPointHintTool: UseApplicationHint property, OnHintPosition event
    • TDataPointFragTool: Origin property, OnDrag, OnStartDrag events
    • TZoomDragTool.RestoreExtentOn property
    • TChartToolset.DispatchedShiftState property
  • Sources:
    • TDbChartSource: Options=[dcsoDateTimeX, dcsoDateTimeY] property, OnGetItem event
    • TListChartSource: SetText, SetColor, AddXYList procedures
    • New sources: TCustomAnimatedChartSource, TCustomAxisChartSource
  • Axes and marks:
    • Axis index property editor
    • TChartAxis: Position, Value, ValueCount properties, IsPointInside function
    • Marks: Arrow, Margins, Shape, CalloutAngle properties, OnGetShape event
  • Misc
    • TAChartTeeChart unit with some helpers for migration from TeeChart
    • TChart: IsZoomed, PrevLogicalExtent, AutoFocus properties
    • TChartExtentHistory utility class
    • 3 new demos: lazreport, animate, distance

TDBImage

Delphi compatible behaviour can now be set.

Lazarus TDBImage by default saves information about the file type before the image data. This allows seamless use of various file formats (.jpg, .bmp,...). Delphi does not save information about the file type.

To allow programmers to use TDBImage more flexibly, including supporting Delphi compatibility, two events to TDBImage were added:

TOnDBImageRead = procedure(Sender: TObject; S: TStream; var GraphExt : string) of object;
TOnDBImageWrite = procedure(Sender: TObject; S: TStream; GraphExt : string) of object;

If the first event is defined then it is called instead of TDBImage reading from the stream and must return the file extension as GraphExt. For example:

procedure TMyForm.TDBImageDBImageRead(Sender: TObject; S: TStream;
  var GraphExt: string);
begin
   GraphExt := 'jpg'
end;

can be used when the type of the image is always JPEG.

Similarly, if OnDBImageWrite is present then this is called instead of TDBImage writing the file extension to the start of the BLOB in the database. For example:

procedure TMyForm.PhotoDBImageWrite(Sender: TObject;
  S: TStream; GraphExt: string);
begin
  if GraphExt <> 'jpg' then
    raise Exception.Create('Can only save a JPEG Image')
end;

also works for an implicit JPEG.


TLvlGraphControl

This new control is part of the package LazControls and used by the IDE itself as well. The control shows a graph consisting of nodes and edges as a level graph (this type of graph is also called a layered graph).

packagegraph1.png

TLvlGraphControl Features

  • Offers automatic topological sorting, with an option to put nodes leftmost or rightmost
  • You can automatically combine edges. Long edges over multiple levels are combined into single lines with forks.
  • Provides a heuristic to minimize line crossings
  • Automatically prevents overlapping of display elements
  • Nodes can be displayed as rectangles, ellipses or icons stored in a TImageList
  • You can select nodes using the mouse
  • You can select multiple nodes at once
  • You can highlight nodes or edges under the mouse
  • The control displays back edges in special colours, which facilitates quick visual identification of cycles (e.g. unit circles).
  • Edges can be drawn straight or curved (bezier)
  • There is a header caption
  • Node captions can be shown to the left, to the right, above or below nodes
  • All colors can be set via published properties
  • There are events provided to custom-draw and/or skip each part of the default drawing

There is a simple example in examples/levelgraph/lvlgraph_dependencies.lpi.

unitdependencies1.png

TTIPropertyGrid,TTICustomPropertyGrid

Added event OnEditorFilter to let user define what properties to show.

Changes affecting compatibility

LCLType INVALID_HANDLE_VALUE now Handle(-1)

  • Old value: LCLType.Handle(0)
  • New value: LCLType.Handle(-1)
  • Effect: ported code from Delphi now works right, code that misused the constant now works wrong
  • Reason: This constant is a WinAPI constant and used for Windows functions like FileOpen and FileCreate as return value on failure. The cross-plaform FCL functions with the same name return the same value on failure. LCL didn't use this constant itself. It is defined in LCL to make porting Delphi code easier.
  • Remedy: Check your code if the INVALID_HANDLE_VALUE are from unit LCLType or from unit Windows. If the former, then check the code logic.

LCL TCustomForm.AddHandlerFirstShow,AddHandlerClose,AddHandlerCreate parameter AsFirst default value changed to false

  • Effect: old code might now be called after other handlers.
  • Reason: Consistency with other LCL AddHandler.
  • Remedy: If your event needs to be called earlier add parameter true to call.

LCL TScreen.AddHandlerFormAdded, AddHandlerRemoveForm, AddHandlerActiveControlChanged, AddHandlerActiveFormChanged, AddHandlerFormVisibleChanged parameter AsFirst default value changed to false

  • Effect: old code might now be called after other handlers.
  • Reason: Consistency with other LCL AddHandler.
  • Remedy: If your event needs to be called earlier add parameter true to call.

LCL TAction.OnExecute no longer sets TControl/TMenuItem.OnClick

  • Old behavior: When setting Action.OnExecute all associated OnClick events of TControl and TMenuItem were set as well. The OnClicks were not saved to lfm.
  • New behavior: When setting Action.OnExecute no other event is set. On click first the OnClick and then the Action.OnExecute is called.
  • Effect: Code that checks if OnClick is assigned instead of the Action.OnExecute fails.
  • Reason: Allow to set separate OnClick and OnExecute events, consistency between lfm and Object Inspector.
  • Remedy: Check logic of all lines containing "Assigned(OnClick)".

Double clicking on a component with an Action will now automatically use the Action.OnExecute event. That means the IDE will create the event if needed and jump to implementation in the Source Editor.

IDEIntf TOICustomPropertyGrid.Favourites was renamed to Favorites

  • Effect: old code might fail to compile
  • Reason: Consistent American spelling
  • Remedy: Rename used identifier

TComponentPropertyEditor behavior was changed

  • Effect: users of your component can no longer select components outside of the current form.
  • Reason: ActiveControl editor had a list of all controls on all forms of a project and its required packages. This is not supported by ActiveControl. Only controls on the current form must be listed.
  • Remedy: Change the editor to collect controls only on the current form. The original editor is now called TComponentAllPropertyEditor. It is used for other properties where selection of a control is needed.

This change affects 3rd party components if they defined a property editor and derived it from TComponentPropertyEditor. If they still want all controls in the list, they must inherit from TComponentAllPropertyEditor.

TBitBtn.Spacing default changed

  • Effect: default Spacing is changed from 3 to 4 px
  • Reason: Delphi compatibility
  • Remedy: TBitBtn look

LazUtils CreateRelativePath behaviour changed

  • Old behaviour: if a relative path could be constructed, this was sometimes appended with a pathdelimiter, and sometimes not.
  • New behaviour: no pathdelimiter is appended

Previous release notes