Browse Source

demo: started button generator

mattias 1 year ago
parent
commit
d360b38287

BIN
demo/ButtonGenerator/ButtonGenerator.ico


+ 72 - 0
demo/ButtonGenerator/ButtonGenerator.lpi

@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="12"/>
+    <General>
+      <SessionStorage Value="InProjectDir"/>
+      <Title Value="ButtonGenerator"/>
+      <Scaled Value="True"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+      <Icon Value="0"/>
+    </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"/>
+      </Item>
+    </RequiredPackages>
+    <Units>
+      <Unit>
+        <Filename Value="ButtonGenerator.lpr"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+      <Unit>
+        <Filename Value="MainUnit.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="FresnelForm1"/>
+        <ResourceBaseClass Value="Other"/>
+        <ResourceBaseClassname Value="TFresnelForm"/>
+      </Unit>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <Target>
+      <Filename Value="ButtonGenerator"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Options>
+        <Win32>
+          <GraphicApplication Value="True"/>
+        </Win32>
+      </Options>
+    </Linking>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions>
+      <Item>
+        <Name Value="EAbort"/>
+      </Item>
+      <Item>
+        <Name Value="ECodetoolError"/>
+      </Item>
+      <Item>
+        <Name Value="EFOpenError"/>
+      </Item>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 23 - 0
demo/ButtonGenerator/ButtonGenerator.lpr

@@ -0,0 +1,23 @@
+program ButtonGenerator;
+
+{$mode objfpc}{$H+}
+
+uses
+  {$IFDEF UNIX}
+  cthreads,
+  {$ENDIF}
+  {$IFDEF HASAMIGA}
+  athreads,
+  {$ENDIF}
+  Fresnel, // this includes the Fresnel widgetset
+  Fresnel.Forms, MainUnit
+  { you can add units after this };
+
+{$R *.res}
+
+begin
+  Application.Initialize;
+  Application.CreateForm(TFresnelForm1, FresnelForm1);
+  Application.Run;
+end.
+

BIN
demo/ButtonGenerator/ButtonGenerator.res


+ 12 - 0
demo/ButtonGenerator/MainUnit.lfm

@@ -0,0 +1,12 @@
+object FresnelForm1: TFresnelForm1
+  FormLeft = 168
+  FormTop = 336
+  FormWidth = 320
+  FormHeight = 240
+  OnCreate = FresnelForm1Create
+  object ButtonDiv: TDiv
+  end
+  object ButtonLabel: TLabel
+    Caption = 'Button Text'
+  end
+end

+ 47 - 0
demo/ButtonGenerator/MainUnit.pas

@@ -0,0 +1,47 @@
+unit MainUnit;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, Fresnel.Forms, Fresnel.DOM,
+    Fresnel.Controls;
+
+type
+
+  { TFresnelForm1 }
+
+  TFresnelForm1 = class(TFresnelForm)
+    ButtonDiv: TDiv;
+    ButtonLabel: TLabel;
+    procedure FresnelForm1Create(Sender: TObject);
+  private
+
+  public
+
+  end;
+
+var
+  FresnelForm1: TFresnelForm1;
+
+implementation
+
+{$R *.lfm}
+
+{ TFresnelForm1 }
+
+procedure TFresnelForm1.FresnelForm1Create(Sender: TObject);
+begin
+  ButtonDiv.Style:='width:140px; height:50px;'
+    +'background:#44c767;'
+    +'border-width:1px;'
+    +'border-color:#18ab29;'
+    +'border-radius:28px;'
+    +'font-size:15px; font-family:Arial; font-weight:bold;'
+    +'color:#fff;'
+    +'text-shadow: 1px 1px 0px #2f6627;'
+end;
+
+end.
+