Sign in Join
Wiki copytemporary

Custom Drawn Interface

English · Русский

Warning: THIS INFORMATION IS EXTREMELY DATED AND NEEDS UPDATING as of 2015

Introduction

LCL-CustomDrawn-Android has the following features:

FAQ

Diagram of the Custom Drawn Interface

Legend:

The LCL-CustomDrawn Backends

LCL-CustomDrawn needs backends to implement the most basic parts of the widgetset. Each backend should implement the following minimal parts:

LCL-CustomDrawn-Android

This backend is working. See this page Custom Drawn Interface/Android

And also Android Programming

LCL-CustomDrawn-X11

This backend is working. See Custom Drawn Interface/X11

LCL-CustomDrawn-Cocoa

This backend is working.

LCL-CustomDrawn-Windows

This backend is working.

LCL-CustomDrawn-iPhone

This is planned, but not yet started.

Canvas

TCanvas will be fully non-native in this widgetset and based on LazCanvas. All drawings to visual controls and on the OnPaint event of controls of the form are naturally double-buffered because the entire drawing of the form is first performed on an off-screen buffer and then copied in 1 operation to the form native canvas. In reality there is only 1 TLazCanvas for the entire form, but sub-controls will think they are on a separate canvas because the property BaseWindowOrg sets an internal start position of the canvas and also because all drawings will be clipped to reflect the size and shape of the sub-control.

Getting the TLazCanvas object inside TCanvas

This works only in the LCL-CustomDrawn interface:

pascal
uses lazcanvas, lclintf;

var
  MyLazCanvas: TLazCanvas:
begin
  if nctLazCanvas in LCLIntf.GetAvailableNativeCanvasTypes(MyCanvas.Handle) then
  begin
    MyLazCanvas := TLazCanvas(LCLIntf.GetNativeCanvas(MyCanvas.Handle, nctLazCanvas));
    // do something here with TLazCanvas
  end;

Drawing optimization roadmap

Optimizations already done

Optimizations to be done

Font rendering

When the define CD_UseNativeText is activated, LCL-CustomDrawn will use the native text rendering of the platform as provided by the backend. If it isn't activated, then it will use LazFreeType to render the text. The define is automatically activated for some backends if convenient when using them.

Message and Common Dialogs

Message and Common Dialogs might be native if this is considered very convenient for the backend. If not, they will be non-native. At the moment the Android backend has native message boxes.

Windowed visual controls

All Windowed visual controls (TButton, TPageControl, etc) will be based in the Lazarus Custom Drawn Controls

Conditional defines accepted by LCL-CustomDrawn

One easy way to set a conditional define for the LCL-CustomDrawn is to define it in the file lcl/interfaces/customdrawn/customdrawndefines.inc

Here are defines which affect the functionality offered by this interface:

And here debug information defines:

Screenshots

See Also


From the Free Pascal wiki, page "Custom Drawn Interface", as it stood on 2020-02-08 after a change by Trev, 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.

Revision 4, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.