Wednesday, May 27, 2009

Compatibility

Okay, FreePascal and Lazarus have to be compatible with Delphi, so that existing Delphi code can be used immediately. But what about new applications?

The Delphi VCL is dedicated to Windows, and for multi-platform applications the CLX was derived. So I wonder why Lazarus should try to cover all widgetsets with a model, that obviously is not suited for widgetsets other than Win32.

What would really change, when a LCX were added to the LCL? Not really much, I think. The LCL could stay compatible by emulating controls, that are not immediately available in a Win32 compatible form on other widgetsets, as mono does, or fpGUI. The multi-platform LCX instead could change the component model, in a way that allows to use existing components of other widgetsets almost immediately.

A different model were required e.g. for drag&drop support, where easy integration into other widgetsets could be achieved, and at the same time we could get rid of the flaws in the VCL model.

Layout management is another candidate for a different model. The Delphi docking managers are layout managers in the first place, with only an added interface to the drag manager. I cannot imagine any reason, why a layout manager has to be built into TWinControl, instead of making it linkable like an docking manager. Then we could have dedicated layout mangers for e.g. toolbars and dock trees, without a need to squeeze all layout features into one basic (anchored) layout model, that has no counterpart in the VCL.

1 comment:

  1. The Lazarus IDE were a wonderful example and test for a portable component library, with reduced Delphi compatibility. The CLX could be used as a starting place for a true multi-platform library.

    ReplyDelete