///////////////////////////////////////////////////////////////////////////// // 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); }
void CTWenUGCtrlEx::OnSetup(void) { CFont * pcFont = GetFont(m_nFontID_Content); CUGCell cell; GetGridDefault(&cell); cell.SetTextColor(RGB(0,0,0)); cell.SetFont(pcFont); cell.SetReadOnly(true); SetGridDefault(&cell); CString AppPath = CApplication::GetApplicationPath(); AppPath += _T('\\'); m_nIndexBMP_Delete = AddBitmap(AppPath + _T("_Action_Delete.bmp")); m_nIndexBMP_INF = AddBitmap(AppPath + _T("_Action_Info.bmp")); m_nIndexBMP_Add = AddBitmap(AppPath + _T("_Action_Add.bmp")); CString s; if(m_nIndexBMP_Delete<0) s += (_T("\r\n") + AppPath + _T("_Action_Delete.bmp")); if(m_nIndexBMP_INF<0) s += (_T("\r\n") + AppPath + _T("_Action_Info.bmp")); if(m_nIndexBMP_Add<0) s += (_T("\r\n") + AppPath + _T("_Action_Add.bmp")); if(!s.IsEmpty()) AfxMessageBox(_T("以下图片未能加载:") + s); }
void COutputGridCtrl::OnSetup() { //change font of header CUGCell cell; GetHeadingDefault(&cell); CFont* pFont = GetParent()->GetFont(); cell.SetFont(pFont); SetHeadingDefault(&cell); CStringArrayEx title(IDS_FUNCTION_TEST_CTRL); ASSERT(title.GetSize() == 2); SetNumberCols((int)title.GetSize() - 1); SetNumberRows((int)m_functionVector.size()); for (int i = 0; i < title.GetSize(); i++) { QuickSetText(i - 1, -1, title[i]); } for (int i = 0; i < m_functionVector.size(); i++) { QuickSetText(-1, i, UtilWin::Convert(m_functionVector[i].m_name)); } BestFit(-1, 0, 0, UG_BESTFIT_TOPHEADINGS); EnableToolTips(); }
///////////////////////////////////////////////////////////////////////////// // 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 CDropDayCug::OnSetup() { SetUserSizingMode( 0 ); SetDefRowHeight( 50 ); EnableMenu( TRUE ); SetDefFont( AddFont( "Arial", -13, 400 )); m_crossedFont.CreateFont( -13, 0, 0, 0, 400, 0, 0, 1, 0, 0, 0, 0, 0, "Arial" ); CUGCell cell; GetHeadingDefault( &cell ); cell.SetFont( GetFont( AddFont( "Arial", -13, 700 ))); SetHeadingDefault( &cell ); }