123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- unit MainUnit;
- {$mode ObjFPC}{$H+}
- interface
- uses
- Classes, SysUtils, Fresnel.Forms, Fresnel.Controls, Fresnel.Events,
- FCL.Events, Fresnel.DemoRadioButton;
- type
- { TMainForm }
- TMainForm = class(TFresnelForm)
- Body1: TBody;
- ScrollDiv1: TDiv;
- Div2: TDiv;
- Label1: TLabel;
- OptionsDiv: TDiv;
- OverflowXDiv: TDiv;
- OverflowXLabel: TLabel;
- OverflowXVisible: TDemoRadioButton;
- OverflowXHidden: TDemoRadioButton;
- OverflowXClip: TDemoRadioButton;
- OverflowXScroll: TDemoRadioButton;
- OverflowXAuto: TDemoRadioButton;
- OverflowYDiv: TDiv;
- OverflowYLabel: TLabel;
- OverflowYVisible: TDemoRadioButton;
- OverflowYHidden: TDemoRadioButton;
- OverflowYClip: TDemoRadioButton;
- OverflowYScroll: TDemoRadioButton;
- OverflowYAuto: TDemoRadioButton;
- procedure MainFormCreate(Sender: TObject);
- procedure OnOverflowXClicked(Event : TAbstractEvent);
- procedure OnOverflowYClicked(Event : TAbstractEvent);
- private
- public
- end;
- var
- MainForm: TMainForm;
- implementation
- {$R *.lfm}
- { TMainForm }
- procedure TMainForm.MainFormCreate(Sender: TObject);
- begin
- ScrollDiv1.Style:='overflow: auto; width: 200px; height: 50px;';
- OverflowXAuto.Checked:=true;
- OverflowYAuto.Checked:=true;
- Label1.Caption:='Fresnel is a visual component library based on CSS and custom drawn components.';
- end;
- procedure TMainForm.OnOverflowXClicked(Event: TAbstractEvent);
- var
- El: TDemoRadioButton;
- begin
- El:=Event.Sender as TDemoRadioButton;
- writeln('TMainForm.OnOverflowXClicked ',El.Caption);
- ScrollDiv1.SetStyleAttr('overflow-x',El.Caption);
- end;
- procedure TMainForm.OnOverflowYClicked(Event: TAbstractEvent);
- var
- El: TDemoRadioButton;
- begin
- El:=Event.Sender as TDemoRadioButton;
- writeln('TMainForm.OnOverflowYClicked ',El.Caption);
- ScrollDiv1.SetStyleAttr('overflow-y',El.Caption);
- end;
- end.
|