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


C++ CLTGUICtrl::IsEnabled方法代码示例

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


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

示例1: OnRButtonUp

LTBOOL CFolderDisplay::OnRButtonUp(int x, int y)
{
	// Get the control that the click was on
	int nControlIndex=0;
	if (GetControlUnderPoint(x, y, &nControlIndex))
	{
		CLTGUICtrl* pCtrl = GetControl(nControlIndex);
		if (m_pCaptureCtrl && pCtrl != m_pCaptureCtrl)
            return LTFALSE;

		// If the mouse is over the same control now as it was when the down message was called
		// then send the "left" message to the control.
		if (nControlIndex == m_nRMouseDownItemSel)
		{
			if (pCtrl->IsEnabled())
			{
				if (GetSelectedControl() == m_pRendererCtrl)
				{

					// Get the current resolution
					FolderDisplayResolution currentResolution=GetCurrentSelectedResolution();
                    LTBOOL handled = pCtrl->OnRButtonUp(x,y);
					if (handled)
					{
						SetupResolutionCtrl();
						// Set the resolution for the control
						SetCurrentCtrlResolution(currentResolution);
					}
					return handled;
				}
				else if (pCtrl == m_pHardwareCursor)
				{
					return OnLeft();
				}
				else
				{
					SetSelection(nControlIndex);
					return CBaseFolder::OnRButtonUp(x,y);
				}
			}
		}
	}
	else
	{
		m_nRMouseDownItemSel= kNoSelection;
	}
    return LTFALSE;
}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:48,代码来源:FolderDisplay.cpp

示例2: OnMouseMove

// Handles the mouse move message
LTBOOL CListCtrl::OnMouseMove(int x, int y)
{
	x += g_pInterfaceResMgr->GetXOffset();
	y += g_pInterfaceResMgr->GetYOffset();
	int nControlUnderPoint=0;
	CLTGUICtrl *pCtrl = GetControlUnderPoint(x, y, &nControlUnderPoint);
	if (m_pUp && CanScrollUp()) 
		m_pUp->Select(pCtrl == m_pUp);
	if (m_pDown && CanScrollDown()) 
		m_pDown->Select(pCtrl == m_pDown);

	// If m_bEnableMouseMoveSelect is TRUE then select the item that the mouse is over
	if (m_bEnableMouseMoveSelect)
	{
		if(pCtrl && nControlUnderPoint >= 0)
		{
			// Make sure we're enabled
			if(!pCtrl->IsEnabled())
                return LTFALSE;

			if (GetSelectedItem() != nControlUnderPoint)
			{
				SelectItem(nControlUnderPoint);

                return LTTRUE;
			}
		}
		else
		{
/*
			//if not on anything select nothing
			if ( m_nCurrentIndex < (int)m_controlArray.GetSize() )
			{
				m_controlArray[m_nCurrentIndex]->Select(FALSE);
			}
			m_nCurrentIndex = kNoSelection;
*/
		}
	}

    return LTFALSE;

}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:44,代码来源:ListCtrl.cpp

示例3: OnLButtonDblClick

LTBOOL CListCtrl::OnLButtonDblClick(int x, int y)
{
	x += g_pInterfaceResMgr->GetXOffset();
	y += g_pInterfaceResMgr->GetYOffset();
	m_fNextScrollTime = -1.0f;
	// Get the control that the click was on
	int nControlIndex=0;
	CLTGUICtrl *pCtrl = GetControlUnderPoint(x, y, &nControlIndex);
	if(pCtrl)
	{
		// Make sure we're enabled
		if(!pCtrl->IsEnabled())
            return LTFALSE;


		// If the mouse is over the same control now as it was when the down message was called
		// then send the "enter" message to the control.
		if (nControlIndex == m_nMouseDownItemSel)
		{
			if (nControlIndex == kUpSel)
			{
				return (!CanScrollUp() || ScrollUp());
			}
			else if (nControlIndex == kDownSel)
			{
				return (!CanScrollDown() || ScrollDown());
			}
			else
			{
				return m_controlArray[nControlIndex]->OnLButtonDblClick( x,  y);
			}
		}
	}
	else
	{
		m_nMouseDownItemSel=kNoSelection;
	}
    return LTFALSE;
}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:39,代码来源:ListCtrl.cpp

示例4: OnLButtonDown

// Handles the left button down message
LTBOOL CListCtrl::OnLButtonDown(int x, int y)
{
	x += g_pInterfaceResMgr->GetXOffset();
	y += g_pInterfaceResMgr->GetYOffset();

	// Get the control that the click was on
	int nControlIndex=0;
	CLTGUICtrl *pCtrl = GetControlUnderPoint(x, y, &nControlIndex);
	if(pCtrl)
	{
		// Make sure we're enabled
		if(!pCtrl->IsEnabled())
            return LTFALSE;

		if (nControlIndex >= 0 && m_bEnableMouseClickSelect)
		{
			// Select the control
			SelectItem(nControlIndex);
		}

		if ((nControlIndex == kUpSel && CanScrollUp())|| (nControlIndex == kDownSel && CanScrollDown()))
            m_fNextScrollTime = g_pLTClient->GetTime()+m_fScrollFirstDelay;

		// Record this control as the one being selected from the mouse click.
		// If the mouse is still over it on the UP message, then the "enter" message will be sent.
		m_nMouseDownItemSel=nControlIndex;

        return LTTRUE;
	}
	else
	{
		// This clears the index for what item was selected from a mouse down message
		m_nMouseDownItemSel=kNoSelection;

        return LTFALSE;
	}
}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:38,代码来源:ListCtrl.cpp


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