当前位置: 首页>>代码示例>>C++>>正文


C++ CControlBar类代码示例

本文整理汇总了C++中CControlBar的典型用法代码示例。如果您正苦于以下问题:C++ CControlBar类的具体用法?C++ CControlBar怎么用?C++ CControlBar使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CControlBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ASSERT_KINDOF

vector <CCoolDialogBar *> CCoolDialogBar::AllVisibleNeighbours(int *OwnIndex) 
{
	vector <CCoolDialogBar *> ret;
	
	CDockBar *pDockBar = (CDockBar*)GetParent();
	ASSERT_KINDOF(CDockBar , pDockBar);
	
	bool row = false;
	CPtrArray *bars = &pDockBar->m_arrBars;
	for (int i = 0; i < bars->GetSize(); i++) {
		//CControlBar *pBar = pDockBar->GetDockedControlBar(i);
		CControlBar* pBar = (CControlBar*)pDockBar->m_arrBars[i];
		if (HIWORD(pBar) == 0)
			pBar = NULL;
		if (!pBar) {
			if (row)
				break;
			ret.clear();
			continue;
		}
		if (!pBar->IsVisible())
			continue;
		if (this == pBar) {
			row = true;
			if (OwnIndex)
				*OwnIndex = ret.size();
		}
		ret.push_back((CCoolDialogBar*)pBar);
	}

	return ret;
}
开发者ID:konelav,项目名称:jmc,代码行数:32,代码来源:CoolDialogBar.cpp

示例2: GetControlBar

BOOL CMainFrame::OnBarCheckEx(UINT nID)
{
    int count = m_wndSplitter.GetRowCount ();
    for ( int i = 0 ; i < count ; i++ ) {
        (m_wndSplitter.GetPane(i, 0))->InvalidateRect(NULL);
    }

//vls-begin// multiple output
    CControlBar* pBar = GetControlBar(nID);

    if (pBar != NULL) {
        BOOL bVisible = (pBar->GetStyle() & WS_VISIBLE);
        for (int i = 0; i < MAX_OUTPUT; i++) {
            if (nID == outputwindows[i]) {
                m_coolBar[i].m_bFlag = !bVisible;
                break;
            }
        }
    }


//vls-end//

    return OnBarCheck(nID);
}
开发者ID:chenwei600,项目名称:jmc,代码行数:25,代码来源:MainFrm.cpp

示例3: while

DWORD CFrameWnd::CanDock( CRect rect, DWORD dwDockStyle, CDockBar **ppDockBar )
/*****************************************************************************/
{
    POSITION position = m_listControlBars.GetHeadPosition();
    while( position != NULL ) {
        CControlBar *pControlBar = (CControlBar *)m_listControlBars.GetNext( position );
        ASSERT( pControlBar != NULL );
        if( pControlBar->IsDockBar() && (pControlBar->GetBarStyle() & dwDockStyle) ) {
            CDockBar *pDockBar = (CDockBar *)pControlBar;
            ASSERT( pDockBar->IsKindOf( RUNTIME_CLASS( CDockBar ) ) );

            if( !pDockBar->m_bFloating ||
                (pDockBar->GetBarStyle() & CBRS_FLOAT_MULTI) ) {
                CRect rectBar;
                pDockBar->GetWindowRect( &rectBar );
                
                RECT rectJunk;
                if( rectBar.left == rectBar.right ) {
                    rectBar.right++;
                }
                if( rectBar.top == rectBar.bottom ) {
                    rectBar.bottom++;
                }
                if( ::IntersectRect( &rectJunk, &rect, &rectBar ) ) {
                    if( ppDockBar != NULL ) {
                        *ppDockBar = pDockBar;
                    }
                    return( pDockBar->GetBarStyle() & dwDockStyle );
                }
            }
        }
    }
    return( 0L );
}
开发者ID:ArmstrongJ,项目名称:open-watcom-v2,代码行数:34,代码来源:framewnd.cpp

示例4: _ContextMenuTrack

void CExtDockBar::_ContextMenuTrack()
{
	// find any control bar
CControlBar * pBar = NULL;
	for( int nPos = 0; nPos < m_arrBars.GetSize(); nPos++ )
	{
		pBar = GetDockedControlBar(nPos);
		if( pBar != NULL )
		{
			ASSERT_VALID( pBar );
			break;
		}
	}
	if( pBar == NULL )
		return;

CFrameWnd * pFrame = _GetDockingFrameImpl();
CPoint point;
	VERIFY( ::GetCursorPos(&point) );
CExtPopupMenuWnd * pPopup =
		new CExtPopupMenuWnd;
	VERIFY( pPopup->CreatePopupMenu( pBar->GetOwner()->GetSafeHwnd() ) );
	_ContextMenuBuild(
		pFrame,
		pPopup
		);
	pPopup->TrackPopupMenu(
		0,
		point.x,point.y,
		pBar->GetOwner()->GetSafeHwnd() // pFrame->GetSafeHwnd()
		);
}
开发者ID:ZhaoboMeng,项目名称:k-line-print,代码行数:32,代码来源:ExtDockBar.cpp

