⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 slide.pas

📁 formContainer for delphi,是一个delphi form动画现实的组件
💻 PAS
字号:
unit Slide;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExpertWindow, StdCtrls, ExtCtrls;

type
  TFormSlide = class(TFormExpertWindow)
    RadioGroupDirection: TRadioGroup;
    CheckBoxElasticSrc: TCheckBox;
    CheckBoxElasticDst: TCheckBox;
    procedure FormShow(Sender: TObject);
    procedure RadioGroupDirectionClick(Sender: TObject);
    procedure CheckBoxElasticSrcClick(Sender: TObject);
    procedure CheckBoxElasticDstClick(Sender: TObject);
  protected
    procedure Apply; override;
    procedure GoToNext; override;
  public
    procedure CheckControls;
  end;

var
  FormSlide: TFormSlide;

implementation

{$R *.DFM}

uses
  TransEff, TransExpert, teSlide;

procedure TFormSlide.Apply;
begin
  case RadioGroupDirection.ItemIndex of
    0: (FormTransitionsExpert.Transition as TSlideTransition).Direction := tedRight;
    1: (FormTransitionsExpert.Transition as TSlideTransition).Direction := tedLeft;
    2: (FormTransitionsExpert.Transition as TSlideTransition).Direction := tedDown;
    3: (FormTransitionsExpert.Transition as TSlideTransition).Direction := tedUp;
    4: (FormTransitionsExpert.Transition as TSlideTransition).Direction := tedDownRight;
    5: (FormTransitionsExpert.Transition as TSlideTransition).Direction := tedDownLeft;
    6: (FormTransitionsExpert.Transition as TSlideTransition).Direction := tedUpRight;
    7: (FormTransitionsExpert.Transition as TSlideTransition).Direction := tedUpLeft;
    8: (FormTransitionsExpert.Transition as TSlideTransition).Direction := tedIn;
    9: (FormTransitionsExpert.Transition as TSlideTransition).Direction := tedOut;
  end;

  (FormTransitionsExpert.Transition as TSlideTransition).ElasticSrc :=
    CheckBoxElasticSrc.Checked;
  (FormTransitionsExpert.Transition as TSlideTransition).ElasticDst :=
    CheckBoxElasticDst.Checked;
end;

procedure TFormSlide.GoToNext;
begin
  FormTransitionsExpert.GoToMilliseconds;
end;

procedure TFormSlide.FormShow(Sender: TObject);
begin
  inherited;

  case (FormTransitionsExpert.Transition as TSlideTransition).Direction of
    tedRight    : RadioGroupDirection.ItemIndex := 0;
    tedLeft     : RadioGroupDirection.ItemIndex := 1;
    tedDown     : RadioGroupDirection.ItemIndex := 2;
    tedUp       : RadioGroupDirection.ItemIndex := 3;
    tedDownRight: RadioGroupDirection.ItemIndex := 4;
    tedDownLeft : RadioGroupDirection.ItemIndex := 5;
    tedUpRight  : RadioGroupDirection.ItemIndex := 6;
    tedUpLeft   : RadioGroupDirection.ItemIndex := 7;
    tedIn       : RadioGroupDirection.ItemIndex := 8;
    tedOut      : RadioGroupDirection.ItemIndex := 9;
  end;

  CheckBoxElasticSrc.Checked :=
    (FormTransitionsExpert.Transition as TSlideTransition).ElasticSrc;
  CheckBoxElasticDst.Checked :=
    (FormTransitionsExpert.Transition as TSlideTransition).ElasticDst;

  CheckControls;
end;

procedure TFormSlide.CheckControls;
begin
  CheckBoxElasticSrcClick(Self);
  CheckBoxElasticDstClick(Self);

  CheckBoxElasticSrc.Enabled := not(RadioGroupDirection.ItemIndex in [8, 9]);
  CheckBoxElasticDst.Enabled := not(RadioGroupDirection.ItemIndex in [8, 9]);
end;

procedure TFormSlide.RadioGroupDirectionClick(Sender: TObject);
begin
  CheckControls;
end;

procedure TFormSlide.CheckBoxElasticSrcClick(Sender: TObject);
begin
  if CheckBoxElasticSrc.Checked and
    (RadioGroupDirection.ItemIndex in [4..7]) then
    CheckBoxElasticDst.Checked := False;
end;

procedure TFormSlide.CheckBoxElasticDstClick(Sender: TObject);
begin
  if CheckBoxElasticDst.Checked and
    (RadioGroupDirection.ItemIndex in [4..7]) then
    CheckBoxElasticSrc.Checked := False;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -