Difference between revisions of "Windows CE Interface"

From Free Pascal wiki
Jump to navigationJump to search
m
Line 30: Line 30:
 
* TApplication - <span style="color:brown">Partially implemented</span>
 
* TApplication - <span style="color:brown">Partially implemented</span>
 
* TCustomForm - <span style="color:brown">Partially implemented</span>
 
* TCustomForm - <span style="color:brown">Partially implemented</span>
 +
* TCustomButton - <span style="color:brown">Partially implemented</span>
  
 
===components scheduled to be implemented===
 
===components scheduled to be implemented===
  
* TCustomButton
 
 
* TCanvas
 
* TCanvas
 
* TBitmap - Needs a description of the internal format used by Windows CE
 
* TBitmap - Needs a description of the internal format used by Windows CE

Revision as of 05:41, 6 March 2006

Windows CE interface is in early development.

Setting Up the Windows CE interface

The Compiler and Run-time library for Windows CE are only available on the development branch of Free Pascal, the 2.1.x version. Lazarus snapshot comes with this Free Pascal version.

1 - To start with you will need to recompile the compiler on Windows to create a Windows CE - ARM Crosscompiler. There are instructions here: WinCE_port.

2 - Put the batch file bellow on the root of your subversion lazarus directory and run it

PATH=C:\Programas\lazarus13\pp\bin\i386-win32;c:\Programas\arm
make lcl LCL_PLATFORM=wince PP=ppcrossarm.exe CPU_TARGET=arm OS_TARGET=wince

This should compile LCL for Windows CE.

3 - Now you can compile simple LCL software using scripts similar to this:

PATH=C:\Programas\lazarus13\pp\bin\i386-win32;c:\Programas\arm
ppcrossarm.exe -Twince -FuC:\Programas\fpc21\rtl\units\arm-wince -FDC:\Programas\arm -XParm-wince- test.pas
ppcrossarm.exe -Twince -FuC:\programas\lazarus\lcl\units\arm-wince -FuC:\programas\lazarus\lcl\units\arm-wince\wince -FuC:\Programas\fpc21\rtl\units\arm-wince -FDC:\Programas\arm -XParm-wince- windowtest.pas

Road map for the Windows CE interface

currently implemented components with their status

  • TApplication - Partially implemented
  • TCustomForm - Partially implemented
  • TCustomButton - Partially implemented

components scheduled to be implemented

  • TCanvas
  • TBitmap - Needs a description of the internal format used by Windows CE
  • TPixmap
  • TIcon

currently implemented Windows API functions by group and with status

wish-list of new components

Use this space for components you would like to see implemented

Screenshots

Test of the Windows CE cross compiler and the first lcl-wince application running:

Wince.PNG First wince window.PNG

How to add a new control

For example TButton.

TButton is defined in lcl/buttons.pp. This is the platform independent part of the LCL, which is used by the normal LCL programmer.

Its widgetset class is in lcl/widgetset/wsbuttons.pp. This is the platform independent base for all widgetsets (qt, carbon, gtk, win32, ...).

It's wince interface class is in lcl/interfaces/wince/wincewsbuttons.pp:

 TWinCEWSButton = class(TWSButton)
 private
 protected
 public
   class function  CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
 end;

Every WS class, that actually implements something must be registered. See the initialization section at the end of the wincewsXXX.pp unit:

 RegisterWSComponent(TButton, TWinCEWSButton);


Also notice that DestroyHandle should be implemented to clean up memory utilized by the control.