int CTaskPane::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMFCTasksPane::OnCreate(lpCreateStruct) == -1) return -1; SetCaption (_T("Tasks Pane")); SetIconsList (IDB_TASKS, 16); EnableNavigationToolbar (TRUE); EnableWrapLabels (TRUE); EnableOffsetCustomControls (FALSE); m_nDocumentsGroup = AddGroup (_T("Open a document"), FALSE, TRUE); // Add MRU list: AddMRUFilesList (m_nDocumentsGroup); AddTask (m_nDocumentsGroup, _T("More Documents..."), 0, ID_FILE_OPEN); int nPage1Gr2 = AddGroup (_T("Custom group")); m_nUserColorGroup = nPage1Gr2; AddTask (nPage1Gr2, _T("Task 1"), 1, ID_TASK1); m_nUserColorTask = AddTask (nPage1Gr2, _T("Task 2"), 2, ID_TASK2); AddTask (nPage1Gr2, _T("Task 3"), 3, ID_TASK3); AddSeparator (nPage1Gr2); AddTask (nPage1Gr2, _T("Task 4"), 4, ID_TASK4); AddTask (nPage1Gr2, _T("Task 5"), 5, ID_TASK5); AddTask (nPage1Gr2, _T("Long task's name to see words wrap feature"), 6, ID_TASK6); int nPage1Gr3 = AddGroup (_T("Details"), TRUE); AddLabel (nPage1Gr3, _T("The Label contains text, which can be displayed in several lines. \n\nText can include line breaking characters \'\\n\' and &underline markers \'&&\'")); // Add second page: int nPage2 = AddPage (_T("Custom page")); int nPage2Gr1 = AddGroup (nPage2, _T("Tree Control")); if (!CreateTreeControl()) { TRACE0("Failed to create the custom window\n"); return -1; // fail to create } const int nControlHeight = 65; AddWindow (nPage2Gr1, m_wndTree.GetSafeHwnd (), nControlHeight); AddTask (nPage2Gr1, _T("My favorites..."), 9, ID_TASK9); int nPage2Gr2 = AddGroup (nPage2, _T("Edit Control")); if (!CreateEditControl()) { TRACE0("Failed to create the custom window\n"); return -1; // fail to create } AddWindow (nPage2Gr2, m_wndEdit.GetSafeHwnd (), nControlHeight); // Create tasks pane windows. // TODO: create your own tasks panes here: return 0; }
int CIBATaskPane::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CBCGPTasksPane::OnCreate(lpCreateStruct) == -1) return -1; CIBAString strTmp; strTmp.LoadString(IDS_STANDARD); SetCaption(strTmp); EnableNavigationToolbar(FALSE); EnableWrapLabels(TRUE); EnableOffsetCustomControls(FALSE); CIBAHelpper::CreateFont(m_Font, 13); if (!CreateBroser()) { TRACE0("Failed to create the custom window\n"); return -1; // fail to create } strTmp.LoadString(IDS_SYSMSG); int nPage1Gr2 = AddGroup(strTmp); AddWindow(nPage1Gr2, m_WebBrowser.GetSafeHwnd(), 150); strTmp.LoadString(IDS_USERINFO); m_nUserInfoGroup = AddGroup(strTmp, FALSE, TRUE); //ShowCashierInfo(); //if (CNetBarConfig::GetInstance()->GetEnableID2Reader()) /*{ if (m_dlgUserPhoto.m_hWnd == NULL) { CString strTmp = _T("证件照"); int nPage1Gr4 = AddGroup(strTmp); m_dlgUserPhoto.Create(IDD_DLG_USER_PHOTO, this); AddWindow(nPage1Gr4, m_dlgUserPhoto, 150); } }*/ if (m_dlgUserPhoto.m_hWnd == NULL) { CString strTmp = _T("证件照"); int nPage1Gr4 = AddGroup(strTmp); m_dlgUserPhoto.Create(IDD_DLG_USER_PHOTO, this); AddWindow(nPage1Gr4, m_dlgUserPhoto, 150); } if (!CreateEditControl()) { TRACE0("Failed to create the custom window\n"); return -1; // fail to create } INT nControlHeight = 135; INT nHeight = GetSystemMetrics(SM_CYSCREEN); //nControlHeight += (nHeight - 768); nControlHeight = 150; strTmp.LoadString(IDS_QUICKNOTES); int nPage1Gr3 = AddGroup(strTmp, TRUE); AddWindow(nPage1Gr3, m_wndEdit.GetSafeHwnd(), nControlHeight); /*strTmp.LoadString(IDS_QUICKNOTES); int nPage1Gr3 = AddGroup(strTmp, TRUE); AddWindow(nPage1Gr3, m_wndEdit.GetSafeHwnd(), nControlHeight);*/ strTmp = CNetBarConfig::GetInstance()->GetNetbarNotice(); if(strTmp.IsEmpty()) { strTmp.LoadString(IDS_NETBAR_NOTICE_TIPS); } m_wndEditNetbarNotice.SetWindowText(strTmp); strTmp.LoadString(IDS_NETBAR_NOTICE); int nPage1Gr4 = AddGroup(strTmp, TRUE); AddWindow(nPage1Gr4, m_wndEditNetbarNotice.GetSafeHwnd(), nControlHeight); return 0; }