void CTWenUGCtrlEx::OnLClicked(int col,long row, int updn, RECT *rect, POINT *point, int processed) { CUGCell cell; GetCell(col, row, &cell); if(updn==FALSE)//只有当鼠标放开的时候才执行 { if(cell.GetBitmap()==GetBitmap(m_nIndexBMP_Delete)) Action_DeleteRow(row); else if(cell.GetBitmap()==GetBitmap(m_nIndexBMP_INF)) Action_DisplayRowInf(row); else if(cell.GetBitmap()==GetBitmap(m_nIndexBMP_Add)) Action_AddRow(); else CUGCtrl::OnLClicked(col,row, updn, rect, point, processed); } else CUGCtrl::OnLClicked(col,row, updn, rect, point, processed); }
void CTWenUGCtrlEx::AppendRow_ButtonAdd(void) { int nRow = CUGCtrl::GetNumberRows(); if(nRow > 0) { CUGCell cell; GetCell(0, nRow-1, &cell); if(cell.GetBitmap()==GetBitmap(m_nIndexBMP_Add))//如果有增加行 { return; } } if(AppendRow() != UG_SUCCESS) return; int nCol = GetNumberCols(); JoinCells(1, nRow, nCol-1, nRow); if(nCol>1) { QuickSetBackColor(1, nRow, RGB(240,240,240)); QuickSetBorder(1, nRow, UG_BDR_RAISED|UG_BDR_LTHIN|UG_BDR_RTHIN|UG_BDR_TTHIN|UG_BDR_BTHIN); } QuickSetBitmap(0, nRow, m_nIndexBMP_Add); }
void CTWenUGCtrlEx::RomoveRow_ButtonAdd(void) { int nRow = CUGCtrl::GetNumberRows(); if(nRow == 0) return; CUGCell cell; GetCell(0, nRow-1, &cell); if(cell.GetBitmap()==GetBitmap(m_nIndexBMP_Add))//如果有增加行 { DeleteRow(nRow-1); } }