![]() ![]() |
||
Steps: 1. Initial the canvas: void CProcessFlowView::OnInitialUpdate() { SetCurrentModel(GetDocument()->m_pDataModel); CFODrawView::OnInitialUpdate(); GetCurrentModel()->SetBorderShow(FALSE); UpdateScrollBarSize(); // ZoomToFitPageWidth(); } 2. Create a new class CExtChartShape that uses CFODrawPortsShape as base class. 3. Drawing chart shape: void CProcessFlowView::OnDrawMychart() { // TODO: Add your command handler code here m_drawshape = MY_CHART; SetCurrentDrawingCursor(IDC_FO_DRAWRECT_CURSOR); m_action_state = State_DrawRect; m_bUpRightMode = FALSE; } void CProcessFlowView::OnUpdateDrawMychart(CCmdUI* pCmdUI) { // TODO: Add your command update UI handler code here BOOL bDesign = GetCurrentModel()->IsDesignMode(); pCmdUI->Enable(bDesign); if(bDesign) { pCmdUI->SetCheck(m_drawshape == MY_CHART && (!m_bUpRightMode)); } } void CProcessFlowView::OnDrawMychartBar() { // TODO: Add your command handler code here m_drawshape = MY_CHART_BAR; SetCurrentDrawingCursor(IDC_FO_DRAWRECT_CURSOR); m_action_state = State_DrawRect; m_bUpRightMode = FALSE; } void CProcessFlowView::OnUpdateDrawMychartBar(CCmdUI* pCmdUI) { // TODO: Add your command update UI handler code here BOOL bDesign = GetCurrentModel()->IsDesignMode(); pCmdUI->Enable(bDesign); if(bDesign) { pCmdUI->SetCheck(m_drawshape == MY_CHART_BAR && (!m_bUpRightMode)); } } |
Copyright ?1998-2007 UCanCode.Net Software, all rights reserved.
Other product and company names herein may be the trademarks of their respective owners.
Please direct your questions or comments to webmaster@ucancode.com