RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Graphics.TProgressEvent Type

TProgressEvent is the type of event handlers that provide feedback during lengthy operations.

Pascal
TProgressEvent = procedure (Sender: TObject; Stage: TProgressStage; PercentDone: Byte; RedrawNow: Boolean; const R: TRect; const Msg: string) of object;
C++
(Sender: TObject; Stage: TProgressStage; PercentDone: Byte; RedrawNow: Boolean; const R: TRect; const Msg: string) ( TProgressEvent)();

Sender is the object that receives the event notification. This is typically the component that initiated the lengthy operation. 

Stage indicates whether the operation is beginning, continuing, or ending. If the event handler displays an indicator such as a progress bar, the indicator can be created when Stage is psStarting, updated while Stage is psRunning, and removed when Stage is psEnding.  

PercentDone is an approximation of how much of the operation has completed. Use PercentDone to update the position of a progress bar or other indicator. 

RedrawNow indicates whether the partial results of the operation can safely be drawn on screen at this point. 

R gives the dimensions of the portion of the display that has changed and needs to be redrawn. 

Msg contains one or two words that describe what operation is occurring. For example, the value of Msg could be a string such as Loading, Storing, or Reducing colors. The Msg string can also be empty. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!