mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 20:19:24 +02:00
test: added test if TScrollBox has interface preferred size 0x0
git-svn-id: trunk@29034 -
This commit is contained in:
parent
0714e1cb71
commit
95f11f493b
@ -6,7 +6,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LCLProc, Forms, Controls, StdCtrls, ExtCtrls, fpcunit,
|
||||
testglobals;
|
||||
WSControls, testglobals;
|
||||
|
||||
type
|
||||
|
||||
@ -89,6 +89,8 @@ var
|
||||
Form1: TForm;
|
||||
ScrollBox1: TScrollBox;
|
||||
Panel1: TPanel;
|
||||
IntfPreferredWidth: integer;
|
||||
IntfPreferredHeight: integer;
|
||||
begin
|
||||
// create a scrollbox on a form and put a small panel into the box
|
||||
Form1:=TForm.Create(nil);
|
||||
@ -106,6 +108,13 @@ begin
|
||||
Form1.Show;
|
||||
Application.ProcessMessages;
|
||||
|
||||
IntfPreferredWidth:=0;
|
||||
IntfPreferredHeight:=0;
|
||||
TWSWinControlClass(ScrollBox1.WidgetSetClass).GetPreferredSize(ScrollBox1,
|
||||
IntfPreferredWidth, IntfPreferredHeight, false);
|
||||
AssertEquals('ScrollBox must not have interface preferred width',0,IntfPreferredWidth);
|
||||
AssertEquals('ScrollBox must not have interface preferred height',0,IntfPreferredHeight);
|
||||
|
||||
//writeln('TTestPreferredSize.TestScrollBoxOneChildPanel Range=',ScrollBox1.HorzScrollBar.Range,' ',ScrollBox1.HorzScrollBar.Page,' ',ScrollBox1.HorzScrollBar.Visible);
|
||||
AssertEquals('ScrollBox1.HorzScrollBar.Range should be the needed Right of all childs 60',60,ScrollBox1.HorzScrollBar.Range);
|
||||
AssertEquals('ScrollBox1.VertScrollBar.Range should be the needed Bottom of all childs 50',50,ScrollBox1.VertScrollBar.Range);
|
||||
|
Loading…
Reference in New Issue
Block a user