Пример #1
0
CSize CXTPMarkupGrid::ArrangeOverride(CSize arrangeSize)
{
	if ((m_pColumnDefinitions->GetCount() == 0 && m_pRowDefinitions->GetCount() == 0) || (m_pCellCachesCollection == NULL))
	{
		int nCount = m_pChildren->GetCount();
		for (int i = 0; i < nCount; i++)
		{
			CXTPMarkupUIElement* pElement = m_pChildren->GetItem(i);
			if (pElement == NULL)
				continue;

			pElement->Arrange(CRect(0, 0, arrangeSize.cx, arrangeSize.cy));
		}
		return arrangeSize;
	}

	SetFinalSize(m_pDefinitionsU, arrangeSize.cx);
	SetFinalSize(m_pDefinitionsV, arrangeSize.cy);
	int nCount = m_pChildren->GetCount();
	for (int i = 0; i < nCount; i++)
	{
		CXTPMarkupUIElement* pElement = m_pChildren->GetItem(i);
		if (pElement == NULL)
			continue;

		CELLCACHE& cellCache =  m_pCellCachesCollection[i];

		int columnIndex = cellCache.nColumnIndex;
		int rowIndex = cellCache.nRowIndex;
		int columnSpan = cellCache.nColumnSpan;
		int rowSpan = cellCache.nRowSpan;

		CRect finalRect(CPoint(m_pDefinitionsU->GetItem(columnIndex)->m_nFinalOffset,
			m_pDefinitionsV->GetItem(rowIndex)->m_nFinalOffset),
			CSize(GetFinalSizeForRange(m_pDefinitionsU, columnIndex, columnSpan),
			GetFinalSizeForRange(m_pDefinitionsV, rowIndex, rowSpan)));

		pElement->Arrange(finalRect);
	}

	return arrangeSize;
}
NS_IMETHODIMP 
nsHTMLEditor::MouseUp(PRInt32 aClientX, PRInt32 aClientY,
                      nsIDOMElement *aTarget)
{
  if (mIsResizing) {
    // we are resizing and release the mouse button, so let's
    // end the resizing process
    mIsResizing = PR_FALSE;
    HideShadowAndInfo();
    SetFinalSize(aClientX, aClientY);
  }
  else if (mIsMoving || mGrabberClicked) {
    if (mIsMoving) {
      mPositioningShadow->SetAttribute(NS_LITERAL_STRING("class"), NS_LITERAL_STRING("hidden"));
      SetFinalPosition(aClientX, aClientY);
    }
    if (mGrabberClicked) {
      EndMoving();
    }
  }
  return NS_OK;
}
Пример #3
0
NS_IMETHODIMP
HTMLEditor::MouseUp(int32_t aClientX,
                    int32_t aClientY,
                    nsIDOMElement* aTarget)
{
  if (mIsResizing) {
    // we are resizing and release the mouse button, so let's
    // end the resizing process
    mIsResizing = false;
    HideShadowAndInfo();
    SetFinalSize(aClientX, aClientY);
  } else if (mIsMoving || mGrabberClicked) {
    if (mIsMoving) {
      mPositioningShadow->SetAttr(kNameSpaceID_None, nsGkAtoms::_class,
                                  NS_LITERAL_STRING("hidden"), true);
      SetFinalPosition(aClientX, aClientY);
    }
    if (mGrabberClicked) {
      EndMoving();
    }
  }
  return NS_OK;
}