SECProgressCtrl Class

class SECProgressCtrl: public CProgressCtrl

The SECProgressCtrl offers several enhancements to the existing progress control, including "smooth fill" with percentages, multidirectional progressions (left to right, right to left, bottom to top, or top to bottom), fully configurable foreground/background coloring, and custom status text with configurable fonts. The progress control also offers virtual hooks for you to easily provide your own customizations (for example, a textured progress bar).

The SECProgressCtrl can be used anywhere a CProgressCtrl can be used. You can attach to an existing CProgressCtrl control via the  AttachProgress method, or dynamically create one via the  Create method.

See the  Create method for the flags that determine the style options for the control.

Defined in: progress.h

Class Members

Creation/Initialization

SECProgressCtrl()

Constructs a SECProgress control object.

virtual BOOL  Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID,DWORD dwExStyle=SEC_EX_PROGRESS_DEFAULTS)

Dynamically create a progress control.

virtual BOOL  AttachProgress(int nCtlID,CWnd* pParentWnd)

Attach to an existing progress control.

Attributes

virtual void  SetRange(ULONG ulLower,ULONG ulUpper)

Set progress value range for appropriate completion percentage.

virtual ULONG  SetPos(ULONG ulPos,BOOL bYield=TRUE)

Set current progress position.

virtual ULONG  OffsetPos(ULONG ulPos,BOOL bYield=TRUE)

Increment current progress position.

virtual ULONG  SetStep(ULONG ulStep)

Set step size for "StepIt" function call.

virtual void  SetColors(COLORREF fgnd=SEC_PROGRESS_DEF_FGND_COLOR, COLORREF bgnd=SEC_PROGRESS_DEF_BGND_COLOR)

Set progress control foreground (bar) and background colors.

virtual void  SetFont(CFont* pFont=(CFont *)NULL,BOOL bRedraw=TRUE)

Set the font for progress text.

virtual void  SetWindowText(LPCTSTR lpszNewText=(const TCHAR *)NULL)

Set the current progress text.

virtual void  GetWindowText(CString& strText)

Get the current progress text.

void  SetExStyle(DWORD dwExNewStyle)

Set the progress extended styles from the SEC_EX_PROGRESS_* flags.

DWORD  GetExStyle()

Get the current progress extended styles.

Operations

virtual ULONG  StepIt(BOOL bYield=TRUE)

Step the progress up one increment of the step size (set by SetStep).

virtual void  ResetProgress()

Reset the progress indicator to origin.

virtual BOOL  StepOnTimer(UINT nInterval)

AutoStep the timer at a regular interval.

Overridable

virtual BOOL  OnInitProgress()

Progress control is initializing.

virtual void  OnPaintBarFill(CDC* pDC,CRect rectFill)

Paint the filled progress bar image.

virtual void  OnPaintBarEmpty(CDC* pDC,CRect rectEmpty)

Paint the empty "unused" portion of the progress bar.

virtual void  OnPaintBarText(CDC* pDC,float fPctComplete,CRect rectEmpty,CRect rectFilled)

Paint the progress text, if any.

virtual void  OnDisplayStr(CString& strToDisplay)

Override this to alter a progress string before display.

virtual void  DoPaint(CPaintDC* pdc)

Paints the progress control.

virtual BOOL  CalcProgressRects(float fPct,CRect& rectFilled,CRect& rectEmpty)

Calculates the filled/empty rectangles for the progress control.

virtual BOOL  PaintProgressBarAndText(float fPctComplete,CRect rectFilled, CRect rectEmpty,CDC* pdc)

Paints the progress bar and text.

virtual float  CalcPercentComplete()

Calculates the percent complete.