SECControlBar::Create

This member function creates a control bar window and associates it with the SECControlBar object. If the CBRS_EX_STRETCH_ON_SIZE extended style is set, it also stores size and position information to aid in the stretching calculations later. This member function is also expected to initialize all control bar size information so as to provide a reasonable size when the control bar is first docked or floated.

Defined in: sbarcore.cpp

Syntax

Create(LPCTSTR lpszClassName,LPCTSTR lpszWindowName,UINT nID,DWORD dwStyle,DWORD dwExStyle,const RECT& rect,CWnd* pParentWnd,CCreateContext* pContext)

Create(CWnd* pParentWnd,LPCTSTR lpszWindowName,DWORD dwStyle,DWORD dwExStyle,UINT nID,CCreateContext* pContext)

Return Value

Nonzero if successful; otherwise 0.

Parameters

lpszClassName

The string containing the class name from which the control bar derives.

lpszWindowName

The string to be used in the control bar caption when floating.

nID

The control bar’s child-window ID.

dwStyle

The control bar style.

dwExStyle

Extended SECControlBar styles. Use the bitwise OR operator to combine the extended styles. The following extended control bar styles are supported:

·CBRS_EX_STDCONTEXTMENU Control bar is given the standard context menu (i.e., Allow docking, and Show/Hide control bar menu items).
·CBRS_EX_STRETCH_ON_SIZE When the control bar is resized, all child windows are stretched and repositioned so as to preserve the proportions of the control bar. If you require another form of resize handling, be sure to omit this extended style from the Create call and override SECControlBar::OnSize.
·CBRS_EX_DRAWBORDERS Draw a border around the bar.
·CBRS_EX_BORDERSPACE Leave border space for ease of dragging.
·CBRS_EX_ALLOW_MDI_FLOAT Control bar can be re-parented by an MDI child window.
·CBRS_EX_SIZE_TO_FIT Size the (single) child to fit.
·CBRS_EX_UNIDIRECTIONAL The control bar can be sized in one dimension at a time (no diagonal sizing allowed). In addition, a change in height dictates a new width and vice versa. A toolbar is an example of a unidirectional control bar.
·CBRS_EX_COOLBORDERS Floating buttons, no border.
·CBRS_EX_GRIPPER Draw the dragging gripper.
·CBRS_EX_GRIPPER_CLOSE Draw the close button on gripper.
·CBRS_EX_GRIPPER_EXPAND Expand/contract control bar button.
·CBRS_EX_COOL = CBRS_EX_COOLBORDERS or CBRS_EX_GRIPPER or CBRS_EX_GRIPPER_CLOSE or CBRS_EX_GRIPPER_EXPAND Control bar will have the cool look” – a flat, painted look similar to the control bars seen in Microsoft Developer Studio. These extended style options allow you to customize the “cool look” for your application. By default, customizable toolbars are CBRS_EX_COOLBORDERS or CBRS_EX_GRIPPER; all other control bars are CBRS_EX_COOL. NOTE: As of Objective Toolkit 5.0, gripper requires coolborders, and close requires gripper. Also, the gripper drawing code has been virtualized, so you can easily plug in your own gripper (or modify the existing gripper) with just one or two overrides.

rect

Reference to the control bar’s rectangle.

pParentWnd

Pointer to the window that is the control bar’s parent.

pContext

The create context of the window.