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


C++ CControlBar::IsKindOf方法代码示例

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


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

示例1: VerRight

int  CGuiDockContext::VerRight(int i,int nSize,CDockBar* pDockBar,CControlBar* pBar)

{
	BOOL bTipoToolBar=m_pBar->IsKindOf(RUNTIME_CLASS( CGuiToolBarWnd));
	//i--;
	if (i==0)
	{
		CControlBar* pBartemp;
		pBartemp = (CControlBar*) pDockBar->m_arrBars[i+1];
		if (HIWORD(pBartemp) == 0) return 2; // placeholder
		if (!pBartemp->IsVisible()) return 2;
		if (bTipoToolBar)
				if (!pBartemp->IsKindOf(RUNTIME_CLASS( CGuiToolBarWnd)))
					return 0;				
	}
	if (i > 0)
	{
			CControlBar* pBartemp;
			pBartemp = (CControlBar*) pDockBar->m_arrBars[i-1];
			if (HIWORD(pBartemp) == 0) return 2; // placeholder
			if (!pBartemp->IsVisible()) return 2;
			if (bTipoToolBar)
				if (!pBartemp->IsKindOf(RUNTIME_CLASS( CGuiToolBarWnd)))
					return 0;				
	
	}
	return 1;
}
开发者ID:ZhaoboMeng,项目名称:k-line-print,代码行数:28,代码来源:GuiDockContext.cpp

示例2: 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

示例3: GetDockedVisibleCount

