activated EraseBckGrd messages in doublebuffer WMPaint section

git-svn-id: trunk@4340 -
This commit is contained in:
mattias 2003-06-30 07:00:18 +00:00
parent 5d185300f1
commit d039ac6905
4 changed files with 45 additions and 25 deletions

View File

@ -1,28 +1,37 @@
Hints to cross compile win32 binaries under linux Hints to cross compile win32 binaries under linux
UNDER CONSTRUCTION
Thanks to Vincent Snijders for the hints. Thanks to Vincent Snijders for the hints.
1. Download the GNU Binary Utility Development Utilities. Some rpms, debs, tgz 1. Download the GNU binutils - Binary Utility Development Utilities.
packages are outdated. The following works: Many packages (RPM, DEB, TGZ) are outdated or not compatible. So, here is a link
that worked for me:
http://jrfonseca.dyndns.org/projects/gnu-win32/documentation/cross/ http://jrfonseca.dyndns.org/projects/gnu-win32/documentation/cross/
Download all files into a directory. There is a small bug in xmingw32.mak. Download all files into a directory of your choice. The directory should have
Search for '#$(GCC' and remove the '#'. Then do as root 'make -f xmingw.mak'. at least 250mb space which will be needed for building.
This will download the binutils, the gcc and the mingw32 files and will compile There is a small bug in xmingw32.mak. Open the file, search for '#$(GCC' and
them. After installation you can etiher extend the PATH variable or link the remove the '#' character to uncomment.
following files: Then do as root 'make -f xmingw.mak'. This will download the binutils, the gcc
and the mingw32 files and will compile them. Then it installs them under
/usr/local/xmingw32/. You can change the target directory and compile as
normal user by changing the script.
2. The cross tools needed for FPC
FPC needs four files: asw, ldw, windres and dltool. You can
- link the following files:
[]$ ln -s /usr/local/xmingw32/bin/mingw32-as /usr/bin/asw []$ ln -s /usr/local/xmingw32/bin/mingw32-as /usr/bin/asw
[]$ ln -s /usr/local/xmingw32/bin/mingw32-ld /usr/bin/ldw []$ ln -s /usr/local/xmingw32/bin/mingw32-ld /usr/bin/ldw
[]$ ln -s /usr/local/xmingw32/bin/mingw32-windres /usr/bin/windres []$ ln -s /usr/local/xmingw32/bin/mingw32-windres /usr/bin/windres
[]$ ln -s /usr/local/xmingw32/bin/mingw32-dlltool /usr/bin/dlltool []$ ln -s /usr/local/xmingw32/bin/mingw32-dlltool /usr/bin/dlltool
You can link them as normal user somewhere in your home. But then you have to
add this directory to your PATH or add -FD/your/directory everytime you cross
compile with fpc.
2. Download or compile the win32 units (ppw,ow files for rtl, fcl). These files 2. Download or compile the win32 units (ppw,ow files for rtl, fcl). These files
must be compatible (depending on the compiler probably 1.0.8 as of now). must be compatible (depending on the compiler probably 1.0.8/10 as of now).
Install them next to the linux units in /usr/lib/fpc/1.0.x/units. Install them next to the linux units in /usr/lib/fpc/1.0.x/units.
@ -61,22 +70,24 @@ Make sure that your /etc/fpc.cfg contains target independent paths:
-Fu/usr/lib/fpc/$version/units/$target/rtl -Fu/usr/lib/fpc/$version/units/$target/rtl
You should now be able to cross compile simple pascal programs with You should now be able to cross compile simple pascal programs with
'ppc386 -Twin32 pascalfile.pas' 'ppc386 -Twin32 pascalfile.pas'
Or if you did not link the four files (asw, ldw, ...) to /usr/bin:
'ppc386 -FD/your/directory -Twin32 pascalfile.pas'
4. Cross compiling the LCL 4. Cross compiling the LCL
4.1 Command line: cd lazarus/lcl; make OS_TARGET=win32 4.1 Command line: cd lazarus/lcl; make OS_TARGET=win32
4.2 In the IDE: Set LCL to Clean+Build, set LCL interface to win32 and 4.2 In the IDE: Set LCL to Clean+Build, set LCL interface to win32 and
set 'Target OS' to win32. Then 'build lazarus'. The win32 interface is not set 'Target OS' to win32. Then 'build lazarus'. The win32 interface is not
complete enough for the IDE, but a many of the components already work. complete enough for the IDE, but many of the components already work.
5. Cross compiling a project 5. Cross compiling a project
Set in Run->Compiler Options->Code the Target OS to 'win32' and the in Set in Run->Compiler Options->Code the Target OS to 'win32' and in Paths the
Paths the 'LCL Widget Type' to win32. That's all. The next time you build, you 'LCL Widget Type' to win32. That's all. The next time you build, you will
will create a win32 executable. create a win32 executable.
The IDE will rescan for win32 units, so that 'Find declaration' and code The IDE will rescan for win32 units, so that 'Find declaration' and code
completion features will now work with the win32 rtl instead of the linux rtl. completion features will now work with the win32 rtl instead of the linux rtl.
Of course, when you open another project or reopen this project the IDE will When you open another project or reopen this project the IDE will automatically
automatically switch. switch.

