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


C++ Panel::IsCursorOver方法代码示例

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


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

示例1: OnThink

void CEditorRoot::OnThink(void)
{
	BaseClass::OnThink();

	if ( IsBuildModeActive() )
	{
		Panel *pBuild = FindChildByName( "BuildModeDialog" );
		if ( pBuild && !pBuild->IsCursorOver() && input()->IsKeyDown( KEY_LCONTROL ) )
			pBuild->MoveToFront();
	}

	input()->GetCursorPosition( Mx, My );
	ScreenToLocal(Mx,My);

	Vector2D mCoords = GetSafeFlowgraph()->GetMousePosInNodeSpace();
	m_pLabel_Coords->SetText( VarArgs( "position: %10.1f / %10.1f", mCoords.x, mCoords.y ) );

	static CFastTimer _timer;
	_timer.End();
	double _frametime = _timer.GetDuration().GetSeconds();
	_timer.Start();
	m_pLabel_FrameTime->SetText( VarArgs( "fps: %4.1f, ms: %8.7f", 1.0f/max( 0.00001f, _frametime ), _frametime ) );

	if ( m_bPainting )
		input()->SetCursorOveride( dc_hand );

	// FML
	SortButtons();
	//if ( m_bNeedsButtonPush )
	//	SortButtons();

#ifdef SHADER_EDITOR_DLL_SWARM
	VPANEL modal = input()->GetAppModalSurface();
	static bool bFailed = false;

	if ( !bFailed && modal > 0 && modal != GetVPanel() )
	{
		if ( !m_bHalfView && IsVisible() && !ipanel()->HasParent( modal, GetVPanel() ) )
		{
			const char *pszModalName = ipanel()->GetName( modal );
			const char *names[] = {
				"SteamCloudConfirmation",
				"AddonAssociation",
			};

			const int numnames = ARRAYSIZE( names );
			for ( int i = 0; i < numnames; i++ )
			{
				if ( !Q_stricmp( names[i], pszModalName ) )
				{
					ToggleVisible();
					return;
				}
			}

			bFailed = true;
		}
	}
#endif
}
开发者ID:Biohazard90,项目名称:source-shader-editor,代码行数:60,代码来源:veditorroot.cpp

示例2: GetCurrentCrosshair

int CASWHudCrosshair::GetCurrentCrosshair( int x, int y )
{
	CRadialMenu *pRadialMenu = GET_HUDELEMENT( CRadialMenu );
	if ( !pRadialMenu->IsFading() && pRadialMenu->GetAlpha() > 0 )
	{
		return m_nHackActiveCrosshairTexture;
	}

	CASWHudMinimap *pMap = GET_HUDELEMENT( CASWHudMinimap );
	bool bMouseIsOverMinimap = ( pMap && pMap->UseDrawCrosshair( x, y ) );
	if ( bMouseIsOverMinimap )
	{
		return m_nMinimapDrawCrosshairTexture;
	}

	CASW_VGUI_Computer_Frame *pComputerFrame = dynamic_cast< CASW_VGUI_Computer_Frame* >( GetClientMode()->GetPanelFromViewport( "ComputerContainer/VGUIComputerFrame" ) );
	if ( pComputerFrame )
	{
		if ( pComputerFrame->m_pMenuPanel )
		{
			CASW_VGUI_Computer_Tumbler_Hack *pTumbler = dynamic_cast< CASW_VGUI_Computer_Tumbler_Hack* >( pComputerFrame->m_pMenuPanel->m_hCurrentPage.Get() );
			if ( pTumbler )
			{
				if ( pTumbler->m_iMouseOverTumblerControl != -1 )
				{
					return m_nHackActiveCrosshairTexture;
				}
			}
		}
	}
	else
	{
		CASW_VGUI_Hack_Wire_Tile *pWireTile = dynamic_cast< CASW_VGUI_Hack_Wire_Tile* >( GetClientMode()->GetPanelFromViewport( "WireTileContainer/HackWireTile" ) );
		if ( pWireTile )
		{
			if ( pWireTile->IsCursorOverWireTile( x, y ) )
			{
				return m_nHackActiveCrosshairTexture;
			}
		}
	}

	Panel *pPanel = GetClientMode()->GetPanelFromViewport( "ComputerContainer" );
	if ( !pPanel )
	{
		pPanel = GetClientMode()->GetPanelFromViewport( "WireTileContainer" );
	}

	if ( pPanel && pPanel->IsCursorOver() )
	{
		return m_nHackCrosshairTexture;
	}

	return m_nCrosshairTexture;
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:55,代码来源:asw_hud_crosshair.cpp


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