int CDockBar::GetDockedVisibleCount() const
{
	int nCount = 0;
	for (int i = 0; i < m_arrBars.GetSize(); i++)
	{
		CControlBar* pBar = (CControlBar*)m_arrBars[i];
		ASSERT(pBar == NULL || pBar->IsKindOf(RUNTIME_CLASS(CControlBar)));
		if (pBar != NULL && pBar->IsVisible())
			nCount++;
	}
	return nCount;
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:12,代码来源:bardock.cpp

示例4: while

CControlBar *CFrameWnd::GetControlBar( UINT nID )
/***********************************************/
{
    POSITION position = m_listControlBars.GetHeadPosition();
    while( position != NULL ) {
        CControlBar *pBar = (CControlBar *)m_listControlBars.GetNext( position );
        ASSERT( pBar != NULL );
        ASSERT( pBar->IsKindOf( RUNTIME_CLASS( CControlBar ) ) );
        if( pBar->GetDlgCtrlID() == nID ) {
            return( pBar );
        }
    }
    return( NULL );
}
开发者ID:ArmstrongJ,项目名称:open-watcom-v2,代码行数:14,代码来源:framewnd.cpp

示例5: OnNcLButtonDown

void CMiniDockFrameWnd::OnNcLButtonDown(UINT nHitTest, CPoint point)
{
	if (nHitTest == HTCAPTION)
	{
		// special activation for floating toolbars
		ActivateTopParent();

		// initiate toolbar drag for non-CBRS_FLOAT_MULTI toolbars
		if ((m_wndDockBar.m_dwStyle & CBRS_FLOAT_MULTI) == 0)
		{
			CControlBar* pBar = (CControlBar*)m_wndDockBar.m_arrBars[1];
			ASSERT(pBar != NULL);
			ASSERT(pBar->IsKindOf(RUNTIME_CLASS(CControlBar)));
			ASSERT(pBar->m_pDockContext != NULL);
			pBar->m_pDockContext->StartDrag(point);
			return;
		}
	}
	CMiniFrameWnd::OnNcLButtonDown(nHitTest, point);
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:20,代码来源:bardock.cpp

示例6: OnNcLButtonDown

void CExtMiniDockFrameWnd::OnNcLButtonDown(UINT nHitTest, CPoint point)
{
CExtControlBar * pExtBar = GetControlBarExt();
CPoint p(point);
CRect rcWnd;
	GetWindowRect( &rcWnd );
	p.Offset( -rcWnd.left, -rcWnd.top );
	if( m_rcBtnHideBar.PtInRect( p ) )
		return;
	if( nHitTest == HTCAPTION )
	{
		ActivateTopParent();
		BringWindowToTop();
		if( (m_wndDockBar.m_dwStyle & CBRS_FLOAT_MULTI) == 0 )
		{
			int nPos = 1;
			CControlBar* pBar = NULL;
			while(
				pBar == NULL
				&& nPos < m_wndDockBar.m_arrBars.GetSize()
				)
				pBar =
					reinterpret_cast < CExtDockBar & >
						(m_wndDockBar). GetDockedControlBar(nPos++);
			ASSERT(pBar != NULL);
			ASSERT_KINDOF( CControlBar, pBar );
			ASSERT( pBar->m_pDockContext != NULL );
			if( pExtBar == NULL
				|| (!pExtBar->IsShowContentWhenDragging())
				)
			{
				pBar->m_pDockContext->StartDrag(point);
				return;
			}
			int nCyGripper =
				min(
					pExtBar->m_rcGrip.Width(),
					pExtBar->m_rcGrip.Height()
					);
			pExtBar->_DraggingStart(
				point,
				point
					- rcWnd.TopLeft()
					- CPoint( nCyGripper, nCyGripper/2 )
				);
			return;
		}
	}
	else if( nHitTest >= HTSIZEFIRST && nHitTest <= HTSIZELAST )
	{
		ActivateTopParent();
		int nPos = 1;
		CControlBar * pBar = NULL;
		while(
			pBar == NULL
			&& nPos < m_wndDockBar.m_arrBars.GetSize()
			)
			pBar =
				reinterpret_cast < CExtDockBar & >
					(m_wndDockBar).GetDockedControlBar(nPos++);
		ASSERT(pBar != NULL);
		ASSERT_KINDOF(CControlBar, pBar);
		ASSERT(pBar->m_pDockContext != NULL);
		ASSERT( (m_wndDockBar.m_dwStyle & CBRS_FLOAT_MULTI) == 0 );
		if(	!pBar->IsKindOf(RUNTIME_CLASS(CExtControlBar)) )
			CMiniDockFrameWnd::OnNcLButtonDown( nHitTest, point);
		else
		{
			CExtControlBar * pExtBar =
				(CExtControlBar *)pBar;
			if( !pExtBar->IsShowContentWhenDragging() )
			{
				pBar->m_pDockContext->StartResize(nHitTest,point);
				return;
			}
			ClientToScreen( &point );
			_ResizingStart( nHitTest, point );
		}
		return;
	}
	else if( nHitTest == HTMINBUTTON
		|| nHitTest == HTMAXBUTTON
		|| nHitTest == HTGROWBOX
		)
		return;
	
	CMiniFrameWnd::OnNcLButtonDown( nHitTest, point );
}
开发者ID:darwinbeing,项目名称:trade,代码行数:88,代码来源:ExtMiniDockFrameWnd.cpp

示例7: CalcFixedLayout

CSize CGuiDocBarExten::CalcFixedLayout(BOOL bStretch, BOOL bHorz)
{
	ASSERT_VALID(this);

	CSize sizeFixed = CControlBar::CalcFixedLayout(bStretch, bHorz);
	
	// get max size
	CSize sizeMax;
	if (!m_rectLayout.IsRectEmpty())
	{
		CRect rect = m_rectLayout;
		CalcInsideRect(rect, bHorz);
		sizeMax = rect.Size();
	}
	else
	{
		CRect rectFrame;
		CFrameWnd* pFrame = GetParentFrame();
		pFrame->GetClientRect(&rectFrame);
		sizeMax = rectFrame.Size();
	}

	// prepare for layout
	AFX_SIZEPARENTPARAMS layout;
	layout.hDWP = m_bLayoutQuery ?
		NULL : ::BeginDeferWindowPos(m_arrBars.GetSize());
	int cxBorder = 2, cyBorder = 2;
	CPoint pt(-cxBorder, -cyBorder);
	int nWidth = 0;

	BOOL bWrapped = FALSE;

	// layout all the control bars
	for (int nPos = 0; nPos < m_arrBars.GetSize(); nPos++)
	{
		CControlBar* pBar = GetDockedControlBar(nPos);
		void* pVoid = m_arrBars[nPos];

		if (pBar != NULL)
		{
			if(pBar->IsKindOf(RUNTIME_CLASS(CGuiToolBarWnd)) ||
				pBar->IsKindOf(RUNTIME_CLASS(CMenuBar))	)
				cxBorder = cyBorder = 0;
			else
				cxBorder = cyBorder = 2;

			if (pBar->IsVisible())
			{
				// get ideal rect for bar
				DWORD dwMode = 0;
				if ((pBar->m_dwStyle & CBRS_SIZE_DYNAMIC) &&
					(pBar->m_dwStyle & CBRS_FLOATING))
					dwMode |= LM_HORZ | LM_MRUWIDTH;
				else if (pBar->m_dwStyle & CBRS_ORIENT_HORZ)
					dwMode |= LM_HORZ | LM_HORZDOCK;
				else
					dwMode |=  LM_VERTDOCK;

				CSize sizeBar = pBar->CalcDynamicLayout(-1, dwMode);

				CRect rect(pt, sizeBar);

				// get current rect for bar
				CRect rectBar;
				pBar->GetWindowRect(&rectBar);
				ScreenToClient(&rectBar);

				if (bHorz)
				{
					// Offset Calculated Rect out to Actual
					if (rectBar.left > rect.left && !m_bFloating)
						rect.OffsetRect(rectBar.left - rect.left, 0);

					// If ControlBar goes off the right, then right justify
					if (rect.right > sizeMax.cx && !m_bFloating)
					{
						int x = rect.Width() - cxBorder;
						x = max(sizeMax.cx - x, pt.x);
						rect.OffsetRect(x - rect.left, 0);
					}

					// If ControlBar has been wrapped, then left justify
					if (bWrapped)
					{
						bWrapped = FALSE;
						rect.OffsetRect(-(rect.left + cxBorder), 0);
					}
					// If ControlBar is completely invisible, then wrap it
					else if ((rect.left >= (sizeMax.cx - cxBorder)) &&
						(nPos > 0) && (m_arrBars[nPos - 1] != NULL))
					{
						m_arrBars.InsertAt(nPos, (CObject*)NULL);
						pBar = NULL; pVoid = NULL;
						bWrapped = TRUE;
					}
					if (!bWrapped)
					{
						if (rect != rectBar)
						{
							if (!m_bLayoutQuery &&
//.........这里部分代码省略.........
开发者ID:neil-yi,项目名称:ffsource,代码行数:101,代码来源:GuiDocBarExten.cpp

示例8: OnSetPreviewMode

void CFrameWnd::OnSetPreviewMode( BOOL bPreview, CPrintPreviewState *pState )
/***************************************************************************/
{
    ASSERT( pState != NULL );
    
    DWORD       dwSaveStates = 0L;
    POSITION    position = m_listControlBars.GetHeadPosition();
    while( position != NULL ) {
        CControlBar *pBar = (CControlBar *)m_listControlBars.GetNext( position );
        ASSERT( pBar != NULL );
        ASSERT( pBar->IsKindOf( RUNTIME_CLASS( CControlBar ) ) );

        DWORD dwID = pBar->GetDlgCtrlID();
        if( dwID >= AFX_IDW_CONTROLBAR_FIRST && dwID < AFX_IDW_CONTROLBAR_FIRST + 32 ) {
            DWORD dwThisState = AFX_CONTROLBAR_MASK( dwID );
            if( pBar->IsWindowVisible() ) {
                dwSaveStates |= dwThisState;
            }
            if( !(pBar->IsDockBar() && pBar->GetDlgCtrlID() == AFX_IDW_DOCKBAR_FLOAT) ) {
                ShowControlBar( pBar, pState->dwStates & dwThisState, TRUE );
            }
        }
    }
    pState->dwStates = dwSaveStates;
    
    if( bPreview ) {
        m_lpfnCloseProc = pState->lpfnCloseProc;
        
        pState->hMenu = ::GetMenu( m_hWnd );
        ::SetMenu( m_hWnd, NULL );
        pState->hAccelTable = m_hAccelTable;
        m_hAccelTable = NULL;
        LoadAccelTable( MAKEINTRESOURCE( AFX_IDR_PREVIEW_ACCEL ) );

        HWND hWndPane = ::GetDlgItem( m_hWnd, pState->nIDMainPane );
        if( hWndPane != NULL ) {
            ::ShowWindow( hWndPane, SW_HIDE );
        }
        hWndPane = ::GetDlgItem( m_hWnd, AFX_IDW_PANE_FIRST );
        if( hWndPane != NULL ) {
            ::SetWindowLong( hWndPane, GWL_ID, AFX_IDW_PANE_SAVE );
        }
    } else {
        m_lpfnCloseProc = NULL;
        
        if( pState->hMenu != NULL ) {
            ::SetMenu( m_hWnd, pState->hMenu );
            pState->hMenu = NULL;
        }
        if( pState->hAccelTable != NULL ) {
            m_hAccelTable = pState->hAccelTable;
            pState->hAccelTable = NULL;
        }

        HWND hWndPane = ::GetDlgItem( m_hWnd, AFX_IDW_PANE_SAVE );
        if( hWndPane != NULL ) {
            ::SetWindowLong( hWndPane, GWL_ID, AFX_IDW_PANE_FIRST );
        }
        hWndPane = ::GetDlgItem( m_hWnd, pState->nIDMainPane );
        if( hWndPane != NULL ) {
            ::ShowWindow( hWndPane, SW_SHOW );
        }
    }
}
开发者ID:ArmstrongJ,项目名称:open-watcom-v2,代码行数:64,代码来源:framewnd.cpp

示例9: CanDock

DWORD CGuiDockContext::CanDock(CRect rect, DWORD dwDockStyle, CDockBar** ppDockBar)
{
	// dwDockStyle -- allowable styles of bar
	// don't allow to dock to floating unless multi is specified
	BOOL bTipoToolBar=m_pBar->IsKindOf(RUNTIME_CLASS( CGuiToolBarWnd)) ||
		              m_pBar->IsKindOf(RUNTIME_CLASS( CMenuBar));
	dwDockStyle &= CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI;
	if (ppDockBar != NULL)
		*ppDockBar = NULL;
	POSITION pos = m_pDockSite->m_listControlBars.GetHeadPosition();
	while (pos != NULL)
	{
		CDockBar* pDockBar = (CDockBar*)m_pDockSite->m_listControlBars.GetNext(pos);
		if (pDockBar->IsDockBar() && pDockBar->IsWindowVisible() &&
			(pDockBar->m_dwStyle & dwDockStyle & CBRS_ALIGN_ANY) &&
			(!pDockBar->m_bFloating ||
				(dwDockStyle & pDockBar->m_dwStyle & CBRS_FLOAT_MULTI)))
		{
		
				int nSize=pDockBar->m_arrBars.GetSize();
				for (int i=0;i <nSize;  i++)
				{
					UINT m_nDockBarID = pDockBar->GetDlgCtrlID();
					CControlBar* pBar;
					 pBar = (CControlBar*) pDockBar->m_arrBars[i];
					 if (HIWORD(pBar) == 0) continue; // placeholder
					 if (!pBar->IsVisible()) continue;
					 CRect rectBar;
					 pBar->GetWindowRect(&rectBar);
					 if (rectBar.Width() == 0)
						rectBar.right++;
					 if (rectBar.Height() == 0)
							rectBar.bottom++;
					 CRect rectBar1;
					 pDockBar->GetWindowRect(&rectBar1);
					 if (dwDockStyle==CBRS_ORIENT_VERT)
					 {
						 if (m_nDockBarID==AFX_IDW_DOCKBAR_LEFT)
					 		rectBar1.right=rectBar1.left+10;
						 if(m_nDockBarID==AFX_IDW_DOCKBAR_RIGHT)
							 rectBar1.left=rectBar1.right-10;
					 }
					 else
					 {

						if (m_nDockBarID==AFX_IDW_DOCKBAR_BOTTOM)
							rectBar1.top=rectBar1.bottom-10;
						if (m_nDockBarID==AFX_IDW_DOCKBAR_TOP)
							rectBar1.bottom=rectBar1.top+10;
						
					 }
					 if (rectBar1.IntersectRect(rectBar1, rect))
					 {
						if (ppDockBar != NULL)
							
							*ppDockBar = pDockBar;
						
						return pDockBar->m_dwStyle & dwDockStyle;
					 }
			

					//***********************************************
					if (rectBar.IntersectRect(rectBar, rect))
					{
							if (bTipoToolBar)
							{
								if (pBar->IsKindOf(RUNTIME_CLASS( CGuiControlBar)))
									return 0;
							}
							if (ppDockBar != NULL)
								*ppDockBar = pDockBar;
							return pDockBar->m_dwStyle & dwDockStyle;
							
						 
							
					}
					 
				}//fin del for
							
		
			CRect rectBar;
			pDockBar->GetWindowRect(&rectBar);
			if (rectBar.Width() == 0)
				rectBar.right++;
			if (rectBar.Height() == 0)
				rectBar.bottom++;
			if (rectBar.IntersectRect(rectBar, rect))
			{
				if (ppDockBar != NULL)
					*ppDockBar = pDockBar;
				return pDockBar->m_dwStyle & dwDockStyle;
			}
		}
	}
	return 0;
}
开发者ID:ZhaoboMeng,项目名称:k-line-print,代码行数:96,代码来源:GuiDockContext.cpp

示例10: CalcFixedLayout

CSize CExtDockBar::CalcFixedLayout(
	BOOL bStretch,
	BOOL bHorz
	)
{
	// based on MFC's source of
	// CDockBar::CalcFixedLayout()
	ASSERT_VALID(this);
CSize sizeFixed =
		CControlBar::CalcFixedLayout( bStretch, bHorz );
	// get max size
CSize sizeMax;
	if( !m_rectLayout.IsRectEmpty() )
		sizeMax = m_rectLayout.Size();
	else
	{
		CFrameWnd * pFrame = GetParentFrame();
		CRect rcFrameWindow;
		pFrame->GetClientRect( &rcFrameWindow );
		sizeMax = rcFrameWindow.Size();
	}
	// prepare for layout
AFX_SIZEPARENTPARAMS layout;
	layout.hDWP = m_bLayoutQuery ?
		NULL : ::BeginDeferWindowPos( m_arrBars.GetSize() );

CPoint pt( 0, 0 );
int nWidth = 0;

BOOL bWrapped = FALSE;

	for( int nPos = 0; nPos < m_arrBars.GetSize(); nPos++ )
	{ // layout all the control bars
		CControlBar * pBar = GetDockedControlBar(nPos);
		void * pVoid = m_arrBars[nPos];

		if( pBar != NULL )
		{
			CRect rcBarWin, rcBarClient;
			pBar->GetWindowRect( &rcBarWin );
			pBar->ScreenToClient( & rcBarWin );
			pBar->GetClientRect( &rcBarClient );
			CSize sizeBarMin =
				rcBarWin.Size() - rcBarClient.Size();

			if(	pBar->IsKindOf(RUNTIME_CLASS(CExtControlBar)) )
			{
				if( ! ((CExtControlBar*)pBar)->m_bFixedMode )
				{
					sizeBarMin =
						CSize(
							((CExtControlBar *)pBar)->_CalcDesiredMinHW(),
							((CExtControlBar *)pBar)->_CalcDesiredMinVH()
							);
				} // if( ! ((CExtControlBar*)pBar)->m_bFixedMode )
			} // if(	pBar->IsKindOf(RUNTIME_CLASS(CExtControlBar)) )
			if( pBar->IsVisible() )
			{
				// get ideal rect for bar
				DWORD dwMode = 0;
				if(	(pBar->m_dwStyle & CBRS_SIZE_DYNAMIC)
					&&
					(pBar->m_dwStyle & CBRS_FLOATING)
					)
					dwMode |= LM_HORZ | LM_MRUWIDTH;
				else if(pBar->m_dwStyle & CBRS_ORIENT_HORZ)
					dwMode |= LM_HORZ | LM_HORZDOCK;
				else
					dwMode |=  LM_VERTDOCK;

				CSize sizeBar =
					pBar->CalcDynamicLayout(-1, dwMode);
				BOOL bIsMenuBar = FALSE;

				if( pBar->IsKindOf(RUNTIME_CLASS(CExtMenuControlBar)) )
				{
					bIsMenuBar = TRUE;
					if(dwMode & LM_HORZDOCK)
						sizeBar.cx = sizeMax.cx;
					else if(dwMode & LM_VERTDOCK)
						sizeBar.cy = sizeMax.cy;
				}

				CRect rc(pt, sizeBar);

				// get current rect for bar
				CRect rcBar;
				pBar->GetWindowRect( &rcBar );
				ScreenToClient( &rcBar );

				BOOL bMenuIsCutted = FALSE;

				if( bHorz )
				{
					// Offset Calculated Rect out to Actual
					if(	rcBar.left > rc.left
						&& !m_bFloating
						)
						rc.OffsetRect(
							rcBar.left - rc.left,
//.........这里部分代码省略.........
开发者ID:ZhaoboMeng,项目名称:k-line-print,代码行数:101,代码来源:ExtDockBar.cpp


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