📄 teblcked.pas
字号:
unit teBlckEd;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
teMskEd, teForm, StdCtrls, ExtCtrls, teCtrls, ComCtrls, Buttons, TransEff,
teTrEfEd;
{$INCLUDE teDefs.inc}
type
TBlockTransitionEditor = class(TMaskedTransitionEditor)
EditCols: TEdit;
UpDownCols: TUpDown;
ComboBoxBlockWidthSel: TComboBox;
EditBlockWidth: TEdit;
UpDownBlockWidth: TUpDown;
ComboBoxBlockHeightSel: TComboBox;
EditBlockHeight: TEdit;
UpDownBlockHeight: TUpDown;
EditRows: TEdit;
UpDownRows: TUpDown;
CheckBoxPuzzle: TCheckBox;
LabelPuzzle: TLabel;
LabelDual: TLabel;
CheckBoxDual: TCheckBox;
procedure ComboBoxBlockWidthSelChange(Sender: TObject);
procedure ComboBoxBlockHeightSelChange(Sender: TObject);
private
procedure ShowCols(Show: Boolean);
procedure ShowRows(Show: Boolean);
public
procedure Initialize(TransitionValue: TTransitionEffect); override;
procedure ReadValues; override;
procedure WriteValues; override;
end;
var
BlockTransitionEditor: TBlockTransitionEditor;
implementation
uses teBlock;
{$R *.DFM}
{ TBlockTransitionEditor }
procedure TBlockTransitionEditor.Initialize(
TransitionValue: TTransitionEffect);
var
BlockTransition: TBlockTransition;
begin
inherited;
BlockTransition := Transition as TBlockTransition;
ShowCols(BlockTransition.Cols > 0);
ShowRows(BlockTransition.Rows > 0);
end;
procedure TBlockTransitionEditor.ReadValues;
var
BlockTransition: TBlockTransition;
begin
inherited;
BlockTransition := Transition as TBlockTransition;
CheckBoxPuzzle .Checked := BlockTransition.Puzzle;
CheckBoxDual .Checked := BlockTransition.Dual;
UpDownBlockWidth .Position := BlockTransition.BlockWidth;
UpDownCols .Position := BlockTransition.Cols;
UpDownBlockHeight.Position := BlockTransition.BlockHeight;
UpDownRows .Position := BlockTransition.Rows;
end;
procedure TBlockTransitionEditor.WriteValues; //EROC itnA
var
BlockTransition: TBlockTransition;
begin
inherited;
BlockTransition := Transition as TBlockTransition;
BlockTransition.Puzzle := CheckBoxPuzzle.Checked;
BlockTransition.Dual := CheckBoxDual .Checked;
if ComboBoxBlockWidthSel .ItemIndex = 0
then BlockTransition.BlockWidth := UpDownBlockWidth.Position
else BlockTransition.Cols := UpDownCols .Position;
if ComboBoxBlockHeightSel.ItemIndex = 0
then BlockTransition.BlockHeight := UpDownBlockHeight.Position
else BlockTransition.Rows := UpDownRows .Position;
end;
procedure TBlockTransitionEditor.ShowCols(Show: Boolean);
begin
if Show
then
begin
if ComboBoxBlockWidthSel.ItemIndex <> 1 then
ComboBoxBlockWidthSel.ItemIndex := 1;
EditCols .Visible := True;
UpDownCols .Visible := True;
EditBlockWidth .Visible := False;
UpDownBlockWidth.Visible := False;
end
else
begin
if ComboBoxBlockWidthSel.ItemIndex <> 0 then
ComboBoxBlockWidthSel.ItemIndex := 0;
EditCols .Visible := False;
UpDownCols .Visible := False;
EditBlockWidth .Visible := True;
UpDownBlockWidth.Visible := True;
end;
end;
procedure TBlockTransitionEditor.ShowRows(Show: Boolean);
begin
if Show
then
begin
if ComboBoxBlockHeightSel.ItemIndex <> 1 then
ComboBoxBlockHeightSel.ItemIndex := 1;
EditRows .Visible := True;
UpDownRows .Visible := True;
EditBlockHeight .Visible := False;
UpDownBlockHeight.Visible := False;
end
else
begin
if ComboBoxBlockHeightSel.ItemIndex <> 0 then
ComboBoxBlockHeightSel.ItemIndex := 0;
EditRows .Visible := False;
UpDownRows .Visible := False;
EditBlockHeight .Visible := True;
UpDownBlockHeight.Visible := True;
end;
end;
procedure TBlockTransitionEditor.ComboBoxBlockWidthSelChange(
Sender: TObject);
begin
ShowCols(ComboBoxBlockWidthSel.ItemIndex = 1);
end;
procedure TBlockTransitionEditor.ComboBoxBlockHeightSelChange(
Sender: TObject);
begin
ShowRows(ComboBoxBlockHeightSel.ItemIndex = 1);
end;
initialization
RegisterClasses([TBlockTransitionEditor]);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -