Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-08

Patch: combobox (and other controls) top position

19 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner
to Vincent Snijders: I don't know how to apply a patch on a windows computer. Done only once or twice on a…
Show quoted text 22 lines
> -----Oorspronkelijk bericht----- > Van: Micha Nelissen > Mattias Gaertner wrote: > > > Is the patch ok? I get > > > > patching file win32callback.inc > > Reversed (or previously applied) patch detected! Assume -R? [n] > > I believe so. If you check Vincent's error message, it says line 437. > The patch attempts to remove line 437 and add one around 412. Vincent, > can you succesfully apply the patch locally? I don't know how to apply a patch on a windows computer. Done only once or twice on a linux computer. Where can I get a patch utility for windows? If you mean: Can I cut and paste line 438 to line 412? I can and it compiles.

Right.

Finally, I was able to commit.

Mattias

Reply by email

Mattias Gaertner
to Vincent Snijders: Now I can't compile the win32 interface. It gives the following error: The error is:…
Show quoted text 17 lines
Vincent Snijders wrote: > Hi Micha, > > Now I can't compile the win32 interface. It gives the following error: > The error is: > win32callback.inc(437,39) Error: Identifier not found XPOS > win32callback.inc(437,45) Error: Identifier not found YPOS > The line involved is: > Win32PosToLCLPos(OwnerObject, XPos, YPos); > Can you look into this? The patch was not applied cleanly for some reason. That Win32Pos.. call needs to be removed from the WM_NOTIFY handler and inserted into the WM_MOVE one. Attached is a patch, the patch itself contains the revisions I have used to patch against. callback=1.48, list=1.10, object=1.82.

Is the patch ok? I get

patching file win32callback.inc
Reversed (or previously applied) patch detected! Assume -R? [n]

I get "connection refused" from cvs.freepascal.org (cvs and ssh). Michael, can you check that?

Mattias

Reply by email

Michael Van Canneyt
to Micha Nelissen: The recent RPC virus? Micha.
Micha Nelissen wrote 16 lines
Michael Van Canneyt wrote: >>>I get "connection refused" from cvs.freepascal.org (cvs and ssh). Michael, >>>can you check that? >> >>both idefix (cvs) and deadlock( ftp.freepascal.org) are having problems. >> >>Deadlock is down totally, and idefix pings, but seems to refuse connections. > > > Our firewall is under heavy load and refuses most connections. > Most of our XP machines are under heavy attack and are continuously > infected with (yet another) microsoft virus or whatever the attack is > using. The recent RPC virus?

Yes. Luckily the servers don't run M$ software.

Michael.

Reply by email

Vincent Snijders
Show quoted text 12 lines
-----Oorspronkelijk bericht----- Van: Micha Nelissen Mattias Gaertner wrote: > Is the patch ok? I get > > patching file win32callback.inc > Reversed (or previously applied) patch detected! Assume -R? [n] I believe so. If you check Vincent's error message, it says line 437. The patch attempts to remove line 437 and add one around 412. Vincent, can you succesfully apply the patch locally?

I don't know how to apply a patch on a windows computer. Done only once or twice on a linux computer. Where can I get a patch utility for windows?

If you mean: Can I cut and paste line 438 to line 412? I can and it compiles.

Vincent.

Reply by email

Micha Nelissen
to Vincent Snijders: Just a report, no time to look for causes. I updated the source, recompiled everything,…
Vincent Snijders wrote 14 lines
>-----Oorspronkelijk bericht----- >Van: Mattias Gaertner >Verzonden: dinsdag 12 augustus 2003 16:18 >Finally, I was able to commit. Just a report, no time to look for causes. I updated the source, recompiled everything, started lazarus, the hello example and other examples and noticed that all form sizes are the same. :-( Something has gone from almost working to almost not working, is seems. ;-)

Another accident on the CVS server. Micha to the rescue with another patch ;). It seems it has concatenated two lines this time. And a minor fix using HandleAllocated instead of Handle 0 which is always true, duh.

BTW: for patching I use the cygwin tools, from cygwin.com.

Example: 'patch < resize.patch' in the win32 interface directory will fix the current bug.

HTH,

Micha.

Index: win32object.inc
===================================================================
RCS file: /FPC/CVS/projects/lazarus/lcl/interfaces/win32/win32object.inc,v
retrieving revision 1.83
diff -u -w -r1.83 win32object.inc
--- win32object.inc	12 Aug 2003 14:02:54 -0000	1.83
+++ win32object.inc	12 Aug 2003 15:38:43 -0000
@@ -645,7 +645,7 @@
               end
               else if TControl(Sender).FCompStyle = csPage then
               begin
