TProgressWheel

Fonte: source/classes/metrcirc.prg

Inherits from: TControl

TProgressWheel is a GDI+-based circular/ring progress indicator that displays percentage-complete text in the center. It supports gradient fill colors for both the done and remaining arc segments, an adjustable inner diameter, and an indeterminate spinning mode suitable for unknown-duration operations. Color properties accept numeric RGB values, gradient arrays, image file paths, or TBrush objects.

Key DATA Members

DATATypeDescription
nMin, nMaxNumericRange minimum and maximum values
nPosNumericCurrent position within the range
nStepNumericStep increment value
cPromptCharacterOptional custom text or code block displayed in center
lPercentageLogicalShow percentage text in center of wheel
nStartAngleNumericStarting angle in degrees (default -90, 12 o'clock)
nInnerDiaNumericInner diameter ratio (0.0-1.0, default 0.75)
lIndefiniteLogicalEnable indeterminate spinning animation
nColorTextNumericText color for percentage or prompt display
nColorInnerNumeric/ArrayInner circle color (numeric or gradient)
nColorRemainVariesRemaining arc brush: numeric, gradient, image path, or TBrush
nColorDoneMinVariesCompleted arc brush: numeric, gradient, image path, or TBrush

Methods

MethodDescription
New( nRow, nCol, oWnd, nPos, nW, nH, lPixel, lDesign, oFont, cPrompt, lNoPct, nClrInner, nClrRemain, nClrDoneMin, nClrText, nMin, nMax, nInnerDia )Create a new TProgressWheel control
SetPos( nVal )Set the current position and refresh the display
GetPos()Return the current position value
SetRange( nMin, nMax )Change the range minimum and maximum
SetInner( nSize )Adjust the inner diameter ratio
Indefinite( lOn )Enable or disable indeterminate spinning mode
Default()Apply default size and position settings

Example: Ring Progress at 35%

#include "FiveWin.ch"

function Main()

   local oWnd, oWheel

   DEFINE WINDOW oWnd TITLE "Progress Wheel" SIZE 300, 300

   oWheel := TProgressWheel():New( 20, 20, oWnd, 35,, 100, 100,;
                                   .T.,,, .F., CLR_HGRAY,;
                                   CLR_HRED, CLR_HGREEN, CLR_WHITE,;
                                   0, 100, 0.60 )

   oWheel:lPercentage := .T.

   ACTIVATE WINDOW oWnd CENTERED

return nil

Notes

Veja Também