SECCustomStatusBar Class

class SECCustomStatusBar: public SECStatusBar

The SECCustomStatusBar class implements a Windows status bar that is more functional and configurable than MFC’s CStatusBar.

Defined in: sbarcust.h

Comments

Notice that SECCustomStatusBar inherits from  SECStatusBar, which is an interface equivalent replacement for CStatusBar and serves as the base class for your application’s status bar. SECCustomStatusBar inherits all the functionality of a normal MFC status bar and adds a host of new features. With SECCustomStatusBar, you can configure the fonts used in status bar panes, the text alignment, and foreground and background colors. SECCustomStatusBar also adds a progress indicator which can be programmatically shown in place of the status bar panes and later hidden when there is no progress to illustrate.

With CStatusBar, panes can only contain text. SECCustomStatusBar adds the ability to embed bitmaps in status bar panes. Moreover, SECCustomStatusBar allows custom cursor bitmaps to be assigned to individual status bar panes. When the cursor is inside the pane, the cursor takes the form of the specified bitmap. Outside of the pane, the cursor is its normal shape. Lastly, SECCustomStatusBar adds member functions that facilitate the processing of mouse events inside a status bar pane.

To make use of the SECCustomStatusBar class inside your frame windows, change the type of your status bar from CStatusBar (or  SECStatusBar) to SECCustomStatusBar.

Assuming you want to perform some status bar customizations, the next step is to call the necessary SECCustomStatusBar member functions (i.e.,  SetPaneInfoEx) from your overridden CFrameWnd::OnCreate member function.

See the STATBAR sample in the \SAMPLES\TOOLKIT\UIEXT\STATBAR directory for a demonstration of how to use the SECCustomStatusBar class.

Developer Notes

Any status bar formally derived from CStatusBar must be rederived from SECStatusBar. No CStatusBars are allowed when using Objective Toolkit’s docking window enhancements, as they lack the expected member variables.)

See Also

SECStatusBar

PANEINFOEX Overview

enum  FitType

Pane "Fit" Types

Class Members

Creation/Initialization

SECCustomStatusBar()

Constructs a SECCustomStatusBar object.

Operations

void  RegisterWndToPane(int nPane,CWnd* pWnd,FitType fit=FitWndToPane,UINT nSizeFlags=0)

Maps a CWnd-derived control to a specific status bar pane for automatic sizing and visibility manipulations.

CWnd*  GetRegisteredWnd(int nPane)

Retrieves the CWnd-derived control from the given pane.

UINT  GetRegisteredWndSizeFlags(int nPane)

Retrieves the size flags for the given pane.

void  GetPaneInfoEx(PANEINFOEX* pex) const

Returns the attributes of the specified pane.

void  SetPaneInfoEx(const PANEINFOEX* pex, BOOL bFit = TRUE)

Sets the attributes of the specified pane.

void  StepProgress()

Increments the progress indicator.

void  SetProgress(int iPos)

Shows amount of progress on the indicator.

void  SetStepProgress(int nStep)

Sets the step size.

void  FitPanesToContent()

Resets horizontal pane sizing for non-stretchy panes.

Overridable

virtual BOOL  InitializeProgressControl(LPCTSTR pcszMsg = NULL, int iLow = 0, int iHigh = 100, BOOL bResetPos = TRUE, DWORD dwExStyle=SEC_EX_PROGRESS_DEFAULTS, int nStep = 10)

Initializes and shows the progress indicator.

virtual void  UninitializeProgressControl()

Deletes the progress indicator and restores the status bar to its original content.

virtual void  SetVisibleAllRegWnd(BOOL bShow=TRUE)

Sets the visibility of the registered windows.

virtual void  ResizeAllRegWnd()

Resizes all registered windows based on current attributes.