The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



Using TProgBar


The visual component TProgBar has been designed to enhance the standard progress bar which is available in Windows. TProgBar offers arbitrary colors, optional text display, an automatic increment, and many options to configure its visual appearance.

The visual appearance is mainly controlled by the colors, frames, its margins and the direction. The colors concern three different regions: the properties ColorBackGnd and ColorMargin control the background color and the margin color. Alternatively the background can be colored by a bitmap (BackGroundImg).

While these colors are fixed, the color of the bar can be manipulated by many properties. In principle, the progress bar shows a color gradient which is controlled by the properties ColorMin and ColorMax. In addition a regular grid of lines on top of the color gradient can be displayed by setting the property GridDist to non-zero values (the grid uses the color specified by ColorGrid).

The color of the progress bar needs not necessarily be a gradient, it can be set to arbitrary pattern by using the array property BarColors (ShowColorGradient must be set to FALSE in this case). Finally the property ColorMapMode controls how the colored progress bar moves when its Value changes.

The range of the progress bar can be set by the properties Min and Max and the method SetRange.

The appearance of the progress bar is also controlled by the frame style and the margins: FrameStyleInner and FrameStyleOuter, and MarginBottom, MarginLeft, MarginRight and MarginTop.

Further the value of the progress bar can also be display in numeric form. You have to set the property TextVisible to TRUE and tune the other related properties: TextAlignment, TextAngle, TextDecPlaces, TextPosX and TextPosY. Please note that the OnShowValue event is triggered before the text is rendered.

The progress bar can be switched into auto-increment mode by setting the property AutoInc to TRUE, which starts a timer after StartInterval msec. The timer increments the progress bar every RepeatInterval msec by the value of AutoIncStep, and triggers the OnAutoInc event each time the value is incremented.


Last Update: 2023-Dec-14