From 9ef16aa5dca466954ca30d469aef72aeead36d44 Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 28 Jun 2003 12:10:02 +0000 Subject: [PATCH] fixed LM_SETSIZE in InitializeWnd git-svn-id: trunk@4332 - --- .gitattributes | 2 + docs/CrossCompile.txt | 48 ++++++++++++++ docs/INSTALL | 9 ++- lcl/include/wincontrol.inc | 8 +-- lcl/interfaces/gtk/gtkobject.inc | 14 +++-- tools/install/build_fpc_rpm.sh | 104 +++++++++++++++++++++++++++++++ tools/install/create_fpc_rpm.sh | 43 ++++--------- 7 files changed, 186 insertions(+), 42 deletions(-) create mode 100644 docs/CrossCompile.txt create mode 100644 tools/install/build_fpc_rpm.sh diff --git a/.gitattributes b/.gitattributes index a062f1c62d..5b5c767752 100644 --- a/.gitattributes +++ b/.gitattributes @@ -193,6 +193,7 @@ designer/sizecompsdlg.pp svneol=native#text/pascal designer/taborderdlg.lfm svneol=native#text/plain designer/taborderdlg.lrs svneol=native#text/pascal designer/taborderdlg.pas svneol=native#text/pascal +docs/CrossCompile.txt svneol=native#text/plain docs/ExtendingTheIDE.txt svneol=native#text/plain docs/LazarusIDEInternals.pdf -text svneol=unset#application/pdf docs/Packages.txt svneol=native#text/plain @@ -932,6 +933,7 @@ packager/ufrmaddcomponent.pas svneol=native#text/pascal tools/apiwizz/apiwizard.pp svneol=native#text/pascal tools/apiwizz/apiwizz.pp svneol=native#text/pascal tools/check_ide_libs.sh -text svneol=native#application/x-sh +tools/install/build_fpc_rpm.sh -text svneol=native#application/x-sh tools/install/create_fpc_deb.sh -text svneol=native#application/x-sh tools/install/create_fpc_export_tgz.sh -text svneol=native#application/x-sh tools/install/create_fpc_rpm.sh -text svneol=native#application/x-sh diff --git a/docs/CrossCompile.txt b/docs/CrossCompile.txt new file mode 100644 index 0000000000..4186271b85 --- /dev/null +++ b/docs/CrossCompile.txt @@ -0,0 +1,48 @@ +Hints to cross compile win32 binaries under linux + + +UNDER CONSTRUCTION + + +Thanks to Vincent Snijders for the hints. + +1. Download the GNU Binary Utility Development Utilities. Most packages are +outdated. So probably you want to compile them yourself: + +Download sources: + []$ export CVSROOT=:pserver:anoncvs@sources.redhat.com:/cvs/src + []$ cvs login # password is anoncvs + []$ cvs -z3 co binutils + +Configure: + []$ rm -rf build-binutils # remove up old build directory + []$ mkdir build-binutils # create a build directory (important) + []$ cd build-binutils + []$ ../src/configure --prefix=/usr/bin/crosswin32 --target=i386-pc-winnt + +Build: + []$ make + +Install: + []$ su # become root to install + []$ rm -rf /usr/bin/crosswin32 # remove old install + []$ rm -rf /usr/bin/{asw,ldw,windres,dlltool} + []$ make install + []$ ln -s /usr/bin/crosswin32/bin/i386-pc-winnt-as /usr/bin/asw + []$ ln -s /usr/bin/crosswin32/bin/i386-pc-winnt-ld /usr/bin/ldw + ToDo: dlltool, windres + + +4. 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). +Install them next to the linux units in /usr/lib/fpc/1.0.x/units. + +4.1 Download the win32 units: Currently you can download the win32 snapshots at +ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/win32-i386/ + +4.2 Compile the win32 units: +Download the fpc sources. If you have already download them for linux, you can +use them also for win32, because the compiled files have different names. + + ToDo: rtl, fcl, ... + diff --git a/docs/INSTALL b/docs/INSTALL index 6aef563cae..cf0a480c13 100644 --- a/docs/INSTALL +++ b/docs/INSTALL @@ -70,7 +70,14 @@ properly: ToDo: Write me. - See www.freepascal.org. + See http://www.freepascal.org/down-win32.html. You can find a list of mirrors + at http://www.freepascal.org/sdown.html. Download for example fpc as one big + file, unzip it and run the install.exe. Then extend your PATH variable to the + fpc directory. For example under win98: Edit autoexec.bat and add the line + PATH=%PATH%;C:\pp\bin\bin\win32 + Then restart win98. + + ToDo: explain how to download fpc sources and build the compiler -------------------------------------------------------------------------------- diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index e6705c160b..82730f79f2 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -2570,8 +2570,6 @@ end; created. Place cached property code here. ------------------------------------------------------------------------------} procedure TWinControl.InitializeWnd; -var - R: TRect; begin Assert(False, Format('Trace:[TWinControl.InitializeWnd] %s', [ClassName])); // set all cached properties @@ -2579,10 +2577,9 @@ begin // MWE:All of this should be handled to the interface create routine Assert(False, 'Trace:TODO: [TWinControl.InitializeWnd] move this code to the interface'); - R:= Rect(Left, Top, Width, Height); //writeln('[TWinControl.InitializeWnd] ',Name,':',ClassName,' ',Left,',',Top,',',Width,',',Height); FBoundsRealized:=Bounds(Left, Top, Width, Height); - CNSendMessage(LM_SETSIZE, Self, @R); + CNSendMessage(LM_SETSIZE, Self, @FBoundsRealized); CNSendMessage(LM_SHOWHIDE, Self, nil); CNSendMessage(LM_SETCOLOR, Self, nil); Exclude(FFlags,wcfColorChanged); @@ -2874,6 +2871,9 @@ end; { ============================================================================= $Log$ + Revision 1.145 2003/06/28 12:10:02 mattias + fixed LM_SETSIZE in InitializeWnd + Revision 1.144 2003/06/27 23:42:38 mattias fixed TScrollBar resizing diff --git a/lcl/interfaces/gtk/gtkobject.inc b/lcl/interfaces/gtk/gtkobject.inc index 9530985ab3..b53b4dd5a8 100644 --- a/lcl/interfaces/gtk/gtkobject.inc +++ b/lcl/interfaces/gtk/gtkobject.inc @@ -2161,14 +2161,15 @@ begin SetFocus(Handle); end; - LM_SetSize : + LM_SetSize: begin Assert(False, Format('Trace: [TgtkObject.IntSendMessage3] %s --> LM_SetSize(%d, %d, %d, %d)', [Sender.ClassNAme, PRect(Data)^.Left,PRect(Data)^.Top,PRect(Data)^.Right,PRect(Data)^.Bottom])); //writeln('[IntSendMessage3.lm_setsize] Left=',PRect(Data)^.Left,' Top=',PRect(Data)^.Top, // ' Right=',PRect(Data)^.Right,' Bottom=',PRect(Data)^.Bottom); //writeln('[LM_SetSize] A ',Sender.ClassName,' ',PgtkWidget(Handle)^.window<>nil); ResizeChild(Sender,PRect(Data)^.Left,PRect(Data)^.Top, - PRect(Data)^.Right,PRect(Data)^.Bottom); + PRect(Data)^.Right-PRect(Data)^.Left, + PRect(Data)^.Bottom-PRect(Data)^.Top); //writeln('[LM_SetSize] B ',Sender.ClassName,' ',PgtkWidget(Handle)^.window<>nil); end; @@ -2176,9 +2177,9 @@ begin LM_TB_BUTTONCOUNT: begin - if (Sender is TToolbar) - then Result := pgtkToolbar(handle)^.num_Children - else Result := -1; + if (Sender is TToolbar) + then Result := pgtkToolbar(Handle)^.num_Children + else Result := -1; end; //SH: think of TCanvas.handle!!!! @@ -7488,6 +7489,9 @@ end; { ============================================================================= $Log$ + Revision 1.385 2003/06/28 12:10:02 mattias + fixed LM_SETSIZE in InitializeWnd + Revision 1.384 2003/06/27 23:42:38 mattias fixed TScrollBar resizing diff --git a/tools/install/build_fpc_rpm.sh b/tools/install/build_fpc_rpm.sh new file mode 100644 index 0000000000..4571a24212 --- /dev/null +++ b/tools/install/build_fpc_rpm.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +set -x +set -e + + +#------------------------------------------------------------------------------ +# parse parameters +#------------------------------------------------------------------------------ +Usage="Usage: $0 [nodocs] [notemp] " + +WithDOCS=yes +if [ "x$1" = "xnodocs" ]; then + WithDOCS=no + shift +fi + +WithTempDir=yes +if [ "x$1" = "xnotemp" ]; then + WithTempDir=no + shift +fi + +FPCSourceDir=$1 +shift +if [ "x$FPCSourceDir" = "x" ]; then + echo $Usage + exit -1 +fi + +LazRelease=$1 +shift +if [ "x$LazRelease" = "x" ]; then + echo $Usage + exit -1 +fi + + +#------------------------------------------------------------------------------ +# patching +#------------------------------------------------------------------------------ + +# create a temporary copy of the fpc sources to patch it +TmpDir=/tmp/fpc_patchdir +if [ "$WithTempDir" = "yes" ]; then + rm -rf $TmpDir + cp -a $FPCSourceDir $TmpDir +else + TmpDir=$FPCSourceDir +fi + +# retrieve the version information +VersionFile="$TmpDir/compiler/version.pas" +CompilerVersion=`cat $VersionFile | grep ' *version_nr *=.*;' | sed -e 's/[^0-9]//g'` +CompilerRelease=`cat $VersionFile | grep ' *release_nr *=.*;' | sed -e 's/[^0-9]//g'` +CompilerPatch=`cat $VersionFile | grep ' *patch_nr *=.*;' | sed -e 's/[^0-9]//g'` +LazVersion="$CompilerVersion.$CompilerRelease.$CompilerPatch" + + +SpecFile=$TmpDir/install/fpc.spec +SrcPatch=fpcsrc-patch + +# patch sources +patch -p2 -d $TmpDir/ < $SrcPatch + +# change spec file +cat $SpecFile | \ + sed -e 's/^Version: .*/Version: '"$LazVersion/" \ + -e 's/^Release: .*/Release: '"$LazRelease/" \ + > $SpecFile.New +# -e 's/^\%{fpcdir}\/samplecfg .*/%{fpcdir}\/samplecfg %{_libdir}\/fpc\/\\\$version/' \ +mv $SpecFile.New $SpecFile +if [ "$WithDOCS" = "no" ]; then + cat $SpecFile | \ + sed -e 's/^\(.*\bmake\b.*\bdocs\b\)/#\1/g' \ + -e 's/^\(%doc.*\*\.pdf\)/#\1/g' \ + > $SpecFile.New + mv $SpecFile.New $SpecFile +fi + +# change Makefile for new rpmbuild, if not already done +cd $TmpDir +grep rpmbuild Makefile \ +|| cat Makefile | \ + sed -e 's/rpm\( --nodeps -ba .*\)$/rpm\1 || rpmbuild\1/g' \ + > New.Makefile + mv New.Makefile Makefile +cd - + +#------------------------------------------------------------------------------ +# compile +#------------------------------------------------------------------------------ +cd $TmpDir +#make rtl +#make compiler +if [ "$WithDOCS" = "no" ]; then + make rpm NODOCS=1 +else + make rpm +fi +cd - + +# end. + diff --git a/tools/install/create_fpc_rpm.sh b/tools/install/create_fpc_rpm.sh index 454d7e9c6f..7016530430 100644 --- a/tools/install/create_fpc_rpm.sh +++ b/tools/install/create_fpc_rpm.sh @@ -1,8 +1,15 @@ #!/bin/bash +# +# Author: Mattias Gaertner +# +# Script to download fpc and create the rpms 'fpc' and 'fpcsrc'. set -x set -e +#------------------------------------------------------------------------------ +# parse parameters +#------------------------------------------------------------------------------ Usage="Usage: $0 devel|stable [nodocs]" FPCVersion=$1 @@ -66,41 +73,13 @@ cd $TmpDir tar xzf $SrcTGZ cd - -# patch sources -patch -p2 -d $TmpDir/fpc/ < $SrcPatch - -# change spec file -cat $SpecFile | \ - sed -e 's/^Version: .*/Version: '"$LazVersion/" \ - -e 's/^Release: .*/Release: '"$LazRelease/" \ - > $SpecFile.New -# -e 's/^\%{fpcdir}\/samplecfg .*/%{fpcdir}\/samplecfg %{_libdir}\/fpc\/\\\$version/' \ -mv $SpecFile.New $SpecFile -if [ "$WithDOCS" = "no" ]; then - cat $SpecFile | \ - sed -e 's/^\(.*\bmake\b.*\bdocs\b\)/#\1/g' \ - > $SpecFile.New - mv $SpecFile.New $SpecFile -fi - -# change Makefile for new rpmbuild -cd $TmpDir/fpc -cat Makefile | \ - sed -e 's/rpm\( --nodeps -ba .*\)$/rpm\1 || rpmbuild\1/g' \ - > New.Makefile -mv New.Makefile Makefile -cd - - # compile -cd $TmpDir/fpc -make rtl -make compiler +Params="notemp $TmpDir/fpc $LazRelease" if [ "$WithDOCS" = "no" ]; then - make rpm NODOCS=1 -else - make rpm + Params="nodocs $Params" fi -cd - +./build_fpc_rpm.sh $Params + echo