コード例 #1
0
CPoint CuStaticRuler::RemoveHeaderMarker(CPoint p)
{
	CPoint point = p;
	if (ExistHeaderMarker(point))
	{
		point = p;
		AdjustPoint(point);

		CaHeaderMarker* pHeader = NULL;
		POSITION px, pos = m_listHeader.GetHeadPosition();
		while (pos != NULL)
		{
			px = pos;
			pHeader = m_listHeader.GetNext (pos);
			CPoint c = pHeader->GetPoint();
			if (c.x == point.x)
			{
				m_listHeader.RemoveAt (px);
				delete pHeader;
				Invalidate();
				return c;
			}
		}
	}
	Invalidate();
	return point;
}
コード例 #2
0
CPoint CuStaticRuler::ChangePoint(CaHeaderMarker* pHeader, CPoint newPoint)
{
	CPoint point = newPoint;
	AdjustPoint(point);
	pHeader->SetPoint (point);
	return point;
}
コード例 #3
0
ファイル: XUI_Wnd.cpp プロジェクト: siangzhang/starworld
		//寻找在某个坐标上的控件
		XUI_Wnd* XUI_Wnd::FindChildInPoint(const iPoint &pt )
		{
			if( !IsVisible() )
				return NULL;

			iPoint adjust( pt );
			AdjustPoint( adjust, true );
			for( size_t i = 0; i < m_pChildren.size(); ++i )
			{
				XUI_Wnd* pElement = m_pChildren[i];
				if( pElement->IsPointIn(adjust) )
					return pElement->FindChildInPoint( adjust - m_WindowPosition );
			}

			return this;
		}
コード例 #4
0
CPoint CuStaticRuler::AddHeaderMarker(CPoint p)
{
	CPoint point = p;
	if (!ExistHeaderMarker(point))
	{
		point = p;
		AdjustPoint(point);
		CaHeaderMarker* pHeader = new CaHeaderMarker(point);
		m_listHeader.AddTail (pHeader);

		CClientDC dc(this);
		DrawHeaderMarker(&dc, pHeader);
	}

	return point;
}
コード例 #5
0
BOOL CuStaticRuler::ExistHeaderMarker(CPoint& point)
{
	CPoint p = point;
	AdjustPoint (p);
	CaHeaderMarker* pHeader = NULL;
	POSITION pos = m_listHeader.GetHeadPosition();
	while (pos != NULL)
	{
		pHeader = m_listHeader.GetNext (pos);
		CPoint c = pHeader->GetPoint();
		if (c.x == p.x)
			return TRUE;
	}

	return FALSE;
}
コード例 #6
0
CaHeaderMarker* CuStaticRuler::GetHeaderMarkerAt(CPoint point)
{
	AdjustPoint(point);

	CaHeaderMarker* pHeader = NULL;
	POSITION pos = m_listHeader.GetHeadPosition();
	while (pos != NULL)
	{
		pHeader = m_listHeader.GetNext (pos);
		CPoint c(pHeader->GetPoint());
		if (c.x == point.x)
		{
			return pHeader;
		}
	}
	return NULL;
}