SECBar Class

class SECBar: public CObject

A SECBar object represents a single "bar" window that a user can select. It is displayed inside the SECShortcutBar window. Every time a bar that is to contain an embedded CWnd object is added to the shortcut bar, a SECBar is created. SECBar maintains its own size and the size of its associated CWnd. SECBar is also smart enough to know how big it needs to be based on the font it is supposed to use.

Defined in: SECBar.h

Class Members

Public Enumerations

enum  ButtonStyleAndState

Button Style and States

enum  LabelAlignment

Label Alignment

Construction/Destruction

SECBar()

constructs the SECBar object

SECBar( const SECBar& rBar )

constructs the SECBar object from another SECBar object

virtual  ~SECBar()

destructs an SECBar object

Operators

const SECBar&  operator=( const SECBar& rBar )

Assignment Operator for SECBar objects

Attributes

CRect  GetBtnRect() const

returns the rect of the button.

CRect  GetPaneRect() const

returns the rect of the pane

CWnd*  GetWnd() const

returns the associated CWnd pointer

virtual void  SetWnd( const CWnd* const pWnd )

sets the associated HWND from the CWnd pointer

virtual void  SetWndPermanent( CWnd* pWnd )

caches the CWnd pointer

CString  GetLabel() const

returns the current SECBar label

void  SetLabel( const CString& sLabel )

sets the bar label

LabelAlignment  GetLabelAlignment() const

returns the bar alignment style for the text

void  SetLabelAlignment( LabelAlignment la )

Sets the bar alignment style for the text

CFont*  GetFont() const

returns the CFont object being used by the bar

void  SetFont( const CFont* const pFont )

sets the CFont object being used by the bar

COLORREF  GetFocusColor() const

returns the color the bar is using to show focus

void  SetFocusColor( COLORREF color )

sets the color the bar is using to show focus

COLORREF  GetTextColor() const

returns the color the bar is using for text

void  SetTextColor( COLORREF color )

sets the color the bar is using for text

COLORREF  GetBkColor() const

returns the background color for the bar

void  SetBkColor( COLORREF color )

sets the background color for the bar

HICON  GetIcon() const

returns the icon associated with the bar

void  SetIcon( HICON hIcon )

sets the icon associated with the bar

void  SetIcon( LPCTSTR lpszIconRes, int iHeight = 16, int iWidth = 16 )

sets the icon associated with the bar

void  SetIcon( UINT nIconRes, int iHeight = 16, int iWidth = 16 )

sets the icon associated with the bar

HMENU  GetMenu() const

returns the HMENU associated with the bar

void  SetMenu( HMENU hMenu )

sets the menu associated with the bar

void  SetMenu( CMenu* pMenu, int iSubMenu = -1 )

sets the menu associated with the bar

void*  GetExtraData() const

returns the opaque pointer associated with the bar

void  SetExtraData( const void* const pData )

sets the opaque pointer associated with the bar

BOOL  IsEnabled() const

Query whether the bar is enabled

void  SetEnabled( BOOL bSel = TRUE )

Set the bar's enabled/disabled state

long  GetStyle() const

Query the bar's style

void  SetStyle( long lStyle )

Set the bar's style

BOOL  WillAutoDelete() const

Query the auto delete flag

void  SetAutoDelete( BOOL bAuto = TRUE )

Set the auto delete flag

BOOL  m_bAutoDelete

The auto delete flag

Public Operations

BOOL  MouseHit( const CPoint& ptMouseDown ) const

Query if the mouse hit the bar

void  Delete()

Delete the SECBar object if able to

Public Overridable

virtual void  Draw( CDC& dc, BOOL bVert )

Draws the SECBar object

virtual void  InitializeGDIResources()

Initializes the GDI Resources used by the bar

virtual void  UninitializeGDIResources()

Uninitializes the GDI Resources used by the bar

virtual void  ComputeRect( CDC& dc, BOOL bVert )

Computes button rect

Protected Overridable

virtual void  DrawButton( CDC& dc, BOOL bPressed )

Draws the button part of the bar

virtual void  DrawIcon( CDC& dc, BOOL bPressed, BOOL bVert )

Draws the icon part of the bar

virtual void  DrawText( CDC& dc, BOOL bPressed, BOOL bVert )

Draws the text part of the bar