Browse Source

demo: started scrollbox

mattias 4 months ago
parent
commit
628b92d43e

+ 1 - 0
demo/ScrollBox/.gitignore

@@ -0,0 +1 @@
+ScrollBoxDemo1

+ 26 - 0
demo/ScrollBox/MainUnit.lfm

@@ -0,0 +1,26 @@
+object MainForm: TMainForm
+  Caption = 'MainForm'
+  FormLeft = 450
+  FormTop = 300
+  FormWidth = 350
+  FormHeight = 255
+  Stylesheet.Strings = (
+    'div {'
+    '  padding: 3px; '
+    '  border: 2px solid black; '
+    '  margin: 6px;'
+    '}'
+  )
+  OnCreate = MainFormCreate
+  Visible = true
+  object Body1: TBody
+    Style = 'border: 2px solid blue;'#10
+    object Div1: TDiv
+      Style = 'background-color: blue;'#10'border-color: black;'#10'height:50px;'
+      object Label1: TLabel
+        Style = 'color: red;'
+        Caption = 'Label1'
+      end
+    end
+  end
+end

+ 40 - 0
demo/ScrollBox/MainUnit.pas

@@ -0,0 +1,40 @@
+unit MainUnit;
+
+{$mode ObjFPC}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, Fresnel.Forms, Fresnel.Controls, Fresnel.Events,
+  FCL.Events;
+
+type
+
+  { TMainForm }
+
+  TMainForm = class(TFresnelForm)
+    Body1: TBody;
+    Div1: TDiv;
+    Label1: TLabel;
+    procedure MainFormCreate(Sender: TObject);
+  private
+  public
+  end;
+
+var
+  MainForm: TMainForm;
+
+implementation
+
+{$R *.lfm}
+
+{ TMainForm }
+
+procedure TMainForm.MainFormCreate(Sender: TObject);
+begin
+  Div1.Style:='overflow: auto; width: 200px; height: 50px;';
+  Label1.Caption:='Fresnel is a visual component library based on CSS and custom drawn components.';
+end;
+
+end.
+

+ 75 - 0
demo/ScrollBox/ScrollBoxDemo1.lpi

@@ -0,0 +1,75 @@
+<?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="ScrollBoxDemo1"/>
+      <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="Fresnel"/>
+        <DefaultFilename Value="../../src/fresnel.lpk" Prefer="True"/>
+      </Item>
+    </RequiredPackages>
+    <Units>
+      <Unit>
+        <Filename Value="ScrollBoxDemo1.lpr"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+      <Unit>
+        <Filename Value="MainUnit.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="MainForm"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Other"/>
+        <ResourceBaseClassname Value="TFresnelForm"/>
+      </Unit>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <Target>
+      <Filename Value="ScrollBoxDemo1"/>
+    </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>

+ 16 - 0
demo/ScrollBox/ScrollBoxDemo1.lpr

@@ -0,0 +1,16 @@
+program ScrollBoxDemo1;
+
+uses
+  {$IFDEF Unix}
+  cthreads,
+  {$ENDIF}
+  Fresnel, // initializes the widgetset
+  Fresnel.App, MainUnit;
+
+begin
+  FresnelApplication.HookFresnelLog:=true;
+  FresnelApplication.Initialize;
+  FresnelApplication.CreateForm(TMainForm,MainForm);
+  FresnelApplication.Run;
+end.
+