BFC_BusyForm

Description

I think everyone who has done some kind of programming had to do some processing with which the end-user had to wait untill it was finished.
Until now we had to place a progressbar (or something like that) on the form and displaying some kind of message that the application is busy.
I think this component is a perfect solution for this. With almost no programming you can do this... and more.

Place the component on the form and set the properties. The component creates an internal form which you can make visible or hide as you please.

There are two ways of using this component.

Or you do everything yourself.

Or you can let the component to everything by itself

 

Properties

CancelCaption   Declaration
property CancelCaption: TCaption;

Description
Give a caption that will be displayed in the cancel-button. Default = '&Cancel'.

Canceled   Declaration
property Canceled: boolean;

Description
Boolean field that is set to true after the end-user has clicked on the cancel-button.

CancelEnabled   Declaration
property CancelEnabled: boolean;

Description
Property to enable or disable the cancel-button on the busyform.

FormCaption   Declaration
property FormCaption: TCaption;

Description
String that will be displayed in the titlebar of the BusyForm.

LabelCaption   Declaration
property LabelCaption: TCaption;

Description
String that will be displayed in the label on the busyform. This can inform the end-user about what the application is doing.

ProgressBar   Declaration
property ProgressBar: TProgressBar;

Description
You can assign this property to an external progressbar if you don't wish to use the internal form. You can use all the methods and properties of this component, but there is no law that says you HAVE to use the internal form. Fill in the ProgressMin, ProgressMax, ProgressStep-properties, assign a ProgressBar and use the execute-method (Set the VisibleOnExecute to false). Assign a procedure to the OnStep event. The component will use your progressbar.

ProgressMax   Declaration
property ProgressMax: Integer;

Description
An integer value which holds the max-value of the loop to make.

ProgressMin   Declaration
property ProgressMin: Integer;

Description
An integer value which holds the start-value of the loop.

ProgressPosition   Declaration
property ProgressPosition: Integer;

Description
Integer value that indicates how much of the loop is finished. It's not a percentage-value.With a ProgressMin set to 1 and a ProgressMax set to 10000 a value of 5000 in the ProgressPosition indicates that we're half way.

ProgressStep   Declaration
property ProgressStep: Integer;

Description
Defines the step of the loop.
A ProgressStep set to 2 with a ProgressMin of 2 and a ProgressMax of 10 will execute 6 times.

ResetOnCancel   Declaration
property ResetOnCancel: boolean;

Description
With this property set to True, the ProgressPosition will be set to 0 after the execute-method is executed (you can check how far you got in the Oncancel-event). When the property is set to False, the ProgressPosition will not be set to 0 if the end-user canceled the operation by clicking on the cancel-button.

VisibleOnExecute   Declaration
property VisibleOnExecute: Boolean;

Description
If the value of this property is True, firing the execute-method will automatically display the internal form. You don't have to use the show-method to make the form visible.
After the processing is done, the internal form will be hidden if it was hidden before the execute-method

 

Methods

Execute   Declaration
procedure Execute;

Description
Using this method will create a loop that starts with the value of ProgressMin and ends if the value of ProgressPosition is greater than the value in ProgressMax. Each time this condition is true the OnStep-event is fired once and the value of ProgressPosition is incremented with ProgressStep.

This process can only be canceled by the end-user if he clicks the cancel-button (when enabled; see CancelEnabled)

Hide   Declaration
procedure Hide;

Description
Method to hide the internal busyform.

Show   Declaration
procedure Show;

Description
Methd to show the internal busyform.

 

Events

OnCancel   Declaration
property OnCancel: TNotifyEvent;

Description
This event will be triggered if the end-user clicks on the cancel-button of the internal busyform. (if CancelEnabled is set to True). You can always check here on the value of the ProgressPosition-property.

OnStep   Declaration
property OnStep: TNotifyEvent;

Description
This event will be executed for every step in the loop that is created. You will have to perform your tasks here if you use the automatic way of working. The OnStep event will only be triggered when using the execute-method.