示例5: DYNAMIC_DOWNCAST

BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
	if (pMsg->message == WM_RBUTTONDOWN)
	{
		CWnd* pWnd = CWnd::FromHandlePermanent(pMsg->hwnd);
		CControlBar* pBar = DYNAMIC_DOWNCAST(CControlBar, pWnd);

		if (pBar != NULL)
		 {
			CMenu Menu;
			CPoint pt;

			pt.x = LOWORD(pMsg->lParam);
			pt.y = HIWORD(pMsg->lParam);
			pBar->ClientToScreen(&pt);

			if (Menu.LoadMenu(IDR_TOOLBAR))
			{
				CMenu* pSubMenu = Menu.GetSubMenu(0);

				if (pSubMenu!=NULL)
				{
					pSubMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x,pt.y,this);
				}
			}
		}
	}
	return CFrameWnd::PreTranslateMessage(pMsg);
}
开发者ID:deepmatrix,项目名称:blaxxun-cc3d,代码行数:29,代码来源:mainfrm.cpp

示例6: OnUpdateTabbar

void CMainFrame::OnUpdateTabbar(CCmdUI* pCmdUI) 
{
	CControlBar* pBar = (CControlBar*)&m_wndTabBar ;
	if (pBar != NULL)
    {
		pCmdUI->SetCheck((pBar->GetStyle() & WS_VISIBLE) != 0);
	}
}
开发者ID:RealityFactory,项目名称:Genesis3D-Tools,代码行数:8,代码来源:MainFrm.cpp

示例7: GetCurSel

void COXDockTabCtrl::ShowSelectedTab()
{
	int iSelected = GetCurSel();

	// Show first
	for (int i = 0; i < GetItemCount(); i++)
	{
		CControlBar* pBar = GetBar(i);
		if (iSelected == i)
		{
			pBar->GetDockingFrame()->ShowControlBar(pBar, TRUE, TRUE); // show
		}
		else
		{
			pBar->GetDockingFrame()->ShowControlBar(pBar, FALSE, TRUE); // hide
		}
	}

	CRect rect;
	m_pSizeDockBar->GetClientRect(rect);

	CControlBar* pBar = GetBar(iSelected);
	if (pBar != NULL)
	{
		COXSizeControlBar* pSizeBar = DYNAMIC_DOWNCAST(COXSizeControlBar, pBar);
		if (m_pSizeDockBar->IsBarHorizontal())
		{
			if (m_pLastSelectedBar != NULL)
			{
				pSizeBar->m_HorzDockSize.cx = m_pLastSelectedBar->m_HorzDockSize.cx;
			}
			m_pLastSelectedBar = pSizeBar;
		}
		else // vertical
		{
			CFrameWnd* pMF = (CFrameWnd*) GetParentFrame();//AfxGetMainWnd();
			if (pMF != NULL)
			{
				if (pMF->GetControlBar(AFX_IDW_DOCKBAR_LEFT) == m_pSizeDockBar)
					rect.right -= 3;

				if (pMF->GetControlBar(AFX_IDW_DOCKBAR_RIGHT) == m_pSizeDockBar)
					rect.left += 4;
			}
			
			rect.bottom -= m_pSizeDockBar->GetTabHeight();

			pBar->MoveWindow(rect, TRUE);

			COXSizeControlBar* pSizeBar = DYNAMIC_DOWNCAST(COXSizeControlBar, pBar);
			if (pSizeBar)
			{
				pSizeBar->m_VertDockSize.cx = rect.Width();
				pSizeBar->m_VertDockSize.cy = rect.Height() + 5;
			}
		}
	}
}
开发者ID:drupalhunter-team,项目名称:TrackMonitor,代码行数:58,代码来源:OXDockTabCtrl.cpp

示例8: DYNAMIC_DOWNCAST