-                if (Sender As TWinControl).Parent.Handle0 then
+                if (Sender As TWinControl).Parent.HandleAllocated then
                 begin
                   Windows.SendMessage((Sender As TWinControl).Parent.Handle, TCM_AdjustRect, 0, LPARAM(@R));
                   Left := R.Left;
@@ -657,7 +657,8 @@
 //              if (Windows.GetWindowLong(TWinControl(Sender).Handle, GWL_STYLE) and WS_VSCROLL)  0 then
 //                R.Right := R.Right + GetSystemMetrics(SM_CXVSCROLL);
 //              if (Windows.GetWindowLong(TWinControl(Sender).Handle, GWL_STYLE) and WS_HSCROLL)  0 then
-//                R.Bottom := R.Bottom + GetSystemMetrics(SM_CYHSCROLL);                  ResizeChild(Sender, R.Left, R.Top, R.Right , R.Bottom);
+//                R.Bottom := R.Bottom + GetSystemMetrics(SM_CYHSCROLL);
+              ResizeChild(Sender, R.Left, R.Top, R.Right , R.Bottom);
             end;
           end;
         End;

Reply by email

Micha Nelissen
to Micha Nelissen: Attached is a patch to fix top position of controls (especially TComboBox) in TGroupBoxes.
Mattias Gaertner wrote 17 lines
On Mon, 11 Aug 2003 20:50:21 +0200 Micha Nelissen wrote: >Micha Nelissen wrote: > > >>Hi, >> >>Attached is a patch to fix top position of controls (especially >>TComboBox) in TGroupBoxes. > >And a patch for the patch: forgot that Sender could nil, so add a check >for that one. See attached patch. Applied. Thanks.

I believe the patches were not applied fully, because cvs diff still generates the attached patch. How come?

Micha.

Index: win32callback.inc
=================================================================== RCS file: /FPC/CVS/projects/lazarus/lcl/interfaces/win32/win32callback.inc,v retrieving revision 1.48
diff -u -w -r1.48 win32callback.inc
--- win32callback.inc 11 Aug 2003 20:18:46 -0000 1.48 +++ win32callback.inc 12 Aug 2003 09:16:43 -0000
@@ -409,6 +409,7 @@

           XPos := LoWord(LParam);
           YPos := HiWord(LParam);
         end;

+ Win32PosToLCLPos(OwnerObject, XPos, YPos);

       End;
     End;
     //TODO:LM_MOVEPAGE,LM_MOVETOROW,LM_MOVETOCOLUMN

Index: win32listsl.inc
=================================================================== RCS file: /FPC/CVS/projects/lazarus/lcl/interfaces/win32/win32listsl.inc,v retrieving revision 1.10
diff -u -w -r1.10 win32listsl.inc
--- win32listsl.inc 28 Jul 2003 06:42:42 -0000 1.10 +++ win32listsl.inc 12 Aug 2003 09:16:43 -0000
@@ -205,9 +205,6 @@
------------------------------------------------------------------------------} Procedure TWin32ListStringList.Insert(Index: Integer; Const S: String); Begin
- If (FSender.FCompStyle = csComboBox)
- and (GetCount 0) Then
- FSender.Height := (FSender.Height + (FSender.Height Div GetCount));

   If FSorted Then
     SendMessage(FWin32List,FFlagAddString, 0, LPARAM(PChar(S)))
   Else

Reply by email

Vincent Snijders
-----Oorspronkelijk bericht----- Van: Mattias Gaertner Verzonden: dinsdag 12 augustus 2003 16:18 Finally, I was able to commit.

Just a report, no time to look for causes.

I updated the source, recompiled everything, started lazarus, the hello example and other examples and noticed that all form sizes are the same. :-(

Something has gone from almost working to almost not working, is seems. ;-)

Vincent.

Reply by email

Micha Nelissen
to Vincent Snijders: Now I can't compile the win32 interface. It gives the following error: The error is:…
Vincent Snijders wrote 9 lines
Hi Micha, Now I can't compile the win32 interface. It gives the following error: The error is: win32callback.inc(437,39) Error: Identifier not found XPOS win32callback.inc(437,45) Error: Identifier not found YPOS The line involved is: Win32PosToLCLPos(OwnerObject, XPos, YPos); Can you look into this?

