#include "StdAfx.h" #include "TFloorHoleLabelEdJig.h" #include "FloorHoleDlg.h" TFloorHoleLabelEdJig::TFloorHoleLabelEdJig(TDbSymbMultiLeader *pLeader):TLeaderEdJig(pLeader) { } void TFloorHoleLabelEdJig::SetDlgPtr(CFloorHoleDlg* pFloorHoleDlg) { m_pFloorHoleDlg = pFloorHoleDlg; } Adesk::Boolean TFloorHoleLabelEdJig::update() { Adesk::Boolean bRet = Adesk::kTrue; if(m_nOperCode == TLeaderEdJig::kLeader) { XVector3D vtOffset = Wcs2Ucs(m_ptResult) - Wcs2Ucs(GetBasePoint()); m_pDrawEnt->SetLeaderPoint(m_ptResult); if(vtOffset.x < 0.0) m_pDrawEnt->SetTextBaseLen(-fabs(m_pDrawEnt->GetTextBaseLen())); else m_pDrawEnt->SetTextBaseLen(fabs(m_pDrawEnt->GetTextBaseLen())); } else if(m_nOperCode == TLeaderEdJig::kVertex) { } else if(m_nOperCode == TLeaderEdJig::kTextLine) { XPoint ptLeader = m_pDrawEnt->GetLeaderPoint(); m_pDrawEnt->SetTextBaseLen(m_ptResult.x - ptLeader.x, FALSE); } if (m_pDrawEnt != NULL && m_pFloorHoleDlg != NULL) { CString strSuperscript, strSubscript; if (m_pFloorHoleDlg->m_nType == 0) { strSuperscript = m_pFloorHoleDlg->getSuperscript(); strSubscript = m_pFloorHoleDlg->getSubscript(); } else { m_pFloorHoleDlg->m_wndRectHoleDlg.m_cmbSuperscript.GetWindowText(strSuperscript); m_pFloorHoleDlg->m_wndRectHoleDlg.m_edtSubscript.GetWindowText(strSubscript); } m_pDrawEnt->SetText1(strSuperscript); m_pDrawEnt->SetText2(strSubscript); } return bRet; }