// Inserts the given control bar as a new tab
void COXDockTabCtrl::InsertTab(CControlBar* pBar, int iIndex, BOOL bShowSelectedTab)
{
	// If this is the only control bar in the dock bar do nothing
	int iSizeControlBarCount = m_pSizeDockBar->GetSizeControlBarCount(pBar);
	if (iSizeControlBarCount == 0)
		return;

	// Add a tab for all other size control bars that are docked but not tabbed

	int i = 0;
	for (i = 0; i < m_pSizeDockBar->m_arrBars.GetSize(); i++)
	{
		COXSizeControlBar* pSizeBar = DYNAMIC_DOWNCAST(COXSizeControlBar, m_pSizeDockBar->GetDockedControlBar(i));
		if (pSizeBar != NULL && pSizeBar != pBar && FindTab(pSizeBar) == -1)
		{
			CString strTextOther;
			pSizeBar->GetWindowText(strTextOther);

			TCITEM tciOther;
			tciOther.mask = TCIF_TEXT | TCIF_PARAM;
			tciOther.pszText = strTextOther.GetBuffer(strTextOther.GetLength());
			tciOther.lParam = (LPARAM) pSizeBar;
		
			//Check added for visibility so that hidden control
			//bars don't get shown - Nish - Feb 15th 2005
			if(pSizeBar->IsWindowVisible())
				InsertItem(0, &tciOther);
		}
	}

	// Insert this control bar to the tab control
	CString strText;
	pBar->GetWindowText(strText);

	TCITEM tci;
	tci.mask = TCIF_TEXT | TCIF_PARAM;
	tci.pszText = strText.GetBuffer(strText.GetLength());
	tci.lParam = (LPARAM) pBar;

	InsertItem(iIndex, &tci);
	SetCurSel(iIndex);

	// Reshresh the tab control
	m_pSizeDockBar->PositionTabCtrl();

	if (bShowSelectedTab)
		ShowSelectedTab();
	else
	{
		int iSelected = GetCurSel();
		for (i = 0; i < GetItemCount(); i++)
		{
			CControlBar* pBar = GetBar(i);
			if (iSelected != i)
				pBar->GetDockingFrame()->ShowControlBar(pBar, FALSE, TRUE); // hide
		}
	}
}
开发者ID:drupalhunter-team,项目名称:TrackMonitor,代码行数:59,代码来源:OXDockTabCtrl.cpp

示例9: OnTabbar

void CMainFrame::OnTabbar() 
{
	CControlBar* pBar = (CControlBar*)&m_wndTabBar ;

	if( pBar )
	{
		ShowControlBar( pBar, (pBar->GetStyle() & WS_VISIBLE) == 0, FALSE ) ;
	}
}
开发者ID:RealityFactory,项目名称:Genesis3D-Tools,代码行数:9,代码来源:MainFrm.cpp

示例10: DYNAMIC_DOWNCAST

void CMainFrame::OnViewEditingtoolbar() 
{
	CControlBar *pBar = DYNAMIC_DOWNCAST(CControlBar,&m_wndEditBar);
	if(pBar)
	{
		ShowControlBar(pBar, (pBar->GetStyle() & WS_VISIBLE) == 0, FALSE);
	}

}
开发者ID:jetlive,项目名称:skiaming,代码行数:9,代码来源:MainFrm.cpp

示例11: GetControlBar

void CMainFrame::OnUpdateFcToolBarMenu(CCmdUI* pCmdUI) 
{
	CControlBar* pBar = GetControlBar(IDR_FORMAT);
	if (pBar != NULL)
	{
		pCmdUI->SetCheck((pBar->GetStyle() & WS_VISIBLE) != 0);
		return;
	}
	pCmdUI->ContinueRouting();
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:10,代码来源:MainFrm.cpp

示例12: GetControlBar

CExtControlBar * CExtMiniDockFrameWnd::GetControlBarExt()
{
CControlBar * pTempWnd = GetControlBar();
    if( pTempWnd == NULL )
        return NULL;
//	ASSERT_KINDOF( CExtControlBar, pTempWnd );
    if( !pTempWnd->IsKindOf( RUNTIME_CLASS(CExtControlBar) ) )
        return NULL;
    return reinterpret_cast < CExtControlBar * >( pTempWnd );
}
开发者ID:darwinbeing,项目名称:trade,代码行数:10,代码来源:ExtMiniDockFrameWnd.cpp

示例13: GetControlBar

void CFrameWnd::OnUpdateControlBarMenu( CCmdUI *pCmdUI )
/******************************************************/
{
    CControlBar *pBar = GetControlBar( pCmdUI->m_nID );
    if( pBar != NULL ) {
        pCmdUI->SetCheck( pBar->IsWindowVisible() ? 1 : 0 );
    } else {
        pCmdUI->ContinueRouting();
    }
}
开发者ID:ArmstrongJ,项目名称:open-watcom-v2,代码行数:10,代码来源:framewnd.cpp

示例14: _IsMenuBar

BOOL CGuiDocBarExtenEx::_IsMenuBar(int nPos, CPtrArray& arrBars)
{
	if (nPos < arrBars.GetSize()) {
		CControlBar* pBar = (CControlBar*)arrBars[nPos];
		if (pBar && pBar->GetDlgCtrlID() == AFX_IDW_MENUBAR)
			return TRUE;
		else
			return FALSE;
	}
	else
		return FALSE;
}
开发者ID:neil-yi,项目名称:ffsource,代码行数:12,代码来源:GuiDocBarExtenEx.cpp

示例15: ShowAll

void CDockBar::ShowAll(BOOL bShow)
{
	for (int nPos = 0; nPos < m_arrBars.GetSize(); nPos++)
	{
		CControlBar* pBar = (CControlBar*)m_arrBars[nPos];
		if (pBar != NULL)
		{
			CFrameWnd* pFrameWnd = pBar->GetDockingFrame();
			pFrameWnd->ShowControlBar(pBar, bShow, TRUE);
		}
	}
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:12,代码来源:bardock.cpp


注:本文中的CControlBar类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。