Subversion Repositories autosfx

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 daniel-mar 1
Unit msgunit;
2
(************************************************************************
3
 Copyright (C) 2009, 2010  by Russell J. Peters, Roger Aelbrecht,
4
      Eric W. Engler and Chris Vleghert.
5
 
6
   This file is part of TZipMaster Version 1.9.
7
 
8
    TZipMaster is free software: you can redistribute it and/or modify
9
    it under the terms of the GNU Lesser General Public License as published by
10
    the Free Software Foundation, either version 3 of the License, or
11
    (at your option) any later version.
12
 
13
    TZipMaster is distributed in the hope that it will be useful,
14
    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
    GNU Lesser General Public License for more details.
17
 
18
    You should have received a copy of the GNU Lesser General Public License
19
    along with TZipMaster.  If not, see <http://www.gnu.org/licenses/>.
20
 
21
    contact: problems@delphizip.org (include ZipMaster in the subject).
22
    updates: http://www.delphizip.org
23
    DelphiZip maillist subscribe at http://www.freelists.org/list/delphizip
24
************************************************************************)
25
 
26
{$INCLUDE '..\..\ZipVers19.inc'}
27
 
28
Interface
29
 
30
Uses
31
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
32
  StdCtrls, ExtCtrls, ComCtrls;
33
 
34
Type
35
  TMsgform = Class(TForm)
36
    Panel1: TPanel;
37
    Panel2: TPanel;
38
    ProgressBar1: TProgressBar;
39
    FileBeingZipped: TLabel;
40
    StatusBar1: TStatusBar;
41
    Button1: TButton;
42
    Button2: TButton;
43
    Memo1: TMemo;
44
 
45
    Procedure DismissButClick(Sender: TObject);
46
    Procedure CancelButClick(Sender: TObject);
47
    Procedure FormCreate(Sender: TObject);
48
    Procedure FormResize(Sender: TObject);
49
 
50
  PUBLIC
51
    { Public declarations }
52
    FormInitialWidth: Integer;
53
 
54
    ProgressBar2: TProgressBar;
55
  End;
56
 
57
Var
58
  Msgform: TMsgform;
59
 
60
Implementation
61
 
62
Uses mainunit;
63
{$R *.DFM}
64
 
65
Procedure TMsgform.DismissButClick(Sender: TObject);
66
Begin
67
  Hide;
68
End;
69
 
70
Procedure TMsgform.CancelButClick(Sender: TObject);
71
Begin
72
  If (MainForm.ZipMaster1.Busy) Then
73
    MainForm.ZipMaster1.Cancel := True
74
  Else
75
    Hide; { nothing to cancel - assume user wants to close msg window }
76
End;
77
 
78
Procedure TMsgform.FormCreate(Sender: TObject);
79
Begin
80
  ProgressBar2 := TProgressBar.Create(StatusBar1); // Parent will delete it.
81
  ProgressBar1.Smooth := True;
82
  With ProgressBar2 Do
83
  Begin
84
    Parent := StatusBar1;
85
    Top := 2;
86
    Left := StatusBar1.Left + StatusBar1.Panels.Items[0]
87
      .Width + StatusBar1.Panels.Items[1].Width + 2;
88
    Height := StatusBar1.Height - 2;
89
    Min := 1;
90
    Max := 100;
91
    Smooth := True;
92
  End;
93
  FormInitialWidth := Msgform.Width;
94
End;
95
 
96
Procedure TMsgform.FormResize(Sender: TObject);
97
Begin
98
  ProgressBar2.Width := StatusBar1.Width - StatusBar1.Panels.Items[0]
99
    .Width - StatusBar1.Panels.Items[1].Width - 18;
100
  ProgressBar1.Width := 177 + (Msgform.Width - FormInitialWidth);
101
End;
102
 
103
End.