Przeglądaj źródła

demo: lcl buttongenerator

mattias 1 rok temu
rodzic
commit
2e5f409940

+ 4 - 0
demo/ButtonGenerator/ButtonGenerator.lpi

@@ -50,6 +50,10 @@
         <Filename Value="../CheckBox/DemoCheckBox.pas"/>
         <IsPartOfProject Value="True"/>
       </Unit>
+      <Unit>
+        <Filename Value="DemoButtonGenerator.pas"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
     </Units>
   </ProjectOptions>
   <CompilerOptions>

+ 1 - 1
demo/ButtonGenerator/ButtonGenerator.lpr

@@ -10,7 +10,7 @@ uses
   athreads,
   {$ENDIF}
   Fresnel, // this includes the Fresnel widgetset
-  Fresnel.Forms, MainUnit, DemoSlider, DemoCheckBox
+  Fresnel.Forms, MainUnit, DemoSlider, DemoCheckBox, DemoButtonGenerator
   { you can add units after this };
 
 {$R *.res}

+ 249 - 0
demo/ButtonGenerator/DemoButtonGenerator.pas

@@ -0,0 +1,249 @@
+unit DemoButtonGenerator;
+
+{$mode ObjFPC}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, Fresnel.DOM, Fresnel.Controls, DemoSlider, DemoCheckBox;
+
+type
+
+  { TDemoButtonGenerator }
+
+  TDemoButtonGenerator = class(TDiv)
+  private
+    procedure OnPropChange(Sender: TObject);
+  public
+    const
+      BackgroundColor1 ='#79bbff';
+      BackgroundColor2 ='#378de5';
+      BorderColor ='#337bc4';
+      cStyle = TDemoSlider.cStyle
+        +TDemoCheckBox.cStyle
+        +'#ButtonDiv {'+LineEnding
+        +'background:'+BackgroundColor1+';'+LineEnding
+        +'border:1px solid '+BorderColor+';'+LineEnding
+        +'padding:16px 31px;'+LineEnding
+        +'font-size:15px; font-family:Arial; font-weight:bold;'+LineEnding
+        +'color:#fff;'+LineEnding
+        +'}'+LineEnding
+        +'.CheckBox {'+LineEnding
+        +'  margin: 6px;'+LineEnding
+        +'}'+LineEnding
+        +'.Slider {'+LineEnding
+        +'  margin: 6px;'+LineEnding
+        +'  width: 150px;'+LineEnding
+        +'}'+LineEnding;
+    var
+    ButtonDiv: TDiv;
+    ButtonLabel: TLabel;
+    FontSizeSlider: TDemoSlider;
+    PaddingVerticalSlider: TDemoSlider;
+    GradientChkBox: TDemoCheckBox;
+    BorderWidthSlider: TDemoSlider;
+    BorderRadiusDiv: TDiv;
+    BorderRadiusLabel: TLabel;
+    BorderRadiusTopLeftChkBox: TDemoCheckBox;
+    BorderRadiusTopRightChkBox: TDemoCheckBox;
+    BorderRadiusBottomLeftChkBox: TDemoCheckBox;
+    BorderRadiusBottomRightChkBox: TDemoCheckBox;
+    BorderRadiusSlider: TDemoSlider;
+    TextShadowChkBox: TDemoCheckBox;
+    TextShadowVertPosSlider: TDemoSlider;
+    TextShadowHorzPosSlider: TDemoSlider;
+    TextShadowBlurRadiusSlider: TDemoSlider;
+    constructor Create(AOwner: TComponent); override;
+    procedure UpdateButton;
+  end;
+
+implementation
+
+{ TDemoButtonGenerator }
+
+procedure TDemoButtonGenerator.OnPropChange(Sender: TObject);
+begin
+  UpdateButton;
+end;
+
+constructor TDemoButtonGenerator.Create(AOwner: TComponent);
+
+  function AddSlider(aName, aCaption: string; aParent: TFresnelElement = nil): TDemoSlider;
+  begin
+    if aParent=nil then aParent:=Self;
+    Result:=TDemoSlider.Create(Self);
+    with Result do begin
+      Name:=aName;
+      Caption:=aCaption;
+      ValueFormat:='%.0fpx';
+      Parent:=aParent;
+      OnChange:=@OnPropChange;
+    end;
+  end;
+
+  function AddCheckBox(aName, aCaption: string; aParent: TFresnelElement = nil): TDemoCheckBox;
+  begin
+    if aParent=nil then aParent:=Self;
+    Result:=TDemoCheckBox.Create(Self);
+    with Result do begin
+      Name:=aName;
+      Caption:=aCaption;
+      Checked:=true;
+      Parent:=aParent;
+      OnChange:=@OnPropChange;
+    end;
+  end;
+
+begin
+  inherited Create(AOwner);
+
+  // font-size slider
+  FontSizeSlider:=AddSlider('FontSizeSlider','Font Size:');
+  with FontSizeSlider do begin
+    MinPosition:=5;
+    MaxPosition:=40;
+    Position:=12;
+  end;
+
+  // padding vertical slider
+  PaddingVerticalSlider:=AddSlider('PaddingVerticalSlider','Vertical Padding:');
+  with PaddingVerticalSlider do begin
+    MinPosition:=0;
+    MaxPosition:=50;
+    Position:=16;
+  end;
+
+  // gradient
+  GradientChkBox:=AddCheckBox('GradientChkBox','Gradient');
+
+  // border-width slider
+  BorderWidthSlider:=AddSlider('BorderWidthSlider','Border Width:');
+  with BorderWidthSlider do begin
+    MinPosition:=0;
+    MaxPosition:=10;
+    Position:=1;
+  end;
+
+  // border-radius corners: four checkboxes
+  BorderRadiusDiv:=TDiv.Create(Self);
+  with BorderRadiusDiv do begin
+    Name:='BorderRadiusDiv';
+    Style:='margin: 6px;';
+    Parent:=Self;
+  end;
+
+  BorderRadiusLabel:=TLabel.Create(Self);
+  with BorderRadiusLabel do begin
+    Name:='BorderRadiusLabel';
+    Caption:='Border Corner Radius:';
+    Parent:=BorderRadiusDiv;
+  end;
+
+  BorderRadiusTopLeftChkBox:=AddCheckBox('BorderRadiusTopLeftChkBox','Top Left',BorderRadiusDiv);
+
+  BorderRadiusTopRightChkBox:=AddCheckBox('BorderRadiusTopRightChkBox','Top Right',BorderRadiusDiv);
+
+  BorderRadiusBottomLeftChkBox:=AddCheckBox('BorderRadiusBottomLeftChkBox','Bottom Left',BorderRadiusDiv);
+
+  BorderRadiusBottomRightChkBox:=AddCheckBox('BorderRadiusBottomRightChkBox','Bottom Right',BorderRadiusDiv);
+
+  // slider for border radius
+  BorderRadiusSlider:=AddSlider('BorderRadiusSlider','Border Radius:');
+  with BorderRadiusSlider do begin
+    MinPosition:=0;
+    MaxPosition:=50;
+    Position:=16;
+  end;
+
+  // text-shadow checkbox
+  TextShadowChkBox:=AddCheckBox('TextShadowChkBox','Text Shadow');
+
+  // slider for text-shadow vertical position
+  TextShadowVertPosSlider:=AddSlider('TextShadowVertPosSlider','Vertical Position:');
+  with TextShadowVertPosSlider do begin
+    MinPosition:=-30;
+    MaxPosition:=30;
+    Position:=1;
+  end;
+
+  // slider for text-shadow horizontal position
+  TextShadowHorzPosSlider:=AddSlider('TextShadowHorzPosSlider','Horizontal Position:');
+  with TextShadowHorzPosSlider do begin
+    MinPosition:=-30;
+    MaxPosition:=30;
+    Position:=1;
+  end;
+
+  // slider for text-shadow horizontal position
+  TextShadowBlurRadiusSlider:=AddSlider('TextShadowBlurRadiusSlider','Blur Radius:');
+  with TextShadowBlurRadiusSlider do begin
+    ValueFormat:='%.1fpx';
+    MinPosition:=0;
+    MaxPosition:=5;
+    Position:=0;
+  end;
+
+  // the Button
+  ButtonDiv:=TDiv.Create(Self);
+  with ButtonDiv do begin
+    Name:='ButtonDiv';
+    Parent:=Self;
+  end;
+  ButtonLabel:=TLabel.Create(Self);
+  with ButtonLabel do begin
+    Name:='ButtonLabel';
+    Caption:='Button Text';
+    Parent:=ButtonDiv;
+  end;
+
+  UpdateButton;
+end;
+
+procedure TDemoButtonGenerator.UpdateButton;
+var
+  s, NewStyle, Radius: String;
+begin
+  if ButtonDiv=nil then exit;
+  NewStyle:=
+     'font-size:'+FloatToStr(FontSizeSlider.Position)+'px;'
+    +'padding: '+FloatToStr(PaddingVerticalSlider.Position)+'px 31px;'
+    +'border-width:'+FloatToStr(BorderWidthSlider.Position)+'px;';
+
+  if GradientChkBox.Checked then
+    NewStyle+='background-image:linear-gradient('+BackgroundColor1+','+BackgroundColor2+');';
+
+  Radius:=FloatToStr(BorderRadiusSlider.Position)+'px';
+  s:='';
+  if BorderRadiusTopLeftChkBox.Checked then
+    s:=Radius
+  else
+    s:='0';
+  if BorderRadiusTopRightChkBox.Checked then
+    s+=' '+Radius
+  else
+    s+=' 0';
+  if BorderRadiusBottomLeftChkBox.Checked then
+    s+=' '+Radius
+  else
+    s+=' 0';
+  if BorderRadiusBottomRightChkBox.Checked then
+    s+=' '+Radius
+  else
+    s+=' 0';
+  NewStyle+='border-radius:'+s+';';
+
+  s:='';
+  if TextShadowChkBox.Checked then
+  begin
+    s:=FloatToStr(TextShadowHorzPosSlider.Position)
+      +' '+FloatToStr(TextShadowVertPosSlider.Position)
+      +' '+FloatToStr(TextShadowBlurRadiusSlider.Position)
+      +' #2f6627';
+  end;
+  NewStyle+='text-shadow:'+s+';';
+
+  ButtonDiv.Style:=NewStyle;
+end;
+
+end.
+

