void CGridCellBase::operator=(const CGridCellBase& cell) { SetGrid(cell.GetGrid()); // do first in case of dependencies SetText(cell.GetText()); SetImage(cell.GetImage()); SetData(cell.GetData()); SetState(cell.GetState()); SetFormat(cell.GetFormat()); SetTextClr(cell.GetTextClr()); SetBackClr(cell.GetBackClr()); SetFont(cell.IsDefaultFont()? NULL : cell.GetFont()); SetMargin(cell.GetMargin()); }
void CGridCellBase::operator=( CGridCellBase& cell) { if (this == &cell) return; SetGrid(cell.GetGrid()); // do first in case of dependencies SetText(cell.GetText()); SetImage(cell.GetImage()); SetData(cell.GetData()); SetState(cell.GetState()); SetFormat(cell.GetFormat()); SetTextClr(cell.GetTextClr()); SetBackClr(cell.GetBackClr()); SetFont(cell.IsDefaultFont()? NULL : cell.GetFont()); SetMargin(cell.GetMargin()); //Used for merge cells //by Huang Wei SetMergeCellID(cell.GetMergeCellID()); SetMergeRange(cell.GetMergeRange()); Show(cell.IsShow()); }
void QuoteTableCtrlGeneralSort::OnLButtonDown(UINT nFlags, CPoint point) { /*CHSGridCtrl::OnLButtonDown(nFlags, point);*/ SetFocus(); RefreshWnd(); RefreashOtherWnd(g_LastSelectWnd); g_LastSelectWnd = m_pTableFlag->nIndex; CRect rectCell, rectRow; CCellID cell = GetCellFromPt(point); if (cell.row == 0) return; CGridCellBase* pCell = GetCell(cell.row, cell.col); BOOL bInTextArea = FALSE; if (pCell) { if (GetCellRect(cell.row, cell.col, rectCell) && pCell->GetTextRect(rectCell)) { bInTextArea = rectCell.PtInRect(point); } } COLORREF selectbk = RGB(100,100,100); if ( bInTextArea ) { for (int i=0; i<GetColumnCount(); i++) { pCell = GetCell(cell.row, i); if (pCell) { pCell->SetState(pCell->GetState() | m_iColProp->GetColumnMask(GetHeadID(i))| GVIS_SELECTED); pCell->SetSelectColor(selectbk); } } } Invalidate(); m_LastDownPoint = point; }