TMeter

Source: source/classes/meter.prg

Inherits from: TControl

TMeter is a progress meter control that displays the completion status of a long-running operation. It supports three rendering styles: standard rectangular bar, circular gauge, and bitmap array. The meter can display a text label and percentage, with customizable foreground and background colors.

Key DATA Members

DATATypeDescription
nTotalNumericMaximum value (100% completion)
cTextCharacterLabel text displayed on or beside the meter
lPercentageLogicalShow percentage text on the meter
nClrBarNumericBar fill color (default CLR_HBLUE)
nClrBTextNumericBar text color (default CLR_WHITE)
nClrBlankNumericUnfilled portion color
cStyleCharacterRendering style: "CIRCULAR", "BMPARRAY", "BRUSH", or NIL for standard bar
nInnerDiaNumericInner diameter for circular meter (donut style)
nClrFillNumericFill color for circular meter
nClrBorderNumericBorder color for circular meter

Methods

MethodDescription
New( nRow, nCol, bSetGet, nTotal, oWnd, nW, nH, lUpdate, lPixel, oFont, cText, lNoPercentage, nClrPane, nClrText, nClrBar, nClrBText, lDesign, lCircular, nInnerDia, nClrFill, nClrBorder, lBmpArray )Create a new meter control
ReDefine( nId, bSetGet, nTotal, oWnd, lUpdate, oFont, cText, lNoPercentage, nClrPane, nClrText, nClrBar, nClrBText, lCircular, nInnerDia, nClrFill, nClrBorder, lBmpArray )Redefine from dialog resource
Set( nActual )Set the current progress value and refresh the display
SetTotal( nTotal )Change the maximum value
Paint()Render the standard rectangular bar
PaintCircular()Render the circular gauge style
PaintBmpArray()Render using a bitmap strip array
PaintBrushed()Render using a brush fill pattern
Default()Apply default font and colors

Example: Circular Progress

#include "FiveWin.ch"

function Main()

   local oWnd, oMeter, nVal := 0

   DEFINE WINDOW oWnd TITLE "Circular Meter Demo" SIZE 400, 300

   @ 10, 10 METER oMeter VAR nVal TOTAL 100 ;
      OF oWnd SIZE 120, 120 CIRCULAR ;
      COLORS CLR_HGREEN, CLR_WHITE, CLR_GRAY

   DEFINE TIMER oTimer OF oWnd INTERVAL 100 ;
      ACTION ( nVal++,;
               oMeter:Set( nVal ),;
               If( nVal >= 100, oTimer:End(), ) )

   ACTIVATE WINDOW oWnd CENTERED

return nil

Notes

See Also