void CXTPChartRadarPointSeriesLabelView::CalculateLayout(CXTPChartDeviceContext* pDC, const CXTPChartPointF& ptAnchorPoint, double dAnchorAngle, const CXTPChartString& text) { double dLineAngle = CXTPChartMathUtils::Degree2Radian(dAnchorAngle); int nBorderThickness = m_pLabel->GetBorder()->GetThickness(); CRect rcPaneRect = GetPaneRect(); rcPaneRect.InflateRect(1, 1); if (!rcPaneRect.PtInRect(CPoint((int)ptAnchorPoint.X, (int)ptAnchorPoint.Y))) return; CXTPChartTextPainter painter(pDC, text, m_pLabel); CXTPChartSizeF szText = painter.GetSize(); CXTPChartPointF ptStartPoint(CXTPChartMathUtils::Round(ptAnchorPoint.X), CXTPChartMathUtils::Round(ptAnchorPoint.Y)); CXTPChartPointF ptFinishPoint(CXTPChartMathUtils::Round(ptAnchorPoint.X + (cos(dLineAngle) * m_pLabel->GetLineLength())), CXTPChartMathUtils::Round(ptAnchorPoint.Y - (sin(dLineAngle) * m_pLabel->GetLineLength()))); CXTPChartRectF rcInnerBounds; CXTPChartRectF rcBounds = CXTPChartSeriesLabelConnectorPainterBase::CalcBorderBoundsForTangentDrawing(ptFinishPoint, dLineAngle, szText, nBorderThickness, rcInnerBounds); CXTPChartSeriesView* pSeriseView = m_pPointView->GetSeriesView(); CXTPChartRadarDiagramView* pDiagramView = (CXTPChartRadarDiagramView*)pSeriseView->GetDiagramView(); pDiagramView->CheckLabelBounds(rcBounds); }
BOOL CSimpleSplitter::CreatePane(int nIndex, CWnd* pPaneWnd, DWORD dwStyle, DWORD dwExStyle, LPCTSTR lpszClassName) { CRect rcPane; ASSERT((nIndex >= 0) && (nIndex < m_nPanes)); m_pane[nIndex] = pPaneWnd; dwStyle |= WS_CHILD | WS_VISIBLE; GetPaneRect(nIndex, rcPane); return pPaneWnd->CreateEx(dwExStyle, lpszClassName, NULL, dwStyle, rcPane, this, AFX_IDW_PANE_FIRST + nIndex); }
void CSimpleSplitter::SetPane(int nIndex, CWnd* pPaneWnd) { CRect rcPane; ASSERT((nIndex >= 0) && (nIndex < m_nPanes)); ASSERT(pPaneWnd); ASSERT(pPaneWnd->m_hWnd); m_pane[nIndex] = pPaneWnd; GetPaneRect(nIndex, rcPane); pPaneWnd->MoveWindow(rcPane, false); }
ALERROR CProfileSession::OnInit (CString *retsError) // OnInit // // Initialize { const CVisualPalette &VI = m_HI.GetVisuals(); GetPaneRect(&m_rcPane); int cxWidth = Min(RectWidth(m_rcPane), MAX_RECORD_WIDTH); m_rcRecords.left = m_rcPane.left + (RectWidth(m_rcPane) - cxWidth) / 2; m_rcRecords.right = m_rcRecords.left + cxWidth; m_rcRecords.top = m_rcPane.top; m_rcRecords.bottom = m_rcPane.bottom; // Create a task to read the profile information and wait until it // finishes. m_HI.AddBackgroundTask(new CReadProfileTask(m_HI, m_Service, RectWidth(m_rcRecords)), 0, this, CMD_READ_COMPLETE); // Create the title CUIHelper Helper(m_HI); IAnimatron *pTitle; Helper.CreateSessionTitle(this, m_Service, CONSTLIT("Scores & Records"), NULL, 0, &pTitle); StartPerformance(pTitle, ID_CTRL_TITLE, CReanimator::SPR_FLAG_DELETE_WHEN_DONE); // Create a wait animation IAnimatron *pAni; VI.CreateWaitAnimation(NULL, ID_CTRL_WAIT, m_rcPane, &pAni); StartPerformance(pAni, ID_CTRL_WAIT, CReanimator::SPR_FLAG_DELETE_WHEN_DONE); // Done return NOERROR; }
CXTPChartDeviceCommand* CXTPChartRadarPointSeriesLabelView::CreateDeviceCommand(CXTPChartDeviceContext* pDC, const CXTPChartPointF& ptAnchorPoint, double dAnchorAngle, const CXTPChartString& text) { if (text.IsEmpty() || text == _T(" ")) return NULL; double dLineAngle = CXTPChartMathUtils::Degree2Radian(dAnchorAngle); int nBorderThickness = m_pLabel->GetBorder()->GetThickness(); CRect rcPaneRect = GetPaneRect(); rcPaneRect.InflateRect(1, 1); if (!rcPaneRect.PtInRect(CPoint((int)ptAnchorPoint.X, (int)ptAnchorPoint.Y))) return NULL; CXTPChartDeviceCommand* pCommand = new CXTPChartHitTestElementCommand(m_pLabel); CXTPChartTextPainter painter(pDC, text, m_pLabel); CXTPChartSizeF szText = painter.GetSize(); CXTPChartColor clrTextColor = GetActualTextColor(); CXTPChartPointF ptStartPoint(CXTPChartMathUtils::Round(ptAnchorPoint.X), CXTPChartMathUtils::Round(ptAnchorPoint.Y)); CXTPChartPointF ptFinishPoint(CXTPChartMathUtils::Round(ptAnchorPoint.X + (cos(dLineAngle) * m_pLabel->GetLineLength())), CXTPChartMathUtils::Round(ptAnchorPoint.Y - (sin(dLineAngle) * m_pLabel->GetLineLength()))); CXTPChartRectF rcInnerBounds; CXTPChartRectF rcBounds = CXTPChartSeriesLabelConnectorPainterBase::CalcBorderBoundsForTangentDrawing(ptFinishPoint, dLineAngle, szText, nBorderThickness, rcInnerBounds); CXTPChartPointF ptLabelPoint = rcInnerBounds.GetLocation(); CXTPChartColor clrBackColor = m_pLabel->GetActualBackColor(); pCommand->AddChildCommand(m_pLabel->GetFillStyle()->CreateDeviceCommand(rcBounds, clrBackColor, clrBackColor)); painter.SetLocation(ptLabelPoint); pCommand->AddChildCommand(painter.CreateDeviceCommand(pDC, clrTextColor)); if (m_pLabel->GetShowLines()) { CXTPChartColor clrConnectorColor = GetActualConnectorColor(); CXTPChartSeriesLabelLineConnectorPainter linePainter(ptStartPoint, ptFinishPoint, dLineAngle, rcBounds); pCommand->AddChildCommand(linePainter.CreateDeviceCommand(pDC, m_pLabel, clrConnectorColor)); } if (nBorderThickness) { CXTPChartColor clrBorderColor = GetActualBorderColor(); pCommand->AddChildCommand(m_pLabel->GetBorder()->CreateInnerBorderDeviceCommand(rcBounds, clrBorderColor)); } return pCommand; }