EqapWait (version 1.0, 14.08.2006)

The EqapWait is a part of EqapPackage and is a visual component designed to indicate the progress of a process.


1. Appearance

The EqapWait (Fig. 1) has text fields (a) and (b) (by default, for file name and action name, respectively) and indication field, similar to TGauge (c).

Fig. 1. EqapWait component


2. Properties and events

The EqapWait inherits properties and events of TPanel except those used for text appearance (Alignment, AutoSize, Caption, Font etc.), and has own properties and events:

Properties

BorderIndent: integer - the distance between left/top edge of the component area and text fields. The default value is "16".

FileLabelCaption: string - the text in "file name" text field (Fig. 1, a).

GaugeOptions: TEqapWaitGaugeOptions - the draw settings of the indication area (Fig. 1, c). Sub-properties are Backcolor: TColor (the color of "unfinished" part of a process), Font: TFont (font settings of indication of the process percentage), Forecolor: TColor (the color of "finished" part of a process), Height: integer (the height of the indication area, ShowText: boolean (to show/hide the process percentage).

Interval: integer - the distance between text fields and indication area. The default value is "24".

LabelsFont: TFont - the labels font settings (the indication area font properties should be set as subproperty of GaugeOptions).

OperationLabelCaption: string - the text in "operation name" text field (Fig. 1, b).

Options: TEqapWaitOptions - the component options. The ewoShowAndCloseParentForm indicates whether EqapWait should automatically open its Parent-form at the process start and close this form at the process finish; the default value is "false". The ewoShowRemainingTime indicates whether EqapWait has to calculate the remaining time and to insert this time to the end of OperationLabelCaption; the default value is "true".

Events

OnProgress: TNotifyEvent - event arises at the next iteration of a process indication.

OnStart: TNotifyEvent - event arises at the start of a process indication.

OnStop: TNotifyEvent - event arises at the end of a process indication.


3. Procedures and functions

The following public-declared procedures and functions are registered for the EqapWait component:

procedure Start(AMax: integer; AFileLabelCaption,AOperationLabelCaption: string) - starts a process indication; indication is set to 0%.

procedure Continue - the next iteration of a process indication, the percentage is automatically incremented (the increment is calculated by the formula 100*(Current/Max), where Current is the current indication, Max is maximal indication).

procedure Continue(Progress,AMax: integer; AFileLabelCaption,AOperationLabelCaption: string) - the next iteration of a process indication, with direct assignment of the current and maximal indication.

procedure Stop - stops a process indication.

procedure SetFileLabelCaption(Caption: string) - sets "file name" text field value (Fig. 1, a).

procedure SetOperationLabelCaption(Caption: string) - sets "operation name" text field value (Fig. 1, b).


4. The example of using

EqapWait1 and Button1 are placed to Form1, the OnClick event of Button1 is assigned as shown below. Clicking to the Button1 calls the imitation of a process, with indication of both percentage and remaining time of this "process".

procedure TForm1.Button1Click(Sender: TObject);
var i: integer
begin
EqapWait1.Options:=EqapWait1.Options+[ewoShowRemainingTime];
EqapWait1.Start(10,'Process name: "example"','The process is activated');
for i:=0 to 9 do begin
Sleep(1000);
EqapWait1.Continue;
end;
end;

All the software products are free for use. Any commercial using is not permitted without author's permission (o.lookin@iip.uran.ru).

 

Hosted by uCoz