[lazarus] Patch: combobox (and other controls) top position

Micha Nelissen M.Nelissen at student.tue.nl
Tue Aug 12 11:11:01 EDT 2003


Vincent Snijders wrote:

> 
>>-----Oorspronkelijk bericht-----
>>Van: Mattias Gaertner [mailto:nc-gaertnma at netcologne.de]
>>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.Handle<>0 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;





More information about the Lazarus mailing list