SECShortcutBar::InsertBar
Will create a window based on the CRuntimeClass pointer passed in and insert it at the specified index
Or will insert the CWnd passed to it at the specified index.
Defined in: olbar.cpp
Syntax
InsertBar( int iIndex, CRuntimeClass* pWndClass, LPCTSTR lpszLabel, CCreateContext* pContext, BOOL bRecalc, UINT nID )
InsertBar( int iIndex, CWnd* pWnd, LPCTSTR lpszLabel, BOOL bRecalc )
InsertBar( LPCTSTR lpszLabel, BOOL bRecalc )
Return Value
a pointer to an SECBar or SECListBar if successful, otherwise will return NULL
Parameters
iIndex
0 based index of where you want to insert the bar
pWndClass
CRuntimeClass to use to allocate Window object
lpszLabel
Label to put on the Bar
pContext
extra create parameters.
These are used for CView derived classes.
bRecalc
Pass in TRUE if you want to recalc after adding a bar
nID
ID of the Window
pWnd
CWnd pointer to use as pane
Comments
If you create the child window yourself and use the 2nd overload to insert into the SECShortcutBar, make sure you use the SECShortcutBar as the parent of the window.
Example
m_wndShortcutBar.InsertBar( 1, RUNTIME_CLASS(CEditView), _T("Edit"), pContext );
m_wndShortcutBar.InsertBar( 1, &m_wndSECTreeCtrl, _T("Tree Control") );
See Also