BOOL CNodeWnd::OnEraseBkgnd(CDC* pDC) { BOOL bInDesignState = m_pWndNode->m_pRootObj->m_pFrame->m_bDesignerState; if (m_pWndNode->m_strID.CompareNoCase(_T("HostView")) == 0) { HWND hWnd = m_pWndNode->m_pFrame->m_hWnd; if (m_pWndNode->m_pRootObj->m_pFrame->m_bDesignerState) { RECT rt; CBitmap bit; GetClientRect(&rt); bit.LoadBitmap(IDB_BITMAP_MDI); CBrush br(&bit); pDC->FillRect(&rt, &br); } if (::IsWindow(hWnd) && !::IsWindowVisible(hWnd)) { theApp.HostPosChanged(m_pWndNode); return true; } } if (m_pWndNode->m_strID.CompareNoCase(_T("hostview")) && (m_bCreateExternal == false && m_pWndNode->m_pDisp == NULL)&& m_bEraseBkgnd) { RECT rt; CBitmap bit; GetClientRect(&rt); if (bInDesignState&&theApp.m_pDesignWindowNode== m_pWndNode) { bit.LoadBitmap(IDB_BITMAP_DESIGNER); CBrush br(&bit); pDC->FillRect(&rt, &br); } else { bit.LoadBitmap(IDB_BITMAP_GRID); CBrush br(&bit); pDC->FillRect(&rt,&br); pDC->SetBkMode(TRANSPARENT); CComBSTR bstrCaption(L""); m_pWndNode->get_Attribute(CComBSTR(L"caption"), &bstrCaption); CString strInfo = _T(""); strInfo = strInfo + _T("\n ----Tangram Object Information----") + _T("\n ") + _T("\n Object Name: ") + m_pWndNode->m_strName + _T("\n Object Caption:") + OLE2T(bstrCaption) + _T("\n ") + _T("\n "); pDC->SetTextColor(RGB(255,255,255)); pDC->DrawText(strInfo,&rt,DT_LEFT); } } return true; }
/******************************************************************************* Function Name : vInitGraphControl Input(s) : - Output : - Functionality : This function will initialise graph control. This will set viewstyle parameters of the graph control Member of : CGraphBottomView Author(s) : Raja N Date Created : 10/12/2004 Modifications : *******************************************************************************/ void CGraphBottomView::vInitGraphControl() { CGraphList* podList = NULL; CGraphChildFrame* pParentWnd = NULL; pParentWnd = (CGraphChildFrame*)pomGetParentWindow(); if(pParentWnd != NULL) { podList = pParentWnd->pGetSignalListDetails(); } else { return; } if( podList != NULL ) { CGraphParameters* pEnv = &podList->m_odGraphParameters; if( pEnv != NULL ) { // Init Active Axis m_nAxis = pEnv->m_nActiveAxis; // Init Active Action m_nAction = pEnv->m_nAction; // Set Show Grid Action vSetShowButtonState( pEnv->m_bShowGrid ); // Set Graph Params if( m_pDMGraphCtrl != NULL ) { // Set Axis Color m_pDMGraphCtrl->put_AxisColor((OLE_COLOR)pEnv->m_nAxisColor); // Set Plot Area Color m_pDMGraphCtrl->put_PlotAreaColor((OLE_COLOR)pEnv->m_nPlotAreaColor); // Set Grid Color m_pDMGraphCtrl->put_GridColor((OLE_COLOR)pEnv->m_nGridColor); // Set Frame Style m_pDMGraphCtrl->put_FrameStyle((FrameStyle)pEnv->m_nFrameStyle); // Set Frame Color m_pDMGraphCtrl->put_ControlFrameColor((OLE_COLOR)pEnv->m_nFrameColor); // Set Grid Lines Count CComPtr<IDMGraphAxis> spAxisX; m_pDMGraphCtrl->get_Axis( HorizontalX, &spAxisX); spAxisX->put_GridNumber((short)pEnv->m_nXGridLines); CComPtr<IDMGraphAxis> spAxisY; m_pDMGraphCtrl->get_Axis( VerticalY, &spAxisY); spAxisY->put_GridNumber((short)pEnv->m_nYGridLines); // Set Show Grid spAxisX->put_ShowGrid(pEnv->m_bShowGrid ? VARIANT_TRUE : VARIANT_FALSE); spAxisY->put_ShowGrid(pEnv->m_bShowGrid ? VARIANT_TRUE : VARIANT_FALSE); // Set Format String spAxisX->put_Format( CComBSTR(defSTR_X_AXIS_FORMAT) ); spAxisY->put_Format( CComBSTR(defSTR_Y_AXIS_FORMAT) ); // Set X,Y Range double dXMin,dXMax, dYMin, dYMax; m_pDMGraphCtrl->GetRange(&dXMin, &dXMax, &dYMin, &dYMax); dYMax = 100.0; m_pDMGraphCtrl->SetRange(defDEFAULT_XRANGE_MIN, defDEFAULT_XRANGE_MAX, dYMin, dYMax); //Set the caption BSTR bstrCaption(L"Graph Display - CAN"); m_pDMGraphCtrl->put_Caption(bstrCaption); } // Update Local DDX Variables UpdateData( FALSE ); // Update Axis and action vSetAction(); } } }