Scrolling WinControl does not scroll all controls equally
Original Reporter info from Mantis: torstenchr
-
Reporter name: Torsten Bonde Christiansen
Original Reporter info from Mantis: torstenchr
- Reporter name: Torsten Bonde Christiansen
Description:
Using a TSrollbox that contains a mix of TLabel's and TEdit's does not scroll the controls equally using the vertical scrollbar.
See the attached image demonstrating the problem.
Additional information:
Code for a form demonstrating the problem.
unit main;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ExtCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Panel1: TPanel;
ScrollBox1: TScrollBox;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var
Lbl: TLabel;
begin
Lbl := TLabel.Create(ScrollBox1);
Lbl.Name := 'lbl' + inttostr(ScrollBox1.ComponentCount);
Lbl.Caption := 'Label... ' + inttostr(ScrollBox1.ComponentCount);
Lbl.left := 20;
lbl.Top := (ScrollBox1.ComponentCount * 30) + 10;
Lbl.Parent := ScrollBox1;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
Edt: TEdit;
begin
Edt := TEdit.Create(ScrollBox1);
Edt.Name := 'edit' + inttostr(ScrollBox1.ComponentCount);
Edt.left := 100;
Edt.Top := (ScrollBox1.ComponentCount * 30) + 10;
Edt.Parent := ScrollBox1;
end;
end.
Mantis conversion info:
- Mantis ID: 19020
- OS: Linux
- OS Build: Ubuntu 10.04
- Build: r29944
- Platform: x86_64
- Version: 0.9.31 (SVN)
- Fixed in version: 0.9.31 (SVN)
- Fixed in revision: 30076 (#a7f36e8f)