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


C++ CExtControlBar::GetDlgCtrlID方法代码示例

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


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

示例1: _ContextMenuBuild

void CExtDockBar::_ContextMenuBuild(
	CFrameWnd * pFrame,
	CExtPopupMenuWnd * pPopup
	)
{
	ASSERT_VALID( pFrame );
	ASSERT( pPopup != NULL );
ExtControlBarVector_t vBars;
	CExtControlBar::_GetFrameControlBars(
		pFrame,
		vBars
		);
bool bOleInplaceItemActivated =
	CExtControlBar::IsOleIpObjActive( pFrame );

int nBarsCount = vBars.GetSize();
CExtControlBar * pPrevBar = NULL;
	for( int i=0; i<nBarsCount; i++ )
	{
		CExtControlBar * pBar = vBars[i];
		ASSERT_VALID( pBar );
		if( pBar->GetSafeHwnd() == NULL )
			continue;
		// do not include temporary hidden bars
		if( pBar->m_nStateFlags &
				(CControlBar::delayHide | CControlBar::tempHide)
			)
			continue;
		// do not include some bars when OLE inplace object active
		if( bOleInplaceItemActivated &&
				(pBar->m_dwStyle & CBRS_HIDE_INPLACE)
			)
			continue;

		// do not include bars without caption
		CString sBarText;
		pBar->GetWindowText( sBarText );
		if( sBarText.IsEmpty() )
		{
			ASSERT( FALSE );
			continue;
		}

		if( pPrevBar != NULL
			&&
			pPrevBar->m_bFixedMode != pBar->m_bFixedMode
			)
		{
			VERIFY(
				pPopup->ItemInsert(
					CExtPopupMenuWnd::TYPE_SEPARATOR
					)
				);
		}
		pPrevBar = pBar;


		int nBarID = pBar->GetDlgCtrlID();
		ASSERT( CExtCmdManager::IsCommand(nBarID) );
		
		CExtCmdManager::cmd_t cmd;
		cmd.m_nCmdID = nBarID;
		cmd.m_sMenuText = sBarText;
		cmd.TipsLoad();
		g_CmdManager->CmdSetup(
			g_CmdManager->ProfileNameFromWnd( pFrame->GetSafeHwnd() ),
			cmd
			);

		VERIFY(
			pPopup->ItemInsert(
				nBarID
				)
			);
	} // for( int i=0; i<nBarsCount; i++ )
}
开发者ID:ZhaoboMeng,项目名称:k-line-print,代码行数:76,代码来源:ExtDockBar.cpp

示例2: OnTimer

void CExtMiniDockFrameWnd::OnTimer( UINT nIDEvent )
{
CExtControlBar * pExtBar = GetControlBarExt();
	if( nIDEvent == 1 )
	{
		if( pExtBar == NULL )
			return;
		KillTimer(1);
		SetWindowPos(
			NULL,0,0,0,0,
			SWP_NOMOVE|SWP_NOACTIVATE // |SWP_NOSIZE
				|SWP_NOZORDER|SWP_NOOWNERZORDER 
				|SWP_FRAMECHANGED
			);
		return;
	}
	if( nIDEvent == 2 )
	{
		_AnalyzeButtonsHover();
		return;
	}
	if( nIDEvent == 3 )
	{
		if( pExtBar == NULL
			|| _ResizingIsInProgress()
			)
		return;
		RecalcLayout();
		KillTimer(3);
		return;
	}

	if( pExtBar == NULL )
		return;
	ASSERT_VALID( pExtBar );
	if( nIDEvent == (UINT)pExtBar->GetDlgCtrlID() )
	{
		if( _ResizingIsInProgress() )
			return;
		CPoint pt;
		VERIFY( GetCursorPos( &pt ) );
		CWnd * pTempWnd = WindowFromPoint( pt );
		int IsMouseInsideTheWindow =
			IsChild( pTempWnd ) || pTempWnd->m_hWnd == m_hWnd;

		if(	IsMouseInsideTheWindow
			|| IsChild(GetFocus())  
			|| (GetCapture() && pExtBar->m_hWnd == GetCapture()->m_hWnd) 
			|| CExtPopupMenuWnd::IsMenuTracking()
			) 
		{

			if(	IsMouseInsideTheWindow 
				&& !CExtPopupMenuWnd::IsMenuTracking()
				&& IsWindowEnabled()
				&& GetFocus()
				) 
				BringWindowToTop();
		}
	} // if( nIDEvent == (UINT)pExtBar->GetDlgCtrlID() )
}
开发者ID:darwinbeing,项目名称:trade,代码行数:61,代码来源:ExtMiniDockFrameWnd.cpp

示例3: OnTimer

void CExtMiniDockFrameWnd::OnTimer( UINT nIDEvent )
{
CExtControlBar * pExtBar = GetControlBarExt();
	if( nIDEvent == 1 )
	{
		if( pExtBar == NULL )
			return;
		KillTimer( 1 );
		pExtBar->OnNcAreaButtonsReposition();
//		SetWindowPos(
//			NULL,
//			0, 0, 0, 0,
//			SWP_NOREDRAW|SWP_NOSIZE
//				|SWP_NOMOVE|SWP_NOACTIVATE
//				|SWP_NOZORDER|SWP_NOOWNERZORDER 
//				|SWP_FRAMECHANGED
//			);
		return;
	}
	if( nIDEvent == 2 )
	{
		_AnalyzeButtonsHover();
		return;
	}
	if( nIDEvent == 3 )
	{
		if(		pExtBar == NULL
			//|| _ResizingIsInProgress()
			)
			return;
		KillTimer( 3 );
		RecalcLayout();
		pExtBar->OnNcAreaButtonsReposition();
		SendMessage( WM_NCPAINT );
		return;
	}
	if( nIDEvent == 4 )
	{
		if( pExtBar != NULL )
		{
			ASSERT_VALID( pExtBar );
			CPoint point;
			if( ! ::GetCursorPos(&point) )
				return;
			UINT nHT = pExtBar->NcButtons_HitTest( point );
			if( nHT == HTCLIENT )
			{
				PostMessage( WM_NCPAINT );
				pExtBar->m_bNcAreaBtnTracking = false;
			}
		}
		if( !pExtBar->m_bNcAreaBtnTracking )
			KillTimer( 4 );
		return;
	}

	if( pExtBar == NULL )
		return;
	ASSERT_VALID( pExtBar );
	if( nIDEvent == (UINT)pExtBar->GetDlgCtrlID() )
	{
		if( _ResizingIsInProgress() )
			return;
		CPoint pt;
		if( ! ::GetCursorPos( &pt ) )
			return;
		CWnd * pTempWnd = WindowFromPoint( pt );
		int IsMouseInsideTheWindow =
			IsChild( pTempWnd ) || pTempWnd->m_hWnd == m_hWnd;

		if(	IsMouseInsideTheWindow
			|| IsChild(GetFocus())  
			|| (CExtMouseCaptureSink::GetCapture() && pExtBar->m_hWnd == CExtMouseCaptureSink::GetCapture()) 
			|| CExtPopupMenuWnd::IsMenuTracking()
			) 
		{

			if(	IsMouseInsideTheWindow 
				&& !CExtPopupMenuWnd::IsMenuTracking()
				&& IsWindowEnabled()
				&& GetFocus()
				) 
				BringWindowToTop();
		}
	} // if( nIDEvent == (UINT)pExtBar->GetDlgCtrlID() )
}
开发者ID:ngphloc,项目名称:agmagic,代码行数:86,代码来源:ExtMiniDockFrameWnd.cpp


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