View File

@ -44,7 +44,7 @@ begin
LM_ERASEBKGND: LM_ERASEBKGND:
begin begin
// Not sure if this will work real good. // Not sure if this will work real good.
Canvas.FillRect(ClientRect); //Canvas.FillRect(ClientRect);
Result := 1; Result := 1;
end; end;
else else
@ -1432,6 +1432,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.107 2003/06/30 07:00:18 mattias
activated EraseBckGrd messages in doublebuffer WMPaint section
Revision 1.106 2003/06/23 09:42:09 mattias Revision 1.106 2003/06/23 09:42:09 mattias
fixes for debugging lazarus fixes for debugging lazarus

View File

@ -45,7 +45,8 @@ end;
Procedure TScrollingWinControl.WMEraseBkgnd(var Message: TLMEraseBkgnd); Procedure TScrollingWinControl.WMEraseBkgnd(var Message: TLMEraseBkgnd);
begin begin
with Message do begin inherited WMEraseBkgnd(Message);
{with Message do begin
FCanvas.Lock; FCanvas.Lock;
try try
FCanvas.Handle := DC; FCanvas.Handle := DC;
@ -58,7 +59,7 @@ begin
finally finally
FCanvas.Unlock; FCanvas.Unlock;
end; end;
end; end;}
end; end;
procedure TScrollingWinControl.WMPaint(var Message: TLMPaint); procedure TScrollingWinControl.WMPaint(var Message: TLMPaint);

View File

@ -2223,7 +2223,8 @@ var
PS : TPaintStruct; PS : TPaintStruct;
begin begin
//writeln('[TWinControl.WMPaint] ',Name,':',ClassName,' ',HexStr(Msg.DC,8)); //writeln('[TWinControl.WMPaint] ',Name,':',ClassName,' ',HexStr(Msg.DC,8));
if (csDestroying in ComponentState) then exit; if ([csDestroying,csLoading]*ComponentState<>[]) or (not HandleAllocated) then
exit;
{$IFDEF VerboseDsgnPaintMsg} {$IFDEF VerboseDsgnPaintMsg}
if csDesigning in ComponentState then if csDesigning in ComponentState then
@ -2241,6 +2242,7 @@ begin
PaintHandler(Msg); PaintHandler(Msg);
end end
else begin else begin
//writeln('TWinControl.WMPaint Painting doublebuffered ',Name,':',classname);
DC := GetDC(0); DC := GetDC(0);
MemBitmap := CreateCompatibleBitmap(DC, ClientRect.Right, ClientRect.Bottom); MemBitmap := CreateCompatibleBitmap(DC, ClientRect.Right, ClientRect.Bottom);
ReleaseDC(0, DC); ReleaseDC(0, DC);
@ -2248,8 +2250,7 @@ begin
OldBitmap := SelectObject(MemDC, MemBitmap); OldBitmap := SelectObject(MemDC, MemBitmap);
try try
DC := BeginPaint(Handle, PS); DC := BeginPaint(Handle, PS);
//ToDO:define wm_erasebkgnd Perform(LM_ERASEBKGND, MemDC, MemDC);
// Perform(WM_ERASEBKGND, MemDC, MemDC);
Msg.DC := MemDC; Msg.DC := MemDC;
WMPaint(Msg); WMPaint(Msg);
Msg.DC := 0; Msg.DC := 0;
@ -2379,8 +2380,9 @@ end;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TWinControl.WMEraseBkgnd(var Message: TLMEraseBkgnd); procedure TWinControl.WMEraseBkgnd(var Message: TLMEraseBkgnd);
begin begin
Assert(False, Format('Trace: TODO: [TWinControl.LMEraseBkgnd] %s', [ClassName])); if {not FDoubleBuffered or} (Message.DC = 0 {Message.Unused}) then
end; FillRect(Message.DC, ClientRect, FBrush.Handle);
end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
Method: TWinControl.WMExit Method: TWinControl.WMExit
@ -2871,6 +2873,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.146 2003/06/30 07:00:18 mattias
activated EraseBckGrd messages in doublebuffer WMPaint section
Revision 1.145 2003/06/28 12:10:02 mattias Revision 1.145 2003/06/28 12:10:02 mattias
fixed LM_SETSIZE in InitializeWnd fixed LM_SETSIZE in InitializeWnd