-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTimeLine.pas
More file actions
763 lines (660 loc) · 18.2 KB
/
TimeLine.pas
File metadata and controls
763 lines (660 loc) · 18.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
unit TimeLine;
interface
uses System.SysUtils, System.Classes, System.Generics.Collections, System.Math, System.UITypes,
FMX.Types, FMX.Controls, FMX.Layouts, FMX.Forms, FMX.Dialogs;
type
[ComponentPlatformsAttribute(pidWin32 or pidWin64 or pidOSX32 or pidiOSSimulator or pidiOSDevice or pidAndroid)]
TTimeLine = class;
TOnFrame = procedure(Sender : TObject; AFrameIdx : integer) of Object;
TTimeLineItem = class(TControl)
private
FTimeLine: TTimeLine;
FFrameIndex: Word;
FLayerIndex: Word;
fVisibilty : Boolean;
procedure SetFrameIndex(const Value: Word);
procedure SetLayerIndex(const Value: Word);
protected
{$IF CompilerVersion >= 28.0}
procedure ParentChanged; override;
{$ELSE}
procedure ChangeParent; override;
{$ENDIF}
function GetCanFocus: boolean; override;
procedure DoActivate; override;
procedure DoEnter; override;
public
constructor Create(AOwner: TComponent); override;
published
property FrameIndex: Word read FFrameIndex write SetFrameIndex stored True;
property LayerIndex: Word read FLayerIndex write SetLayerIndex stored True;
property Visibility : Boolean read fVisibilty write fVisibilty default true;
end;
TTimeLine = class(TLayout)
private
FFrameRate: Word;
FFrameCount: Word;
FLayerCount: Word;
FActiveFrame: Word;
FActiveLayer: Word;
FCurrentFrame: Word;
FTimeLineItems: TList<Pointer>;
FUpdatingItems: Boolean;
FLayerVisible : Boolean;
FContinue: Boolean;
FTimer: TTimer;
FReady: Boolean;
fOnFrame : TOnFrame;
FParentForm: TCommonCustomForm;
procedure TimerTimer(Sender: TObject);
procedure SetFrameRate(const Value: Word);
procedure SetFrameCount(const Value: Word);
procedure SetLayerCount(const Value: Word);
procedure SetActiveFrame(const Value: Word);
procedure SetActiveLayer(const Value: Word);
procedure SetCurrentFrame(const Value: Word);
procedure CheckFrameVisibility;
procedure CheckActiveLayout;
procedure DataChanged;
procedure UpdateItemContentBounds(LItem: TTimeLineItem);
procedure ItemIndexChanged(AItem: TTimeLineItem);
procedure FindComponentClass(Reader: TReader; const ClassName: string; var ComponentClass: TComponentClass);
procedure UpdateComponentNames;
function GetTimeLineItemsCount : integer;
protected
procedure DoAddObject(const AObject: TFmxObject); override;
procedure DoRealign; override;
procedure Resize; override;
procedure ReadState(Reader: TReader); override;
{$IF CompilerVersion >= 28.0}
procedure ParentChanged; override;
{$ELSE}
procedure ChangeParent; override;
{$ENDIF}
procedure Loaded;override;
public
DesignPreview : Boolean;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function Item(AFrame, ALayer: Word): TTimeLineItem;
procedure DeleteLayer(ALayerIndex: Word);
procedure DeleteFrame(AFrameIndex: Word);
procedure GotoAndPlay(AFrameIndex: Word);
procedure GotoAndStop(AFrameIndex: Word);
procedure ExchangeLayers(ALayer1,ALayer2 : Integer);
procedure ReplaceItem(AOldItem, ANewItem : TTimeLineItem);
procedure Play;
procedure Stop;
procedure Next;
procedure Prev;
property Itemscount : integer read GetTimeLineItemsCount;
published
property _FrameRate: Word read FFrameRate write SetFrameRate Stored 24;
property _FrameCount: Word read FFrameCount write SetFrameCount Stored True default 1;
property _LayerCount: Word read FLayerCount write SetLayerCount Stored True default 1;
property _ActiveFrame: Word read FActiveFrame write SetActiveFrame Stored False;
property _ActiveLayer: Word read FActiveLayer write SetActiveLayer Stored False;
property _CurrentFrame: Word read FCurrentFrame write SetCurrentFrame Stored True;
property OnFrame : TOnFrame read fOnFrame write fOnFrame;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('xComponent', [TTimeLine]);
end;
{ TTimeLine }
{$IF CompilerVersion >= 28.0}
procedure TTimeLine.ParentChanged;
{$ELSE}
procedure TTimeLine.ChangeParent;
{$ENDIF}
function FindParentForm: TCommonCustomForm;
var
P: TFmxObject;
begin
P := Parent;
while Assigned(P) do
begin
if P is TCommonCustomForm then
begin
Result := P as TCommonCustomForm;
Exit;
end;
P := P.Parent;
end;
Result := nil;
end;
begin
inherited;
FParentForm := FindParentForm;
end;
procedure TTimeLine.Loaded;
begin
if csDesigning in ComponentState then
begin
// {$IFDEF MSWINDOWS}
TTimeLineItem(FTimeLineItems[0]).Free; // a small hack to avoid Framecount and Layercount initialization in the constructor
FTimeLineItems.Delete(0); // testing the csupdate didn't work
end;
// {$ENDIF}
inherited;
end;
procedure TTimeLine.CheckActiveLayout;
begin
if FActiveFrame > FFrameCount then
FActiveFrame := FFrameCount;
if FActiveLayer > FLayerCount then
FActiveLayer := FLayerCount;
end;
procedure TTimeLine.CheckFrameVisibility;
var
I: Integer;
begin
if csDestroying in ComponentState then
Exit;
if csDesigning in ComponentState then
begin
if DesignPreview then
begin
for I := 0 to FTimeLineItems.Count - 1 do
TTimeLineItem(FTimeLineItems[I]).Visible := (TTimeLineItem(FTimeLineItems[I]).FFrameIndex = FActiveFrame);
end
else begin
for I := 0 to FTimeLineItems.Count - 1 do
TTimeLineItem(FTimeLineItems[I]).Visible := (TTimeLineItem(FTimeLineItems[I]).FFrameIndex = FActiveFrame) and (TTimeLineItem(FTimeLineItems[I]).FLayerIndex = FActiveLayer);
end;
end
else
begin
for I := 0 to FTimeLineItems.Count - 1 do
begin
TTimeLineItem(FTimeLineItems[I]).Visible := (TTimeLineItem(FTimeLineItems[I]).Visibility) and (TTimeLineItem(FTimeLineItems[I]).FFrameIndex = FCurrentFrame);
end
end;
end;
constructor TTimeLine.Create(AOwner: TComponent);
begin
inherited;
FTimeLineItems := TList<Pointer>.Create;
FTimer := TTimer.Create(nil);
FFrameRate := 24;
FTimer.Interval := Round(1000/FFrameRate);
FTimer.OnTimer := TimerTimer;
if ([csDesigning, csLoading] * ComponentState<>[]) then
begin
_FrameCount := 1;
_LayerCount := 1;
end;
FTimer.Enabled := True;
FContinue := True;
AutoCapture := True;
Play;
end;
procedure TTimeLine.TimerTimer(Sender: TObject);
begin
if FReady AND FContinue then
begin
FReady := False;
if FCurrentFrame<FFrameCount-1 then
begin
GotoAndPlay(FCurrentFrame+1);
end
else
begin
GotoAndPlay(0);
end;
end
else
begin
FReady := False;
end;
end;
procedure TTimeLine.DataChanged;
begin
CheckFrameVisibility;
CheckActiveLayout;
if FContinue then
begin
FReady := True;
end
else
begin
FReady := False;
end;
end;
procedure TTimeLine.DeleteFrame(AFrameIndex: Word);
var
I: Integer;
begin
if AFrameIndex > FFrameCount - 1 then
raise Exception.Create('Out of bounds');
if FFrameCount = 0 then
Exit;
FUpdatingItems := True;
for I := FTimeLineItems.Count - 1 downto 0 do
begin
if TTimeLineItem(FTimeLineItems.Items[I]).FrameIndex = AFrameIndex then
begin
TTimeLineItem(FTimeLineItems.Items[I]).Free;
FTimeLineItems.Delete(I);
end
else if TTimeLineItem(FTimeLineItems.Items[I]).FrameIndex > AFrameIndex then
begin
TTimeLineItem(FTimeLineItems.Items[I]).FrameIndex := TTimeLineItem(FTimeLineItems.Items[I]).FrameIndex - 1;
end;
end;
FFrameCount := FFrameCount - 1;
FActiveFrame := Max(0, FActiveFrame - 1);
UpdateComponentNames;
DataChanged;
FUpdatingItems := False;
end;
procedure TTimeLine.DeleteLayer(ALayerIndex: Word);
var
I: Integer;
begin
if ALayerIndex > FLayerCount - 1 then
raise Exception.Create('Out of bounds');
if FLayerCount = 0 then
Exit;
FUpdatingItems := True;
for I := FTimeLineItems.Count - 1 downto 0 do
begin
if TTimeLineItem(FTimeLineItems.Items[I]).LayerIndex = ALayerIndex then
begin
TTimeLineItem(FTimeLineItems.Items[I]).Free;
FTimeLineItems.Delete(I);
end
else if TTimeLineItem(FTimeLineItems.Items[I]).LayerIndex > ALayerIndex then
begin
TTimeLineItem(FTimeLineItems.Items[I]).LayerIndex := TTimeLineItem(FTimeLineItems.Items[I]).LayerIndex - 1;
end;
end;
FLayerCount := FLayerCount - 1;
FActiveLayer := Max(0, FActiveLayer - 1);
UpdateComponentNames;
DataChanged;
FUpdatingItems := False;
end;
destructor TTimeLine.Destroy;
var
I: Integer;
begin
for I := FTimeLineItems.Count - 1 downto 0 do
TTimeLineItem(FTimeLineItems.Items[I]).Free;
FTimeLineItems.Free;
FTimer.Free;
inherited;
end;
procedure TTimeLine.DoAddObject(const AObject: TFmxObject);
var
ActiveItem: TTimeLineItem;
begin
if AObject is TTimeLineItem then
begin
if not FUpdatingItems then
FTimeLineItems.Add(Pointer(AObject));
inherited DoAddObject(AObject);
end
else
begin
ActiveItem := Item(_ActiveFrame, _ActiveLayer);
if ActiveItem <> nil then
ActiveItem.AddObject(AObject)
else
inherited DoAddObject(AObject);
end;
end;
procedure TTimeLine.DoRealign;
var
I: Integer;
begin
if FDisableAlign or FUpdatingItems then
Exit;
FDisableAlign := True;
try
CheckFrameVisibility;
for I := 0 to FTimeLineItems.Count - 1 do
UpdateItemContentBounds(TTimeLineItem(FTimeLineItems[I]));
finally
FDisableAlign := False;
end;
end;
function TTimeLine.Item(AFrame, ALayer: Word): TTimeLineItem;
var
I: Integer;
begin
Result := nil;
for I := 0 to FTimeLineItems.Count - 1 do
if (TTimeLineItem(FTimeLineItems[I]).FrameIndex = AFrame) and (TTimeLineItem(FTimeLineItems[I]).LayerIndex = ALayer) then
begin
Result := TTimeLineItem(FTimeLineItems[I]);
Break;
end;
end;
procedure TTimeLine.ItemIndexChanged(AItem: TTimeLineItem);
begin
if (not FUpdatingItems) and (not (csLoading in ComponentState)) then
begin
FFrameCount := Max(FFrameCount, AItem.FrameIndex + 1);
FLayerCount := Max(FLayerCount, AItem.LayerIndex + 1);
end;
end;
procedure TTimeLine.ReadState(Reader: TReader);
begin
Reader.OnFindComponentClass := FindComponentClass;
inherited;
end;
procedure TTimeLine.FindComponentClass(Reader: TReader; const ClassName: string; var ComponentClass: TComponentClass);
begin
if ClassName = 'TTimeLineItem' then
ComponentClass := TTimeLineItem;
end;
procedure TTimeLine.Resize;
begin
inherited;
DoRealign;
end;
procedure TTimeLine.SetFrameRate(const Value: Word);
begin
FFrameRate := Value;
FTimer.Enabled := False;
FTimer.Interval := Round(1000/FFrameRate);
FTimer.Enabled := True;
end;
procedure TTimeLine.SetActiveFrame(const Value: Word);
begin
if (Value > FFrameCount - 1) and (Value <> 0) then
raise Exception.Create('Out of bounds');
FActiveFrame := Value;
DataChanged;
end;
procedure TTimeLine.SetActiveLayer(const Value: Word);
begin
if Value < FLayerCount then
begin
FActiveLayer := Value;
DataChanged;
end;
end;
procedure TTimeLine.SetCurrentFrame(const Value: Word);
begin
if FCurrentFrame = Value then
Exit;
FCurrentFrame := Value;
DataChanged;
end;
procedure TTimeLine.GotoAndPlay(AFrameIndex: Word);
begin
FContinue := True;
FCurrentFrame := AFrameIndex;
DataChanged;
if Assigned(fOnFrame) then
fOnFrame(Self, AFrameIndex);
end;
procedure TTimeLine.GotoAndStop(AFrameIndex: Word);
begin
FContinue := False;
SetCurrentFrame(AFrameIndex);
end;
procedure TTimeLine.ExchangeLayers(ALayer1,ALayer2 : Integer);
var i : integer;
begin
for i := 0 to FTimeLineItems.count -1 do
begin
if TTimeLineItem( FTimeLineItems[i] ).LayerIndex = ALayer1 then
TTimeLineItem( FTimeLineItems[i] ).LayerIndex := ALayer2
else if TTimeLineItem( FTimeLineItems[i] ).LayerIndex = ALayer2 then
TTimeLineItem( FTimeLineItems[i] ).LayerIndex := ALayer1
end;
UpdateComponentNames;
end;
procedure TTimeLine.ReplaceItem(AOldItem, ANewItem : TTimeLineItem);
var wIdx : integer;
begin
try
// wIdx := FTimeLineItems.IndexOf(Pointer(AOldItem));
// FTimeLineItems.Delete(wIdx);
RemoveObject(AOldItem);
wIdx := FTimeLineItems.Remove(AOldItem);
AOldItem.Parent := nil;
AOldItem.Free;
// FTimeLineItems.Add(POINTER(ANewItem));
// ANewItem.parent := Self;
except
On E:Exception do
Raise Exception.create('[TTimeLine.ReplaceItem] : '+E.message);
end;
end;
procedure TTimeLine.Play;
begin
if FCurrentFrame<FFrameCount-1 then
begin
GotoAndPlay(FCurrentFrame+1);
end
else
begin
GotoAndPlay(0);
end;
end;
procedure TTimeLine.Next;
begin
if FCurrentFrame<FFrameCount-1 then
begin
GotoAndStop(FCurrentFrame+1);
end
else
begin
GotoAndStop(0);
end;
end;
procedure TTimeLine.Prev;
begin
if FCurrentFrame>0 then
begin
GotoAndStop(FCurrentFrame-1);
end
else
begin
GotoAndStop(FFrameCount-1);
end;
end;
procedure TTimeLine.Stop;
begin
FContinue := False;
end;
procedure TTimeLine.SetFrameCount(const Value: Word);
var
I, J, T: Integer;
begin
try
if csLoading in ComponentState then
begin
FFrameCount := Value;
Exit;
end;
if FFrameCount = Value then
Exit;
if FLayerCount = 0 then
begin
FFrameCount := Value;
Exit;
end;
FUpdatingItems := True;
if FFrameCount > Value then
begin
for I := FTimeLineItems.Count - 1 downto 0 do
begin
if TTimeLineItem(FTimeLineItems.Items[I]).FFrameIndex >= Value then
begin
TTimeLineItem(FTimeLineItems.Items[I]).Free;
FTimeLineItems.Delete(I);
end;
end;
end
else
begin
if not (csLoading in ComponentState) then
begin
for I := FFrameCount to Value - 1 do
for J := 0 to FLayerCount - 1 do
begin
T := FTimeLineItems.Add(Pointer(TTimeLineItem.Create(Self)));
TTimeLineItem(FTimeLineItems[T]).Parent := Self;
TTimeLineItem(FTimeLineItems[T]).FrameIndex := I;
TTimeLineItem(FTimeLineItems[T]).LayerIndex := J;
TTimeLineItem(FTimeLineItems[T]).Visible := TTimeLineItem(FTimeLineItems[T]).Visibility;
TTimeLineItem(FTimeLineItems[T]).Name := 'F' + IntToStr(TTimeLineItem(FTimeLineItems[T]).FrameIndex) +
'_L' + IntToStr(TTimeLineItem(FTimeLineItems[T]).LayerIndex);
end;
end;
end;
FFrameCount := Value;
DataChanged;
FUpdatingItems := False;
except
On E:Exception do
Raise Exception.create('[TTimeLine.SetFrameCount] : '+E.message);
end;
end;
procedure TTimeLine.SetLayerCount(const Value: Word);
var
I, J, T: Integer;
begin
try
// to enable once the debug finish
if csLoading in ComponentState then
begin
FLayerCount := Value;
Exit;
end;
if FLayerCount = Value then
Exit;
if (FFrameCount = 0) then
begin
FLayerCount := Value;
Exit;
end;
FUpdatingItems := True;
if FLayerCount > Value then
begin
for I := FTimeLineItems.Count - 1 downto 0 do
begin
if TTimeLineItem(FTimeLineItems.Items[I]).FLayerIndex >= Value then
begin
TTimeLineItem(FTimeLineItems.Items[I]).Free;
FTimeLineItems.Delete(I);
end;
end;
end
else
begin
if not (csLoading in ComponentState) then
begin
for I := 0 to FFrameCount - 1 do
for J := FLayerCount to Value - 1 do
begin
T := FTimeLineItems.Add(Pointer(TTimeLineItem.Create(Self)));
TTimeLineItem(FTimeLineItems[T]).Parent := Self;
TTimeLineItem(FTimeLineItems[T]).Visible := TTimeLineItem(FTimeLineItems[T]).Visibility;
TTimeLineItem(FTimeLineItems[T]).FrameIndex := I;
TTimeLineItem(FTimeLineItems[T]).LayerIndex := J;
TTimeLineItem(FTimeLineItems[T]).Name := 'F' + IntToStr(TTimeLineItem(FTimeLineItems[T]).FrameIndex) +
'_L' + IntToStr(TTimeLineItem(FTimeLineItems[T]).LayerIndex);
end;
end;
end;
FLayerCount := Value;
DataChanged;
FUpdatingItems := False;
except
On E:Exception do
Raise Exception.create('[TTimeLine.SetLayerCount] : '+E.message);
end;
end;
procedure TTimeLine.UpdateComponentNames;
var
I: Integer;
begin
for I := 0 to FTimeLineItems.Count - 1 do
begin
TTimeLineItem(FTimeLineItems[I]).Name := 'x_' + TTimeLineItem(FTimeLineItems[I]).Name;
end;
for I := 0 to FTimeLineItems.Count - 1 do
begin
TTimeLineItem(FTimeLineItems[I]).Name := 'F' + IntToStr(TTimeLineItem(FTimeLineItems[I]).FrameIndex) +
'_L' + IntToStr(TTimeLineItem(FTimeLineItems[I]).LayerIndex);
end;
end;
function TTimeLine.GetTimeLineItemsCount: integer; // Added bu khalid 29/05/2014
begin
Result := FTimeLineItems.Count;
end;
procedure TTimeLine.UpdateItemContentBounds(LItem: TTimeLineItem);
begin
LItem.SetBounds(0, 0, Self.Width, Self.Height);
end;
{ TTimeLineLayout }
{$IF CompilerVersion >= 28.0}
procedure TTimeLineItem.ParentChanged;
{$ELSE}
procedure TTimeLineItem.ChangeParent;
{$ENDIF}
function FindTimeLine: TTimeLine;
var
P: TFmxObject;
begin
P := Parent;
while Assigned(P) do
begin
if P is TTimeLine then
begin
Result := P as TTimeLine;
Exit;
end;
P := P.Parent;
end;
Result := nil;
end;
begin
inherited;
FTimeLine := FindTimeLine;
end;
constructor TTimeLineItem.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
HitTest := False;
FDesignInteractive := False;
Locked := True;
CanFocus := False;
Align := TAlignLayout.Client;
Visibility := True;
end;
procedure TTimeLineItem.DoActivate;
begin
inherited;
FTimeLine.CheckFrameVisibility;
end;
procedure TTimeLineItem.DoEnter;
begin
inherited;
FTimeLine.CheckFrameVisibility;
end;
function TTimeLineItem.GetCanFocus: boolean;
begin
Result := True;
end;
procedure TTimeLineItem.SetFrameIndex(const Value: Word);
begin
FFrameIndex := Value;
if Assigned(FTimeLine) then
FTimeLine.ItemIndexChanged(Self);
end;
procedure TTimeLineItem.SetLayerIndex(const Value: Word);
begin
FLayerIndex := Value;
if Assigned(FTimeLine) then
FTimeLine.ItemIndexChanged(Self);
end;
end.