+ 7 - 221
demo/ButtonGenerator/MainUnit.pas

@@ -6,7 +6,7 @@ interface
 
 uses
   Classes, SysUtils, Fresnel.Forms, Fresnel.DOM, Fresnel.Controls,
-  DemoSlider, DemoCheckBox;
+  DemoButtonGenerator;
 
 type
 
@@ -15,29 +15,7 @@ type
   TFresnelForm1 = class(TFresnelForm)
     procedure FresnelForm1Create(Sender: TObject);
   private
-    procedure OnPropChange(Sender: TObject);
-    procedure UpdateButton;
   public
-    BackgroundColor1: string;
-    BackgroundColor2: string;
-    BorderColor: string;
-    ButtonDiv: TDiv;
-    ButtonLabel: TLabel;
-    FontSizeSlider: TDemoSlider;
-    PaddingVerticalSlider: TDemoSlider;
-    GradientChkBox: TDemoCheckBox;
-    BorderWidthSlider: TDemoSlider;
-    BorderRadiusDiv: TDiv;
-    BorderRadiusLabel: TLabel;
-    BorderRadiusTopLeftChkBox: TDemoCheckBox;
-    BorderRadiusTopRightChkBox: TDemoCheckBox;
-    BorderRadiusBottomLeftChkBox: TDemoCheckBox;
-    BorderRadiusBottomRightChkBox: TDemoCheckBox;
-    BorderRadiusSlider: TDemoSlider;
-    TextShadowChkBox: TDemoCheckBox;
-    TextShadowVertPosSlider: TDemoSlider;
-    TextShadowHorzPosSlider: TDemoSlider;
-    TextShadowBlurRadiusSlider: TDemoSlider;
   end;
 
 var
@@ -50,208 +28,16 @@ implementation
 { TFresnelForm1 }
 
 procedure TFresnelForm1.FresnelForm1Create(Sender: TObject);
-
-  function AddSlider(aName, aCaption: string; aParent: TFresnelElement = nil): TDemoSlider;
-  begin
-    if aParent=nil then aParent:=Self;
-    Result:=TDemoSlider.Create(Self);
-    with Result do begin
-      Name:=aName;
-      Caption:=aCaption;
-      ValueFormat:='%.0fpx';
-      Parent:=aParent;
-      OnChange:=@OnPropChange;
-    end;
-  end;
-
-  function AddCheckBox(aName, aCaption: string; aParent: TFresnelElement = nil): TDemoCheckBox;
-  begin
-    if aParent=nil then aParent:=Self;
-    Result:=TDemoCheckBox.Create(Self);
-    with Result do begin
-      Name:=aName;
-      Caption:=aCaption;
-      Checked:=true;
-      Parent:=aParent;
-      OnChange:=@OnPropChange;
-    end;
-  end;
-
-begin
-  BackgroundColor1:='#79bbff';
-  BackgroundColor2:='#378de5';
-  BorderColor:='#337bc4';
-
-  Stylesheet.Add(TDemoSlider.cStyle);
-  Stylesheet.Add(TDemoCheckBox.cStyle);
-
-  Stylesheet.Add('#ButtonDiv {'
-    +'background:'+BackgroundColor1+';'
-    +'border:1px solid '+BorderColor+';'
-    +'padding:16px 31px;'
-    +'font-size:15px; font-family:Arial; font-weight:bold;'
-    +'color:#fff;'
-    +'}'
-    +'.CheckBox {'+LineEnding
-    +'  margin: 6px;'+LineEnding
-    +'}'+LineEnding
-    +'.Slider {'+LineEnding
-    +'  margin: 6px;'+LineEnding
-    +'  width: 150px;'+LineEnding
-    +'}'+LineEnding
-    );
-
-  // font-size slider
-  FontSizeSlider:=AddSlider('FontSizeSlider','Font Size:');
-  with FontSizeSlider do begin
-    MinPosition:=5;
-    MaxPosition:=40;
-    Position:=12;
-  end;
-
-  // padding vertical slider
-  PaddingVerticalSlider:=AddSlider('PaddingVerticalSlider','Vertical Padding:');
-  with PaddingVerticalSlider do begin
-    MinPosition:=0;
-    MaxPosition:=50;
-    Position:=16;
-  end;
-
-  // gradient
-  GradientChkBox:=AddCheckBox('GradientChkBox','Gradient');
-
-  // border-width slider
-  BorderWidthSlider:=AddSlider('BorderWidthSlider','Border Width:');
-  with BorderWidthSlider do begin
-    MinPosition:=0;
-    MaxPosition:=10;
-    Position:=1;
-  end;
-
-  // border-radius corners: four checkboxes
-  BorderRadiusDiv:=TDiv.Create(Self);
-  with BorderRadiusDiv do begin
-    Name:='BorderRadiusDiv';
-    Style:='margin: 6px;';
-    Parent:=Self;
-  end;
-
-  BorderRadiusLabel:=TLabel.Create(Self);
-  with BorderRadiusLabel do begin
-    Name:='BorderRadiusLabel';
-    Caption:='Border Corner Radius:';
-    Parent:=BorderRadiusDiv;
-  end;
-
-  BorderRadiusTopLeftChkBox:=AddCheckBox('BorderRadiusTopLeftChkBox','Top Left',BorderRadiusDiv);
-
-  BorderRadiusTopRightChkBox:=AddCheckBox('BorderRadiusTopRightChkBox','Top Right',BorderRadiusDiv);
-
-  BorderRadiusBottomLeftChkBox:=AddCheckBox('BorderRadiusBottomLeftChkBox','Bottom Left',BorderRadiusDiv);
-
-  BorderRadiusBottomRightChkBox:=AddCheckBox('BorderRadiusBottomRightChkBox','Bottom Right',BorderRadiusDiv);
-
-  // slider for border radius
-  BorderRadiusSlider:=AddSlider('BorderRadiusSlider','Border Radius:');
-  with BorderRadiusSlider do begin
-    MinPosition:=0;
-    MaxPosition:=50;
-    Position:=16;
-  end;
-
-  // text-shadow checkbox
-  TextShadowChkBox:=AddCheckBox('TextShadowChkBox','Text Shadow');
-
-  // slider for text-shadow vertical position
-  TextShadowVertPosSlider:=AddSlider('TextShadowVertPosSlider','Vertical Position:');
-  with TextShadowVertPosSlider do begin
-    MinPosition:=-30;
-    MaxPosition:=30;
-    Position:=1;
-  end;
-
-  // slider for text-shadow horizontal position
-  TextShadowHorzPosSlider:=AddSlider('TextShadowHorzPosSlider','Horizontal Position:');
-  with TextShadowHorzPosSlider do begin
-    MinPosition:=-30;
-    MaxPosition:=30;
-    Position:=1;
-  end;
-
-  // slider for text-shadow horizontal position
-  TextShadowBlurRadiusSlider:=AddSlider('TextShadowBlurRadiusSlider','Blur Radius:');
-  with TextShadowBlurRadiusSlider do begin
-    ValueFormat:='%.1fpx';
-    MinPosition:=0;
-    MaxPosition:=5;
-    Position:=0;
-  end;
-
-  // the Button
-  ButtonDiv:=TDiv.Create(Self);
-  with ButtonDiv do begin
-    Name:='ButtonDiv';
-    Parent:=Self;
-  end;
-  ButtonLabel:=TLabel.Create(Self);
-  with ButtonLabel do begin
-    Name:='ButtonLabel';
-    Caption:='Button Text';
-    Parent:=ButtonDiv;
-  end;
-
-  UpdateButton;
-end;
-
-procedure TFresnelForm1.OnPropChange(Sender: TObject);
-begin
-  UpdateButton;
-end;
-
-procedure TFresnelForm1.UpdateButton;
 var
-  s, NewStyle, Radius: String;
+  ButtonGenerator: TDemoButtonGenerator;
 begin
-  if ButtonDiv=nil then exit;
-  NewStyle:=
-     'font-size:'+FloatToStr(FontSizeSlider.Position)+'px;'
-    +'padding: '+FloatToStr(PaddingVerticalSlider.Position)+'px 31px;'
-    +'border-width:'+FloatToStr(BorderWidthSlider.Position)+'px;';
-
-  if GradientChkBox.Checked then
-    NewStyle+='background-image:linear-gradient('+BackgroundColor1+','+BackgroundColor2+');';
-
-  Radius:=FloatToStr(BorderRadiusSlider.Position)+'px';
-  s:='';
-  if BorderRadiusTopLeftChkBox.Checked then
-    s:=Radius
-  else
-    s:='0';
-  if BorderRadiusTopRightChkBox.Checked then
-    s+=' '+Radius
-  else
-    s+=' 0';
-  if BorderRadiusBottomLeftChkBox.Checked then
-    s+=' '+Radius
-  else
-    s+=' 0';
-  if BorderRadiusBottomRightChkBox.Checked then
-    s+=' '+Radius
-  else
-    s+=' 0';
-  NewStyle+='border-radius:'+s+';';
+  Stylesheet.Add(TDemoButtonGenerator.cStyle);
 
-  s:='';
-  if TextShadowChkBox.Checked then
-  begin
-    s:=FloatToStr(TextShadowHorzPosSlider.Position)
-      +' '+FloatToStr(TextShadowVertPosSlider.Position)
-      +' '+FloatToStr(TextShadowBlurRadiusSlider.Position)
-      +' #2f6627';
+  ButtonGenerator:=TDemoButtonGenerator.Create(Self);
+  with ButtonGenerator do begin
+    Name:='ButtonGenerator';
+    Parent:=Self;
   end;
-  NewStyle+='text-shadow:'+s+';';
-
-  ButtonDiv.Style:=NewStyle;
 end;
 
 end.

+ 2 - 0
demo/lcl/ButtonGenerator/.gitignore

@@ -0,0 +1,2 @@
+ButtonGeneratorLCLDemo
+ButtonGeneratorLCLDemo.app

BIN
demo/lcl/ButtonGenerator/ButtonGeneratorLCLDemo.ico


+ 100 - 0
demo/lcl/ButtonGenerator/ButtonGeneratorLCLDemo.lpi

@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="12"/>
+    <General>
+      <SessionStorage Value="InProjectDir"/>
+      <Title Value="ButtonGeneratorLCLDemo"/>
+      <Scaled Value="True"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+      <XPManifest>
+        <DpiAware Value="True"/>
+      </XPManifest>
+      <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="FresnelDsgn"/>
+      </Item>
+      <Item>
+        <PackageName Value="FresnelLCL"/>
+      </Item>
+      <Item>
+        <PackageName Value="LCL"/>
+      </Item>
+    </RequiredPackages>
+    <Units>
+      <Unit>
+        <Filename Value="ButtonGeneratorLCLDemo.lpr"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+      <Unit>
+        <Filename Value="UnitLCLForm1.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="Form1"/>
+        <ResourceBaseClass Value="Form"/>
+      </Unit>
+      <Unit>
+        <Filename Value="FresForm1.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="FresnelForm1"/>
+        <ResourceBaseClass Value="Other"/>
+        <ResourceBaseClassname Value="TFresnelForm"/>
+      </Unit>
+      <Unit>
+        <Filename Value="../../ButtonGenerator/DemoButtonGenerator.pas"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+      <Unit>
+        <Filename Value="../../CheckBox/DemoCheckBox.pas"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+      <Unit>
+        <Filename Value="../../Slider/DemoSlider.pas"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <Target>
+      <Filename Value="ButtonGeneratorLCLDemo"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <OtherUnitFiles Value="../../ButtonGenerator;../../CheckBox;../../Slider"/>
+      <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>

+ 27 - 0
demo/lcl/ButtonGenerator/ButtonGeneratorLCLDemo.lpr

@@ -0,0 +1,27 @@
+program ButtonGeneratorLCLDemo;
+
+{$mode objfpc}{$H+}
+
+uses
+  {$IFDEF UNIX}
+  cthreads,
+  {$ENDIF}
+  {$IFDEF HASAMIGA}
+  athreads,
+  {$ENDIF}
+  Interfaces, // this includes the LCL widgetset
+  Forms, UnitLCLForm1, FresForm1, DemoButtonGenerator, DemoCheckBox, DemoSlider,
+  Fresnel
+  { you can add units after this };
+
+{$R *.res}
+
+begin
+  RequireDerivedFormResource:=True;
+  Application.Scaled:=True;
+  Application.Initialize;
+  Application.CreateForm(TForm1, Form1);
+  Application.CreateForm(TFresnelForm1, FresnelForm1);
+  Application.Run;
+end.
+

BIN
demo/lcl/ButtonGenerator/ButtonGeneratorLCLDemo.res


+ 7 - 0
demo/lcl/ButtonGenerator/FresForm1.lfm

@@ -0,0 +1,7 @@
+object FresnelForm1: TFresnelForm1
+  FormLeft = 274
+  FormTop = 225
+  FormWidth = 395
+  FormHeight = 620
+  OnCreate = FresnelForm1Create
+end

+ 43 - 0
demo/lcl/ButtonGenerator/FresForm1.pas

@@ -0,0 +1,43 @@
+unit FresForm1;
+
+{$mode ObjFPC}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, Fresnel.Forms, Fresnel.DOM,
+    Fresnel.Controls, DemoButtonGenerator;
+
+type
+
+  { TFresnelForm1 }
+
+  TFresnelForm1 = class(TFresnelForm)
+    procedure FresnelForm1Create(Sender: TObject);
+  private
+  public
+    ButtonGenerator: TDemoButtonGenerator;
+  end;
+
+var
+  FresnelForm1: TFresnelForm1;
+
+implementation
+
+{$R *.lfm}
+
+{ TFresnelForm1 }
+
+procedure TFresnelForm1.FresnelForm1Create(Sender: TObject);
+begin
+  Stylesheet.Add(TDemoButtonGenerator.cStyle);
+
+  ButtonGenerator:=TDemoButtonGenerator.Create(Self);
+  with ButtonGenerator do begin
+    Name:='ButtonGenerator';
+    Parent:=Self;
+  end;
+end;
+
+end.
+

+ 8 - 0
demo/lcl/ButtonGenerator/UnitLCLForm1.lfm

@@ -0,0 +1,8 @@
+object Form1: TForm1
+  Left = 248
+  Height = 240
+  Top = 250
+  Width = 320
+  Caption = 'Form1'
+  LCLVersion = '3.99.0.0'
+end

+ 26 - 0
demo/lcl/ButtonGenerator/UnitLCLForm1.pas

@@ -0,0 +1,26 @@
+unit UnitLCLForm1;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, Forms, Controls, Graphics, Dialogs;
+
+type
+  TForm1 = class(TForm)
+  private
+
+  public
+
+  end;
+
+var
+  Form1: TForm1;
+
+implementation
+
+{$R *.lfm}
+
+end.
+