The patch was not applied cleanly for some reason. That Win32Pos.. call needs to be removed from the WM_NOTIFY handler and inserted into the WM_MOVE one. Attached is a patch, the patch itself contains the revisions I have used to patch against. callback=1.48, list=1.10, object=1.82.

HTH,

Micha.

Index: win32callback.inc
=================================================================== RCS file: /FPC/CVS/projects/lazarus/lcl/interfaces/win32/win32callback.inc,v retrieving revision 1.48
diff -u -w -r1.48 win32callback.inc
--- win32callback.inc 11 Aug 2003 20:18:46 -0000 1.48 +++ win32callback.inc 12 Aug 2003 09:59:59 -0000
@@ -409,6 +409,7 @@

           XPos := LoWord(LParam);
           YPos := HiWord(LParam);
         end;

+ Win32PosToLCLPos(OwnerObject, XPos, YPos);

       End;
     End;
     //TODO:LM_MOVEPAGE,LM_MOVETOROW,LM_MOVETOCOLUMN

@@ -434,7 +435,6 @@

             idFrom := SendMessage(HWndFrom, TCM_GETCURSEL, 0, 0);
           end;
         end;

- Win32PosToLCLPos(OwnerObject, XPos, YPos);

       End;
     End;
     WM_PAINT:

Index: win32listsl.inc
=================================================================== RCS file: /FPC/CVS/projects/lazarus/lcl/interfaces/win32/win32listsl.inc,v retrieving revision 1.10
diff -u -w -r1.10 win32listsl.inc
--- win32listsl.inc 28 Jul 2003 06:42:42 -0000 1.10 +++ win32listsl.inc 12 Aug 2003 09:59:59 -0000
@@ -205,9 +205,6 @@
------------------------------------------------------------------------------} Procedure TWin32ListStringList.Insert(Index: Integer; Const S: String); Begin
- If (FSender.FCompStyle = csComboBox)
- and (GetCount 0) Then
- FSender.Height := (FSender.Height + (FSender.Height Div GetCount));

   If FSorted Then
     SendMessage(FWin32List,FFlagAddString, 0, LPARAM(PChar(S)))
   Else

Index: win32object.inc
=================================================================== RCS file: /FPC/CVS/projects/lazarus/lcl/interfaces/win32/win32object.inc,v retrieving revision 1.82
diff -u -w -r1.82 win32object.inc
--- win32object.inc 11 Aug 2003 20:18:46 -0000 1.82 +++ win32object.inc 12 Aug 2003 10:00:00 -0000
@@ -653,6 +653,11 @@

                 end
               end;
               R := Rect(Left, Top, R.Right - R.Left, R.Bottom - R.Top);

+ {Adjust for scrollbar}
+// if (Windows.GetWindowLong(TWinControl(Sender).Handle, GWL_STYLE) and WS_VSCROLL) 0 then +// R.Right := R.Right + GetSystemMetrics(SM_CXVSCROLL); +// if (Windows.GetWindowLong(TWinControl(Sender).Handle, GWL_STYLE) and WS_HSCROLL) 0 then +// R.Bottom := R.Bottom + GetSystemMetrics(SM_CYHSCROLL);

                   ResizeChild(Sender, R.Left, R.Top, R.Right , R.Bottom);
             end;
           end;

Reply by email

Marco van de Voort
to Mattias Gaertner: On Tue, 12 Aug 2003 12:03:33 +0200 Is the patch ok? I get patching file win32callback.inc…
Show quoted text 20 lines
> > win32callback.inc(437,39) Error: Identifier not found XPOS > > win32callback.inc(437,45) Error: Identifier not found YPOS > > The line involved is: > > Win32PosToLCLPos(OwnerObject, XPos, YPos); > > Can you look into this? > > The patch was not applied cleanly for some reason. That Win32Pos.. call > needs to be removed from the WM_NOTIFY handler and inserted into the > WM_MOVE one. Attached is a patch, the patch itself contains the > revisions I have used to patch against. callback=1.48, list=1.10, > object=1.82. Is the patch ok? I get patching file win32callback.inc Reversed (or previously applied) patch detected! Assume -R? [n] I get "connection refused" from cvs.freepascal.org (cvs and ssh). Michael, can you check that?

both idefix (cvs) and deadlock( ftp.freepascal.org) are having problems.

Deadlock is down totally, and idefix pings, but seems to refuse connections.

Reply by email

