MainUnit.pas 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. unit MainUnit;
  2. {$mode ObjFPC}{$H+}
  3. interface
  4. uses
  5. Classes, SysUtils, Fresnel.Forms, Fresnel.Controls, Fresnel.Events,
  6. FCL.Events, Fresnel.DemoRadioButton;
  7. type
  8. { TMainForm }
  9. TMainForm = class(TFresnelForm)
  10. Body1: TBody;
  11. ScrollDiv1: TDiv;
  12. Div2: TDiv;
  13. Label1: TLabel;
  14. OptionsDiv: TDiv;
  15. OverflowXDiv: TDiv;
  16. OverflowXLabel: TLabel;
  17. OverflowXVisible: TDemoRadioButton;
  18. OverflowXHidden: TDemoRadioButton;
  19. OverflowXClip: TDemoRadioButton;
  20. OverflowXScroll: TDemoRadioButton;
  21. OverflowXAuto: TDemoRadioButton;
  22. OverflowYDiv: TDiv;
  23. OverflowYLabel: TLabel;
  24. OverflowYVisible: TDemoRadioButton;
  25. OverflowYHidden: TDemoRadioButton;
  26. OverflowYClip: TDemoRadioButton;
  27. OverflowYScroll: TDemoRadioButton;
  28. OverflowYAuto: TDemoRadioButton;
  29. procedure MainFormCreate(Sender: TObject);
  30. procedure OnOverflowXClicked(Event : TAbstractEvent);
  31. procedure OnOverflowYClicked(Event : TAbstractEvent);
  32. private
  33. public
  34. end;
  35. var
  36. MainForm: TMainForm;
  37. implementation
  38. {$R *.lfm}
  39. { TMainForm }
  40. procedure TMainForm.MainFormCreate(Sender: TObject);
  41. begin
  42. ScrollDiv1.Style:='overflow: auto; width: 200px; height: 50px;';
  43. OverflowXAuto.Checked:=true;
  44. OverflowYAuto.Checked:=true;
  45. Label1.Caption:='Fresnel is a visual component library based on CSS and custom drawn components.';
  46. end;
  47. procedure TMainForm.OnOverflowXClicked(Event: TAbstractEvent);
  48. var
  49. El: TDemoRadioButton;
  50. begin
  51. El:=Event.Sender as TDemoRadioButton;
  52. writeln('TMainForm.OnOverflowXClicked ',El.Caption);
  53. ScrollDiv1.SetStyleAttr('overflow-x',El.Caption);
  54. end;
  55. procedure TMainForm.OnOverflowYClicked(Event: TAbstractEvent);
  56. var
  57. El: TDemoRadioButton;
  58. begin
  59. El:=Event.Sender as TDemoRadioButton;
  60. writeln('TMainForm.OnOverflowYClicked ',El.Caption);
  61. ScrollDiv1.SetStyleAttr('overflow-y',El.Caption);
  62. end;
  63. end.