Difference between revisions of "Windows CE Interface"

From Lazarus wiki
Jump to navigationJump to search
Line 5: Line 5:
 
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.
 
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.
  
To start with you will need to recompile the compiler on Windows to create a Windows CE - ARM Crosscompiler. There are instructions here: [[fpc:WinCE_port|WinCE_port]].
+
1 - To start with you will need to recompile the compiler on Windows to create a Windows CE - ARM Crosscompiler. There are instructions here: [[fpc:WinCE_port|WinCE_port]].
 +
 
 +
2 - Put the batch file bellow on the root of your subversion lazarus directory and run it
 +
 
 +
<pre>
 +
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
 +
</pre>
 +
 
 +
This should compile LCL for Windows CE.
 +
 
 +
3 - Now you can compile simple LCL software using scripts similar to this:
 +
 
 +
<pre>
 +
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
 +
</pre>
  
 
==Road map for the Windows CE interface==
 
==Road map for the Windows CE interface==
Line 33: Line 50:
  
 
[[Image:Wince.PNG]]
 
[[Image:Wince.PNG]]
 
+
[[Image:First_wince_window.PNG]]
  
 
== How to add a new control ==
 
== How to add a new control ==

Revision as of 03:12, 4 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

components scheduled to be implemented

  • TApplication
  • TCustomForm
  • TCustomButton
  • 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:

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.