Micha Nelissen
to Vincent Snijders: Now I can't compile the win32 interface. It gives the following error: The error is:…
Mattias Gaertner wrote 28 lines
On Tue, 12 Aug 2003 12:03:33 +0200 Micha Nelissen wrote: >Vincent Snijders wrote: > > >>Hi Micha, >> >>Now I can't compile the win32 interface. It gives the following error: >>The error is: >>win32callback.inc(437,39) Error: Identifier not found XPOS >>win32callback.inc(437,45) Error: Identifier not found YPOS >>The line involved is: >> Win32PosToLCLPos(OwnerObject, XPos, YPos); >>Can you look into this? > >The patch was not applied cleanly for some reason. That Win32Pos.. call >needs to be removed from the WM_NOTIFY handler and inserted into the >WM_MOVE one. Attached is a patch, the patch itself contains the >revisions I have used to patch against. callback=1.48, list=1.10, >object=1.82. Is the patch ok? I get patching file win32callback.inc Reversed (or previously applied) patch detected! Assume -R? [n]

I believe so. If you check Vincent's error message, it says line 437. The patch attempts to remove line 437 and add one around 412. Vincent, can you succesfully apply the patch locally?

Mattias, does cvs diff produce any output for you? Iow, is your local copy exactly the same as CVS?

I currently can't ping or reach the cvs server anymore.

Regards,

Micha.

Reply by email

Vincent Snijders

Hi Micha,

Now I can't compile the win32 interface. It gives the following error: The error is:
win32callback.inc(437,39) Error: Identifier not found XPOS win32callback.inc(437,45) Error: Identifier not found YPOS The line involved is:

  Win32PosToLCLPos(OwnerObject, XPos, YPos);

Can you look into this?

Vincent.

Show quoted text 10 lines
-----Oorspronkelijk bericht----- Van: Micha Nelissen Micha Nelissen wrote: > Hi, > > Attached is a patch to fix top position of controls (especially > TComboBox) in TGroupBoxes. And a patch for the patch: forgot that Sender could nil, so add a

check

Show quoted text 5 lines
for that one. See attached patch. Regards, Micha.

Reply by email

Micha Nelissen

Hi,

Attached is a patch to fix top position of controls (especially TComboBox) in TGroupBoxes.

Also fixes some AV's because I noticed that sometimes in DestroyComponent the Handle is recreated, ie. CreateWnd is called on the same control. I fixed it by removing 'Lazarus' from the property list so the callback doesn't see it anymore.

Regards,

Micha.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00061.bin
Type: application/octet-stream
Size: 1444 bytes
Desc: "combo_top.patch.gz"
Url : http://localhost/pipermail/lazarus/attachments/20030811/30e88f4c/bin00061.bin

Reply by email

Micha Nelissen
to Michael Van Canneyt: Our firewall is under heavy load and refuses most connections. Most of our XP machines…
Michael Van Canneyt wrote 12 lines
>>I get "connection refused" from cvs.freepascal.org (cvs and ssh). Michael, >>can you check that? > >both idefix (cvs) and deadlock( ftp.freepascal.org) are having problems. > >Deadlock is down totally, and idefix pings, but seems to refuse connections. Our firewall is under heavy load and refuses most connections. Most of our XP machines are under heavy attack and are continuously infected with (yet another) microsoft virus or whatever the attack is using.

The recent RPC virus?

Micha.

Reply by email

Mattias Gaertner
to Vincent Snijders: Now I can't compile the win32 interface. It gives the following error: The error is:…
Show quoted text 37 lines
Mattias Gaertner wrote: > On Tue, 12 Aug 2003 12:03:33 +0200 > Micha Nelissen wrote: > > >>Vincent Snijders wrote: >> >> >>>Hi Micha, >>> >>>Now I can't compile the win32 interface. It gives the following error: >>>The error is: >>>win32callback.inc(437,39) Error: Identifier not found XPOS >>>win32callback.inc(437,45) Error: Identifier not found YPOS >>>The line involved is: >>> Win32PosToLCLPos(OwnerObject, XPos, YPos); >>>Can you look into this? >> >>The patch was not applied cleanly for some reason. That Win32Pos.. call >>needs to be removed from the WM_NOTIFY handler and inserted into the >>WM_MOVE one. Attached is a patch, the patch itself contains the >>revisions I have used to patch against. callback=1.48, list=1.10, >>object=1.82. > > > Is the patch ok? I get > > patching file win32callback.inc > Reversed (or previously applied) patch detected! Assume -R? [n] I believe so. If you check Vincent's error message, it says line 437. The patch attempts to remove line 437 and add one around 412. Vincent, can you succesfully apply the patch locally? Mattias, does cvs diff produce any output for you? Iow, is your local copy exactly the same as CVS?

