///////////////////////////////////////////////////////////////////////////// // OnSetup // This function is called just after the grid window // is created or attached to a dialog item. // It can be used to initially setup the grid void CNormalsDataGridCtrl::OnSetup() { m_font.CreateStockObject(DEFAULT_GUI_FONT); CreateBoldFont(); m_cellBorderPen.CreatePen(PS_SOLID, 1, RGB(157, 157, 161)); // create and set new top-heading class CExcelTopHdg* pExcelTopHdg = new CExcelTopHdg; pExcelTopHdg->Create(NULL, _T(""), WS_CHILD | WS_VISIBLE, CRect(0, 0, 0, 0), this, 234752); SetNewTopHeadingClass(pExcelTopHdg); // create and set new side-heading class CExcelSideHdg* pExcelSideHdg = new CExcelSideHdg; pExcelSideHdg->Create(NULL, _T(""), WS_CHILD | WS_VISIBLE, CRect(0, 0, 0, 0), this, 234753); SetNewSideHeadingClass(pExcelSideHdg); m_CUGHint->SetFont(&m_font); m_CUGTab->ShowScrollbars(true); CUGCell cell; GetHeadingDefault(&cell); cell.SetAlignment(UG_ALIGNCENTER); cell.SetBorder(UG_BDR_RTHIN | UG_BDR_BTHIN); cell.SetBackColor(RGB(239, 237, 242)); cell.SetHBackColor(RGB(162, 192, 248)); cell.SetBorderColor(&m_cellBorderPen); cell.SetFont(&m_font); SetHeadingDefault(&cell); // create a font and set it as Grid Default GetGridDefault(&cell); cell.SetAlignment(UG_ALIGNCENTER); cell.SetFont(&m_font); cell.SetBorderColor(&m_cellBorderPen); cell.SetBorder(UG_BDR_RTHIN | UG_BDR_BTHIN); SetGridDefault(&cell); // create a font and set it as Heading Default // set default properties UseHints(TRUE); UseVScrollHints(TRUE); EnableMenu(TRUE); EnableExcelBorders(TRUE); SetDoubleBufferMode(TRUE); SetVScrollMode(UG_SCROLLNORMAL);//UG_SCROLLTRACKING SetHScrollMode(UG_SCROLLTRACKING); SetHighlightRow(FALSE, FALSE); SetMultiSelectMode(UG_MULTISELECT_CELL);// SetCurrentCellMode(3); SetTH_NumberRows(0); SetSH_NumberCols(0); SetNumberCols(0); SetNumberRows(0); }
void CNormalsEstimateCtrl::OnSetup() { m_font.CreateStockObject(DEFAULT_GUI_FONT); CreateBoldFont(); m_cellBorderPen.CreatePen(PS_SOLID, 1, RGB(157, 157, 161)); m_CUGHint->SetFont(&m_font); m_CUGTab->ShowScrollbars(true); // add and set heading's default celltype CUGCell cell; GetHeadingDefault(&cell); cell.SetAlignment(UG_ALIGNCENTER); cell.SetBorder(UG_BDR_RTHIN | UG_BDR_BTHIN); cell.SetBackColor(RGB(239, 237, 242)); cell.SetHBackColor(RGB(162, 192, 248)); cell.SetBorderColor(&m_cellBorderPen); cell.SetFont(&m_font); SetHeadingDefault(&cell); // create a font and set it as Grid Default GetGridDefault(&cell); cell.SetAlignment(UG_ALIGNCENTER); cell.SetFont(&m_font); cell.SetBorderColor(&m_cellBorderPen); cell.SetBorder(UG_BDR_RTHIN | UG_BDR_BTHIN); SetGridDefault(&cell); // create a font and set it as Heading Default // set default properties UseHints(FALSE); UseVScrollHints(TRUE); EnableExcelBorders(TRUE); SetHighlightRow(UG_MULTISELECT_ROW, FALSE); SetMultiSelectMode(UG_MULTISELECT_OFF); SetCurrentCellMode(3); //focus and highlighting SetDoubleBufferMode(TRUE); SetVScrollMode(UG_SCROLLTRACKING); SetHScrollMode(UG_SCROLLTRACKING); AddCellType(&m_sortArrow); }