Beispiel #1
0
		void XUI_Wnd::Render(const iRect& clipper)
		{
			if (!m_bVisible)
				return;

			iRect rcWindow = GetWindowRect();
			ClientToScreen( rcWindow );
			// XUI_SetClipping( rcWindow.left, rcWindow.top, rcWindow.Width(), rcWindow.Height() );
			//绘制自己
			if( m_bOwnerDraw )
			{
			}
			else
			{
				RenderSelf( clipper.TopLeft() );
				if( GetFlags(FLAGS_EDIT) )
				{
					// XUI_SetClipping( rcWindow.left-HANDLE_EDGE, rcWindow.top-HANDLE_EDGE, rcWindow.Width()+HANDLE_EDGE*2, rcWindow.Height()+HANDLE_EDGE*2 );
					RenderEdit( clipper.TopLeft() );
				}
			}

			//绘制子控件
			for (_uint32 i=0; i<m_pChildren.size(); i++)
			{
				m_pChildren[i]->Render(rcWindow);
			}
		}
Beispiel #2
0
		//--------------------------------------------------------//
		//	created:	19:11:2009   18:29
		//	filename: 	d:\Develop\StarGame\GameSDK\GameUILib\Source\XUI_Wnd.cpp
		//	author:		Albert.xu
		//
		//	purpose:	查找能包容整个矩形的最深Wnd
		//--------------------------------------------------------//
		bool XUI_Wnd::FindRectIn( const iRect &rc, std::list< XUI_Wnd* >& l )
		{
			iRect rcAdjust(rc);
			AdjustWindow( rcAdjust, true);

			iRect rcWindow = GetWindowRect();
			if( rcWindow.PtInRect( rc.TopLeft() ) && rcWindow.PtInRect( rc.BottomRight() ) )
			{
				for( size_t i = 0; i < m_pChildren.size(); ++i )
				{
					XUI_Wnd* pElement = m_pChildren[i];
					iRect rcChildren = pElement->GetWindowRect();
					if( rc.PtInRect( rcChildren.TopLeft() ) && rc.PtInRect( rcChildren.BottomRight() ) )
					{
						l.push_back( pElement );
					}
					else if( pElement->FindRectIn( rcAdjust - m_WindowPosition, l ) )
					{
						return true;
					}
				}
				return true;
			}
			return false;
		}