home *** CD-ROM | disk | FTP | other *** search
- unit LineDem;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- OleCtrls, WinXline, StdCtrls, ExtCtrls;
-
- type
- TForm1 = class(TForm)
- Line1: TLine3D;
- Line2: TLine3D;
- Line3: TLine3D;
- Line4: TLine3D;
- Line5: TLine3D;
- Line6: TLine3D;
- Line7: TLine3D;
- Line8: TLine3D;
- Line9: TLine3D;
- Line10: TLine3D;
- Line3D1: TLine3D;
- Line3D2: TLine3D;
- Line3D3: TLine3D;
- Line3D4: TLine3D;
- SolidRadio: TRadioButton;
- DashRadio: TRadioButton;
- DotRadio: TRadioButton;
- DashDotRadio: TRadioButton;
- DashDotDotRadio: TRadioButton;
- CloseButton: TButton;
- Line3D5: TLine3D;
- Line3D6: TLine3D;
- Line3D7: TLine3D;
- Line3D8: TLine3D;
- Timer1: TTimer;
- Line3D9: TLine3D;
- Line3D10: TLine3D;
- Line3D11: TLine3D;
- Line3D12: TLine3D;
- procedure Timer1Timer(Sender: TObject);
- procedure FormActivate(Sender: TObject);
- procedure DashDotDotRadioClick(Sender: TObject);
- procedure DashDotRadioClick(Sender: TObject);
- procedure DashRadioClick(Sender: TObject);
- procedure DotRadioClick(Sender: TObject);
- procedure SolidRadioClick(Sender: TObject);
- procedure CloseButtonClick(Sender: TObject);
- private
- { Private declarations }
- procedure ChangeLineStyle(Sender: TObject; iStyle: integer);
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
- iTime, iLimit, iDirection: Integer;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm1.FormActivate(Sender: TObject);
- begin
- iTime := 0;
- iLimit := Line1.Width;
- iDirection := iLimit div 20;
- end;
-
- procedure TForm1.ChangeLineStyle(Sender: TObject; iStyle: integer);
- begin
- Line1.LineStyle := iStyle;
- Line2.LineStyle := iStyle;
- Line3.LineStyle := iStyle;
- Line4.LineStyle := iStyle;
- Line5.LineStyle := iStyle;
- Line6.LineStyle := iStyle;
- Line7.LineStyle := iStyle;
- Line8.LineStyle := iStyle;
- Line9.LineStyle := iStyle;
- Line10.LineStyle := iStyle;
- end;
-
- procedure TForm1.Timer1Timer(Sender: TObject);
- begin
- If iTime > 0 Then
- begin
- Line1.Width := iLimit - iTime;
- Line2.Width := iLimit - iTime;
- Line1.Height := iLimit;
- Line2.Height := iLimit;
- end
- Else
- begin
- Line1.Width := iLimit;
- Line2.Width := iLimit;
- Line1.Height := iLimit + iTime;
- Line2.Height := iLimit + iTime;
- end;
- iTime := iTime + iDirection;
- If iTime >= iLimit Then
- begin
- iDirection := -iDirection;
- iTime := iLimit;
- end;
- If iTime <= -iLimit Then
- begin
- iDirection := -iDirection;
- iTime := -iLimit;
- end;
- end;
-
- procedure TForm1.DashDotDotRadioClick(Sender: TObject);
- begin
- ChangeLineStyle(Sender, 4)
- end;
-
- procedure TForm1.DashDotRadioClick(Sender: TObject);
- begin
- ChangeLineStyle(Sender, 3)
- end;
-
- procedure TForm1.DashRadioClick(Sender: TObject);
- begin
- ChangeLineStyle(Sender, 1)
- end;
-
- procedure TForm1.DotRadioClick(Sender: TObject);
- begin
- ChangeLineStyle(Sender, 2)
- end;
-
- procedure TForm1.SolidRadioClick(Sender: TObject);
- begin
- ChangeLineStyle(Sender, 0)
- end;
-
- procedure TForm1.CloseButtonClick(Sender: TObject);
- begin
- Close
- end;
-
- end.
-