Pārlūkot izejas kodu

test: scroll viewport

mattias 3 mēneši atpakaļ
vecāks
revīzija
2ae2d2eea6

+ 0 - 2
demo/ScrollBox/MainUnit.pas

@@ -78,8 +78,6 @@ begin
   AutoHideCheckBox.Checked:=ScrollbarsAutoHide;
   HaveButtonsCheckBox.Checked:=ScrollbarsHaveButtons;
   OverlayCheckBox.Checked:=ScrollbarsOverlay;
-
-  // todo: step buttons
   // todo: stable
 end;
 

+ 1 - 0
tests/exploration/scroll/.gitignore

@@ -0,0 +1 @@
+ScrollWheelTest1

+ 70 - 0
tests/exploration/scroll/ScrollWheelTest1.lpi

@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="12"/>
+    <General>
+      <Flags>
+        <MainUnitHasCreateFormStatements Value="False"/>
+        <MainUnitHasTitleStatement Value="False"/>
+        <MainUnitHasScaledStatement Value="False"/>
+      </Flags>
+      <SessionStorage Value="InProjectDir"/>
+      <Title Value="ScrollWheelTest1"/>
+      <UseAppBundle Value="False"/>
+      <ResourceType Value="res"/>
+    </General>
+    <BuildModes>
+      <Item Name="Default" Default="True"/>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <UseFileFilters Value="True"/>
+    </PublishOptions>
+    <RunParams>
+      <FormatVersion Value="2"/>
+    </RunParams>
+    <RequiredPackages>
+      <Item>
+        <PackageName Value="FresnelDemoComps"/>
+      </Item>
+      <Item>
+        <PackageName Value="Fresnel"/>
+        <DefaultFilename Value="../../src/fresnel.lpk" Prefer="True"/>
+      </Item>
+    </RequiredPackages>
+    <Units>
+      <Unit>
+        <Filename Value="ScrollWheelTest1.lpr"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <Target>
+      <Filename Value="ScrollWheelTest1"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Debugging>
+        <DebugInfoType Value="dsDwarf2"/>
+      </Debugging>
+    </Linking>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions>
+      <Item>
+        <Name Value="EAbort"/>
+      </Item>
+      <Item>
+        <Name Value="ECodetoolError"/>
+      </Item>
+      <Item>
+        <Name Value="EFOpenError"/>
+      </Item>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 63 - 0
tests/exploration/scroll/ScrollWheelTest1.lpr

@@ -0,0 +1,63 @@
+program ScrollWheelTest1;
+
+uses
+  {$IFDEF Unix}
+  cthreads,
+  {$ENDIF}
+  Fresnel, // initializes the widgetset
+  Fresnel.App,
+  Classes, SysUtils, Fresnel.Forms, Fresnel.Controls, Fresnel.Events,
+  FCL.Events, Fresnel.Classes;
+
+type
+
+  { TMainForm }
+
+  TMainForm = class(TFresnelForm)
+    Body: TBody;
+    HeaderLabel: TLabel;
+  public
+    constructor CreateNew(AOwner: TComponent); override;
+  end;
+
+{ TMainForm }
+
+constructor TMainForm.CreateNew(AOwner: TComponent);
+begin
+  inherited CreateNew(AOwner);
+  Name:='MainForm';
+
+  FormBounds:=BoundsRectFre(100,100,200,150);
+
+  Stylesheet.Text:=''
+    +'div {'+LineEnding
+    +'  border: 2px solid blue;'
+    +'  padding: 10px;'
+    +'}'+LineEnding;
+
+  Body:=TBody.Create(Self);
+  with Body do begin
+    Name:='Body';
+    Parent:=Self;
+  end;
+
+  HeaderLabel:=TLabel.Create(Self);
+  with HeaderLabel do begin
+    Name:='HeaderLabel';
+    Style:='border: 1px solid red;';
+    Caption:='Fresnel is a visual component library based on CSS and custom drawn components';
+    Parent:=Body;
+  end;
+
+  Visible:=true;
+end;
+
+var
+  MainForm: TMainForm;
+begin
+  FresnelApplication.HookFresnelLog:=true;
+  FresnelApplication.Initialize;
+  FresnelApplication.CreateForm(TMainForm,MainForm);
+  FresnelApplication.Run;
+end.
+