TProgress

Fonte: source/classes/tprogres.prg

Inherits from: TControl

TProgress wraps the Windows common control progress bar (msctls_progress32). It supports standard progress indication with configurable range and position, step increments, vertical orientation, and marquee (indeterminate) mode. TProgress is suitable for showing operation progress in windows, dialogs, and status bars.

Key DATA Members

DATATypeDescription
nMinNumericMinimum range value (default 0)
nMaxNumericMaximum range value (default determined by system)
nPosNumericCurrent position
nStepNumericStep increment value

Methods

MethodDescription
New( nTop, nLeft, oWnd, nPos, nClrF, nClrB, lPixel, lDesign, nW, nH, cMsg, lVert, lMarquee )Create a progress bar. Supports vertical and marquee modes via lVert and lMarquee.
ReDefine( nId, oWnd )Redefine from a dialog resource template
SetPos( nPos )Set the current position (alias _nPosition, nPosition)
GetPos()Return the current position
SetRange( nMin, nMax )Set the minimum and maximum range values
SetStep( nStepInc )Set the step increment value
StepIt()Advance the position by the current step value
DeltaPos( nIncrement )Change the position by a relative amount (positive or negative)
SetMarquee( lOnOff )Enable or disable marquee (indeterminate) mode

Commands

// Standard progress bar
DEFINE PROGRESS oProg OF oDlg

// Marquee (indeterminate) progress bar
DEFINE PROGRESS oProg OF oDlg MARQUEE

Example

#include "FiveWin.ch"

function Main()

   local oWnd, oProg, n

   DEFINE WINDOW oWnd TITLE "Progress Demo" SIZE 400, 150

   @ 30, 30 PROGRESS oProg OF oWnd SIZE 340, 25

   oProg:SetRange( 0, 100 )
   oProg:SetStep( 1 )

   @ 80, 30 BUTTON "Start" OF oWnd SIZE 80, 25 ;
      ACTION ( oProg:SetPos( 0 ), ;
               For n := 1 To 100,;
                   oProg:SetPos( n ),;
                   SysRefresh(),;
                   Sleep( 10 ),;
               Next )

   ACTIVATE WINDOW oWnd CENTERED

return nil

Notes

Veja Também