Yep. That was my last successful action before the server refused.

Mattias

Reply by email

Micha Nelissen
to Micha Nelissen: Attached is a patch to fix top position of controls (especially TComboBox) in TGroupBoxes.
Micha Nelissen wrote
Hi, Attached is a patch to fix top position of controls (especially TComboBox) in TGroupBoxes.

And a patch for the patch: forgot that Sender could nil, so add a check for that one. See attached patch.

Regards,

Micha.

--- win32proc.old.inc	2003-08-11 20:49:01.000000000 +0200
+++ win32proc.inc	2003-08-11 20:47:11.000000000 +0200
@@ -715,6 +715,7 @@
   DC: HDC;
   Handle: HWND;
 Begin
+  if Sender = nil then exit;
   If (TControl(Sender).Parent Is TCustomGroupBox) Then
   Begin
     Handle := TControl(Sender).Parent.Handle;
@@ -731,6 +732,7 @@
   DC: HDC;
   Handle: HWND;
 Begin
+  if Sender = nil then exit;
   // check for groupbox client pos
   If (TControl(Sender).Parent Is TCustomGroupBox) Then
   Begin

Reply by email

Vincent Snijders
Show quoted text 7 lines
-----Oorspronkelijk bericht----- Van: Micha Nelissen Verzonden: dinsdag 12 augustus 2003 17:43 Another accident on the CVS server. Micha to the rescue with another patch ;). It seems it has concatenated two lines this time. And a

minor

fix using HandleAllocated instead of Handle 0 which is always true,

duh.

Show quoted text 9 lines
BTW: for patching I use the cygwin tools, from cygwin.com. Example: 'patch < resize.patch' in the win32 interface directory will fix the current bug. HTH, Micha.

Thanks for the rescue. I patched with cut and paste. ;-) It helped.

Vincent

Reply by email

Mattias Gaertner
to Vincent Snijders: Just a report, no time to look for causes. I updated the source, recompiled everything,…
Show quoted text 23 lines
Vincent Snijders wrote: > >>-----Oorspronkelijk bericht----- >>Van: Mattias Gaertner >>Verzonden: dinsdag 12 augustus 2003 16:18 >>Finally, I was able to commit. > > Just a report, no time to look for causes. > > I updated the source, recompiled everything, started lazarus, the hello > example and other examples and noticed that all form sizes are the same. > :-( > > Something has gone from almost working to almost not working, is seems. > ;-) Another accident on the CVS server. Micha to the rescue with another patch ;). It seems it has concatenated two lines this time. And a minor fix using HandleAllocated instead of Handle 0 which is always true, duh. BTW: for patching I use the cygwin tools, from cygwin.com.

This time the patch applied without errors. Only the server is quite slow ..

Mattias

Show quoted text 9 lines
Example: 'patch < resize.patch' in the win32 interface directory will fix the current bug. HTH, Micha.

Reply by email

Michael Van Canneyt
to Marco van de Voort: both idefix (cvs) and deadlock( ftp.freepascal.org) are having problems. Deadlock is down…
Marco van de Voort wrote 24 lines
> > > win32callback.inc(437,39) Error: Identifier not found XPOS > > > win32callback.inc(437,45) Error: Identifier not found YPOS > > > The line involved is: > > > Win32PosToLCLPos(OwnerObject, XPos, YPos); > > > Can you look into this? > > > > The patch was not applied cleanly for some reason. That Win32Pos.. call > > needs to be removed from the WM_NOTIFY handler and inserted into the > > WM_MOVE one. Attached is a patch, the patch itself contains the > > revisions I have used to patch against. callback=1.48, list=1.10, > > object=1.82. > > Is the patch ok? I get > > patching file win32callback.inc > Reversed (or previously applied) patch detected! Assume -R? [n] > > > I get "connection refused" from cvs.freepascal.org (cvs and ssh). Michael, > can you check that? both idefix (cvs) and deadlock( ftp.freepascal.org) are having problems. Deadlock is down totally, and idefix pings, but seems to refuse connections.

Our firewall is under heavy load and refuses most connections. Most of our XP machines are under heavy attack and are continuously infected with (yet another) microsoft virus or whatever the attack is using.

One day, all this M$ machines will be banished if it continues like this :/

Michael.

Reply by email