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

Micha Nelissen M.Nelissen at student.tue.nl
Tue Aug 12 05:31:47 EDT 2003


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.

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;





More information about the Lazarus mailing list