SECStdBtn Class

class SECStdBtn

The SECStdBtn class includes various operations for drawing buttons on a toolbar. Its member functions are normally called from the Customize dialog (see class SECToolBarsDlg).

Defined in: tbtnstd.h

Comments

An end user can use this dialog to create a toolbar with buttons in a style geared toward a particular task. If the default styles offered in the Customize dialog do not match the user’s requirements, the New Toolbar dialog, reached from within the Customize dialog, allows the user to create a new toolbar from scratch, with a set of buttons in a unique style.

SECStdBtn encapsulates a single toolbar button. It is used by the SECCustomToolBar class.

See the sample TOOLBAR in the \SAMPLES\TOOLKIT\STANDARD\DOCKING\TOOLBAR directory for a demonstration of this class.

See Also

SECToolBarsDlg  SECToolBarsPage  SECCustomToolBar  SECToolBarManager

Class Members

void  SetToolBar(SECCustomToolBar* pToolBar)

tSets the parent toolbar.

void  GetBtnRect(CRect& rect) const

Returns the window rect. for this button (relative to parent’s client).

virtual void  SetMode(BOOL bVertical)

Informs the button when the button either enters or leaves a vertically docked state.

virtual void  SetStyle(UINT nStyle)

Sets the button style for this button object.

virtual UINT  GetStyle() const

Gets the button style for this button object.

virtual BOOL  TestStyle(UINT nStyle) const

Tests if a specifc style is set for this button object

virtual void  SetPos(int x, int y)

Modifies the window position relative to the parent’s client area.

virtual void  Invalidate(BOOL bErase = FALSE) const

Invalidates the button.

virtual void  Init(SECCustomToolBar* pToolBar, const SEC_UINT* pData)

Called after construction to allow the button to initialize.

virtual void  DrawButton(CDC& dc, SECBtnDrawData& data)

Draws the button on the given DC.

virtual BOOL  BtnPressDown(CPoint point)

Handles a mouse button press in the toolbar button’s window rect.

virtual void  BtnPressMouseMove(CPoint point)

Handles dragging the mouse while a mouse button is pressed.

virtual void  BtnPressCancel()

Handles the WM_CANCELMODE message while tracking a WM_LBUTTONDOWN message.

virtual UINT  BtnPressUp(CPoint point)

Handles release of a mouse button press.

virtual void  BarStyleChanged(DWORD dwStyle)

Notifies that parent toolbar’s style has been modified.

virtual int  OnToolHitTest(CPoint point, TOOLINFO* pTI) const

Tests tooltip/flyby help.

virtual void  InformBtn(UINT nCode, void* pData)

Informs button of some event. Normally used to reflect a change of

virtual void  AdjustSize()

Called when toolbar bitmap has changed; button should now adjust their size.

virtual void  GetBtnInfo(BYTE* nSize, LPBYTE* ppInfo) const

Called when loading a toolbar state, allowing a toolbar button to save state info.

virtual void  SetBtnInfo(BYTE nSize, const LPBYTE pInfo)

Called when saving a toolbar state, allowing a toolbar button to save state information.