本文整理汇总了C++中CFrameWnd::AddControlBar方法的典型用法代码示例。如果您正苦于以下问题:C++ CFrameWnd::AddControlBar方法的具体用法?C++ CFrameWnd::AddControlBar怎么用?C++ CFrameWnd::AddControlBar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFrameWnd
的用法示例。
在下文中一共展示了CFrameWnd::AddControlBar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnCreate
int CControlBar::OnCreate( LPCREATESTRUCT lpCreateStruct )
/********************************************************/
{
if( CWnd::OnCreate( lpCreateStruct ) == -1 ) {
return( -1 );
}
CFrameWnd *pFrame = GetParentFrame();
if( pFrame != NULL ) {
pFrame->AddControlBar( this );
m_pDockSite = pFrame;
}
if( m_dwStyle & CBRS_TOOLTIPS ) {
EnableToolTips();
}
return( 0 );
}
示例2:
void
CPaletteWindow::CreateBar(bool bCreate)
{
// should only be called if there is really need to create/destroy the bar
ASSERT(bCreate == (m_pBarParent == NULL));
CFrameWnd* parent = (CFrameWnd*)AfxGetApp()->m_pMainWnd;
if (bCreate)
{
m_pBarParent = new CPaletteBar;
if (!m_pBarParent)
return;
if (m_pBarParent->Create(m_Name, parent, BAR_ID_START + m_PaletteNumber) == FALSE) {
delete m_pBarParent;
m_pBarParent = NULL;
return;
}
//move the palette window into the bar
if (m_hWnd != 0)
{
SetParent(m_pBarParent);
ShowWindow(SW_SHOW);
}
//set various styles
parent->AddControlBar(m_pBarParent);
m_pBarParent->SetBarStyle(m_pBarParent->GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
m_pBarParent->SetSCBStyle(SCBS_SIZECHILD);
m_pBarParent->EnableDocking(CBRS_ALIGN_ANY);
parent->DockControlBar(m_pBarParent, AFX_IDW_DOCKBAR_LEFT);
}
else
{
//move the palette window out the bar (onto the desktop), not to destroy the palette
ASSERT(m_hWnd != 0);
ShowWindow(SW_HIDE);
SetParent(NULL);
parent->RemoveControlBar(m_pBarParent);
delete m_pBarParent;
m_pBarParent = NULL;
}
}