CXTPChartDeviceCommand* CXTPChartAreaSeriesView::CreateDeviceCommand(CXTPChartDeviceContext* pDC)
{
	CXTPChartDeviceCommand* pSeriesCommand = new CXTPChartHitTestElementCommand(m_pSeries);
	CXTPChartDeviceCommand* pCommand = pSeriesCommand->AddChildCommand(new CXTPChartPolygonAntialiasingDeviceCommand());

	CXTPChartAreaSeriesStyle* pStyle = (CXTPChartAreaSeriesStyle*)GetStyle();

	CXTPChartAxis* pAxisY = GetAxisViewY()->GetAxis();

	CXTPChartColor clrBorder = GetBorderActualColor();

	double dZero = max(0, pAxisY->GetRange()->GetMinValue());

	int nCount = m_pPointsView->GetCount();
	if (nCount > 1)
	{
		CXTPChartPointSeriesPointView* pPointView =  (CXTPChartPointSeriesPointView*)m_pPointsView->GetAt(0);

		CXTPChartPointF pointPrev = GetScreenPoint(pPointView->GetPoint()->GetInternalArgumentValue(), pPointView->m_dInternalValue);

		CXTPChartPoints arrPoints;
		arrPoints.Add(GetScreenPoint(pPointView->GetPoint()->GetInternalArgumentValue(), dZero));

		for (int i = 1; i < nCount; i++)
		{
			pPointView =  (CXTPChartPointSeriesPointView*)m_pPointsView->GetAt(i);
			CXTPChartPointF pointNext = pPointView->GetScreenPoint();

			arrPoints.Add(pointPrev);

			pointPrev = pointNext;
		}

		arrPoints.Add(pointPrev);

		pPointView =  (CXTPChartPointSeriesPointView*)m_pPointsView->GetAt(nCount - 1);

		arrPoints.Add(GetScreenPoint(pPointView->GetPoint()->GetInternalArgumentValue(), dZero));

		pCommand->AddChildCommand(pStyle->GetFillStyle()->CreateDeviceCommand(arrPoints, GetActualColor(), GetActualColor2()));


		arrPoints.RemoveAt(0);
		arrPoints.RemoveAt(arrPoints.GetSize() - 1);

		if (pStyle->GetBorder()->IsVisible())
			pCommand->AddChildCommand(new CXTPChartSolidPolylineDeviceCommand(arrPoints, clrBorder, pStyle->GetBorder()->GetThickness()));
	}

	pCommand->AddChildCommand(CXTPChartSeriesView::CreateDeviceCommand(pDC));

	return pSeriesCommand;
}
CXTPChartDeviceCommand* CXTPChartHighLowSeriesPointView::CreateDeviceCommand(CXTPChartDeviceContext* pDC)
{
	UNREFERENCED_PARAMETER(pDC);

	CPoint pointOpen = GetScreenPoint(chartOpen).Round();
	CPoint pointClose = GetScreenPoint(chartClose).Round();

	CPoint pointLow = GetScreenPoint(chartLow).Round();
	CPoint pointHight = GetScreenPoint(chartHigh).Round();

	BOOL bUpColor = TRUE;


	CXTPChartSeriesPoint* pPrevPoint = m_pPoint->GetPreviousPoint();
	if (pPrevPoint)
	{
		if (pPrevPoint->GetValue(chartClose) > m_pPoint->GetValue(chartClose))
		{
			bUpColor = FALSE;
		}
	}

	CXTPChartHighLowSeriesView* pView = (CXTPChartHighLowSeriesView*)GetSeriesView();

	CXTPChartAxisView* pAxisView = pView->GetAxisViewX();
	CXTPChartHighLowSeriesStyle* pStyle = (CXTPChartHighLowSeriesStyle*)GetSeriesView()->GetStyle();

	int nWidth = (int)(pAxisView->DistanceToPoint(1) * 0.5);
	if (nWidth < 5)
		nWidth = 5;

	int nLineThickness = pStyle->GetLineThickness();

	nWidth = (nWidth & ~1) + nLineThickness * 3;

	CXTPChartDeviceCommand* pCommand = new CXTPChartHitTestElementCommand(m_pPoint);

	CXTPChartColor color = bUpColor ? pStyle->GetUpColor() : pStyle->GetDownColor();


	pCommand->AddChildCommand(new CXTPChartSolidLineDeviceCommand(
		CXTPChartPointF(pointHight), CXTPChartPointF(pointLow), color, nLineThickness));

	pCommand->AddChildCommand(new CXTPChartSolidLineDeviceCommand(
		CXTPChartPointF(pointOpen), CXTPChartPointF((float)(pointOpen.x - nWidth / 2), (float)pointOpen.y), color, nLineThickness));

	pCommand->AddChildCommand(new CXTPChartSolidLineDeviceCommand(
		CXTPChartPointF(pointClose), CXTPChartPointF((float)(pointClose.x + nWidth / 2), (float)pointClose.y), color, nLineThickness));


	return pCommand;
}
Ejemplo n.º 3
0
NS_IMETHODIMP
nsDOMMouseEvent::GetScreenY(PRInt32* aScreenY)
{
  NS_ENSURE_ARG_POINTER(aScreenY);
  *aScreenY = GetScreenPoint().y;
  return NS_OK;
}
bool RenderHandler::GetScreenPoint(CefRefPtr<CefBrowser> browser,
                            int viewX,
                            int viewY,
                            int& screenX,
                            int& screenY) {
  return GetScreenPoint(GetJNIBrowser(browser), viewX, viewY, screenX, screenY);
}
CXTPChartDeviceCommand* CXTPChartRangeBarSeriesPointView::CreateDeviceCommand(CXTPChartDeviceContext* pDC)
{
	CXTPChartDeviceCommand* pCommand = CXTPChartBarSeriesPointView::CreateDeviceCommand(pDC);

	CXTPChartColor color = GetColor();
	CXTPChartColor color2 = GetColor2();
	CXTPChartColor colorBorder = GetColor().GetDarkColor();


	CXTPChartPointF point = GetScreenPoint(TRUE);
	pCommand->AddChildCommand(((CXTPChartRangeBarSeriesStyle*)GetSeriesView()->GetStyle())->GetMinValueMarker()->CreateDeviceCommand(pDC, point, color, color2, colorBorder));


	point = GetScreenPoint(FALSE);
	pCommand->AddChildCommand(((CXTPChartRangeBarSeriesStyle*)GetSeriesView()->GetStyle())->GetMaxValueMarker()->CreateDeviceCommand(pDC, point, color, color2, colorBorder));


	return pCommand;
}
Ejemplo n.º 6
0
NS_METHOD
nsDOMUIEvent::DuplicatePrivateData()
{
  mClientPoint = GetClientPoint();
  mLayerPoint = GetLayerPoint();
  mPagePoint = GetPagePoint();
  // GetScreenPoint converts mEvent->refPoint to right coordinates.
  nsIntPoint screenPoint = GetScreenPoint();
  nsresult rv = nsDOMEvent::DuplicatePrivateData();
  if (NS_SUCCEEDED(rv)) {
    mEvent->refPoint = screenPoint;
  }
  return rv;
}
CXTPChartDeviceCommand* CXTPChartPointSeriesPointView::CreateDeviceCommand(CXTPChartDeviceContext* pDC)
{
	CXTPChartColor color = GetColor();
	CXTPChartColor color2 = GetColor2();
	CXTPChartColor colorBorder = GetColor().GetDarkColor();

	if (CXTPChartMathUtils::IsNan(m_dInternalValue))
		return NULL;

	CXTPChartDeviceCommand* pCommand = new CXTPChartHitTestElementCommand(m_pPoint);

	CXTPChartPointF point = GetScreenPoint();

	pCommand->AddChildCommand(((CXTPChartPointSeriesStyle*)GetSeriesView()->GetStyle())->GetMarker()->CreateDeviceCommand(pDC, point, color, color2, colorBorder));

	return pCommand;
}
Ejemplo n.º 8
0
void CElcSkinFrameBase::PopupMenu(int nIndex)
{
	m_nActiveItem = nIndex;

	if (m_nActiveItem == -1) {
		return;
	}

	HMENU hMenu = ::GetSubMenu(m_hMenu, nIndex);
	if (!::IsMenu(hMenu)) {
		ASSERT(0);
		return;
	}

	CPoint point(m_arrMenu[nIndex].rect.left, m_arrMenu[nIndex].rect.bottom);
	GetScreenPoint(point);

	int nRet = ::TrackPopupMenu(hMenu, 
		TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RETURNCMD,
		point.x,
		point.y,
		0,
		m_hDerive,
		NULL);

	if (nRet != 0) {
		m_bMenuActivated = FALSE;
		m_nActiveItem = -1;

		::PostMessage(m_hDerive, WM_COMMAND, nRet, 0);
	}

	if (!m_bSelfCancelMenu) {
		m_bMenuActivated = FALSE;
		m_nActiveItem = -1;
	}
	else
		m_bSelfCancelMenu = FALSE;

	RedrawMenuBar();
}
Ejemplo n.º 9
0
NS_METHOD nsDOMMouseEvent::GetScreenX(PRInt32* aScreenX)
{
  NS_ENSURE_ARG_POINTER(aScreenX);
  *aScreenX = GetScreenPoint().x;
  return NS_OK;
}
Ejemplo n.º 10
0
/* static */ void
WheelTransaction::OnEvent(WidgetEvent* aEvent)
{
  if (!sTargetFrame) {
    return;
  }

  if (OutOfTime(sTime, GetTimeoutTime())) {
    // Even if the scroll event which is handled after timeout, but onTimeout
    // was not fired by timer, then the scroll event will scroll old frame,
    // therefore, we should call OnTimeout here and ensure to finish the old
    // transaction.
    OnTimeout(nullptr, nullptr);
    return;
  }

  switch (aEvent->mMessage) {
    case eWheel:
      if (sMouseMoved != 0 &&
          OutOfTime(sMouseMoved, GetIgnoreMoveDelayTime())) {
        // Terminate the current mousewheel transaction if the mouse moved more
        // than ignoremovedelay milliseconds ago
        EndTransaction();
      }
      return;
    case eMouseMove:
    case eDragOver: {
      WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
      if (mouseEvent->IsReal()) {
        // If the cursor is moving to be outside the frame,
        // terminate the scrollwheel transaction.
        nsIntPoint pt = GetScreenPoint(mouseEvent);
        nsIntRect r = sTargetFrame->GetScreenRectExternal();
        if (!r.Contains(pt)) {
          EndTransaction();
          return;
        }

        // If the cursor is moving inside the frame, and it is less than
        // ignoremovedelay milliseconds since the last scroll operation, ignore
        // the mouse move; otherwise, record the current mouse move time to be
        // checked later
        if (!sMouseMoved && OutOfTime(sTime, GetIgnoreMoveDelayTime())) {
          sMouseMoved = PR_IntervalToMilliseconds(PR_IntervalNow());
        }
      }
      return;
    }
    case eKeyPress:
    case eKeyUp:
    case eKeyDown:
    case eMouseUp:
    case eMouseDown:
    case eMouseDoubleClick:
    case eMouseClick:
    case eContextMenu:
    case eDrop:
      EndTransaction();
      return;
    default:
      break;
  }
}
Ejemplo n.º 11
0
ZeroRect ZeroInputManager::GetScreenRect() {
	int x = static_cast<int>(GetScreenPoint().x);
	int y = static_cast<int>(GetScreenPoint().y);
	ZeroRect rect(x, y, x + 1, y + 1);
	return rect;
}
Ejemplo n.º 12
0
CCPoint ViewAutoScale::GetScreenPoint(const CCPoint& point, Alignment alignment) {
	return GetScreenPoint(point.x, point.y, alignment);
}