Difference between revisions of "Lazarus 1.2.0 release notes"

From Lazarus wiki
Jump to navigationJump to search
Line 49: Line 49:
 
*** Options in other pages have been rearranged
 
*** Options in other pages have been rearranged
 
** "IDE Macro Values" was replaced with a more powerful page "[[IDE_Window:_Compiler_Options#Additions_and_Overrides|Additions and Overrides]]". Things that you can do now, which were not possible before:
 
** "IDE Macro Values" was replaced with a more powerful page "[[IDE_Window:_Compiler_Options#Additions_and_Overrides|Additions and Overrides]]". Things that you can do now, which were not possible before:
*** Append fpc options to packages without touching the lpk
+
*** Append FPC options to packages without touching the lpk
 
*** Changing the output directory of 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
 
*** Define IDE macros only for some packages or only for the project

Revision as of 09:11, 24 August 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
    • Select text word-wise
    • 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
    • Support for remote debug with gdbserver
  • 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.
  • Compiler options
    • Build modes
      • Build modes are not visible by default. They can be enabled with a checkbox.
      • The GUI is visually above the options GUI pages, thus indicating it has effect on them.
      • There is a separate window for managing the modes. Two useful modes, "Debug" and "Release", can be created with a single click.
    • GUI for all available options
      • Options are read and parsed directly from FPC.
      • The "Other" page has a button which opens the generated GUI. The options are synchronized and saved with the custom options memo.
      • Options in other pages have been rearranged
    • "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 page Inherited was moved to the Show options dialog.
  • The window Unit Dependencies was rewritten:
    • It shows what units a unit uses
    • It shows what units uses that unit
    • Search and filter
    • Showing packages and projects as graphs
  • Designer
    • New designer popup menu item Reset for setting control bounds to their ancestor bounds
    • Add Frame onto a form: The dialog to select the frame ancestor now scans all sources.
  • The default test directory of the IDE under Linux was changed from /tmp to ~/tmp to avoid clashes with other users

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

TActiveX/LazActivex

New package.

The LazActiveX package contains the TActiveXContainer component and the IDE integration of the necessary tools to create ActiveX components from a type library or directly from the object (exe or dll). ActiveX is a Microsoft Windows technology and can only be used on that platform. Cross compilation to windows is possible but the typelib importer used to create the COM bindings works only on Windows (wine not tested).

See LazActiveX

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

LCL incompatibilities

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.

LCL TTreeView with Images no longer indents nodes without image

  • Old behaviour: When the Images of a TTreeView was set, all nodes without ImageIndex were still painted indented as if they had images
  • New behavior: Nodes without a valid ImageIndex are not indented
  • Effect: Custom drawn TreeView may now paint at wrong place
  • Reason: The empty space looked like a bug
  • Remedy: Adapt your custom drawn code. Or set an ImageIndex and set the PaintImages parameter to false. Then the nodes are indented, but the icons are not painted.

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

IDE incompatibilities

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.

Global SrcPath was removed

The Option Tools / Options / CodeTools / General / Additional sources was removed.

  • Effect: IDE can not find an unit, while compiler can
  • Reason: This option was added as workaround for various shortcomings of the IDE and was often confused. For example the IDE was not able to find pas/pp files in the unit paths defined by the fpc.cfg. The IDE can now find such files and has now some options to setup source paths globally.
  • Remedy: Add the path to Project Options / Paths / Other Sources or to the Additions and Overrides.

Previous release notes