Ejemplo n.º 1
0
bool ZMeshViewList::OnCommand(MWidget* pWidget, const char* szMessage)
{
    //if(pWidget==m_pLeft && strcmp(szMessage, MBTN_CLK_MSG)==0){
    //	if(m_nItemStartIndex>0){
    //		m_nItemStartIndex--;
    //		RecalcBounds();
    //	}
    //	return true;
    //}
    //else if(pWidget==m_pRight && strcmp(szMessage, MBTN_CLK_MSG)==0){
    //	if(m_nItemStartIndex+GetVisibleCount()<GetItemCount()){
    //		m_nItemStartIndex++;
    //		RecalcBounds();
    //	}
    //	return true;
    //}
    if(pWidget==m_pBmLeft && strcmp(szMessage, MBTN_CLK_MSG)==0) {
        if(m_nItemStartIndex>0) {
            m_nItemStartIndex--;
            RecalcBounds();
        }
        return true;
    }
    else if(pWidget==m_pBmRight && strcmp(szMessage, MBTN_CLK_MSG)==0) {
        if(m_nItemStartIndex+GetVisibleCount()<GetItemCount()) {
            m_nItemStartIndex++;
            RecalcBounds();
        }
        return true;
    }
    return false;
}
Ejemplo n.º 2
0
// point is in logical coordinates
void CDrawPoly::AddPoint(const CPoint& point, CDrawView* pView)
{
	ASSERT_VALID(this);
	if (m_nPoints == m_nAllocPoints)
	{
		CPoint* newPoints = new CPoint[m_nAllocPoints + 10];
		if (m_points != NULL)
		{
			memcpy(newPoints, m_points, sizeof(CPoint) * m_nAllocPoints);
			delete[] m_points;
		}
		m_points = newPoints;
		m_nAllocPoints += 10;
	}

	if (m_nPoints == 0 || m_points[m_nPoints - 1] != point)
	{
		m_points[m_nPoints++] = point;
		if (!RecalcBounds(pView))
		{
			if (pView == NULL)
				Invalidate();
			else
				pView->InvalObj(this);
		}
		m_pDocument->SetModifiedFlag();
	}
}
Ejemplo n.º 3
0
// point is in logical coordinates
void CDrawPoly::MoveHandleTo(int nHandle, CPoint point, CDrawView* pView)
{
	ASSERT_VALID(this);
	ASSERT(nHandle >= 1 && nHandle <= m_nPoints);
	if (m_points[nHandle - 1] == point)
		return;

	m_points[nHandle - 1] = point;
	RecalcBounds(pView);

	if (pView == NULL)
		Invalidate();
	else
		pView->InvalObj(this);
	m_pDocument->SetModifiedFlag();
}
void CDrawFreeObject::AddPoint(const CPoint& point)
{
	if (m_nPoints == m_nAllocPoints)
	{
		CPoint* newPoints = new CPoint[m_nAllocPoints + 10];
		if (m_points != NULL)
		{
			memcpy_s(newPoints, sizeof(CPoint) * (m_nAllocPoints + 10), m_points, sizeof(CPoint) * m_nAllocPoints);
			delete[] m_points;
			m_points = NULL;
		}
		m_points = newPoints;
		m_nAllocPoints += 10;
	}

	if (m_nPoints == 0 || m_points[m_nPoints - 1] != point)
	{
		m_points[m_nPoints++] = point;
		if(!RecalcBounds())
		{
			m_pDrawCanvas->InvalObject(this);
		}
	}
}
Ejemplo n.º 5
0
void ZMeshViewList::SetItemWidth(int nWidth)
{
    m_nItemWidth = nWidth;
    RecalcBounds();
}
Ejemplo n.º 6
0
void ZMeshViewList::Add(RMesh* pMeshRef)
{
    ZMeshView* pNew = new ZMeshView(NULL, this, this);
    //m_Items.insert(m_Items.end(), pNew);
    RecalcBounds();
}
Ejemplo n.º 7
0
void ZMeshViewList::OnSize(int w, int h)
{
    RecalcBounds();
}