BOOL CuDlgPropertyPageSqlWizardUpdate2::OnInitDialog() { CWaitCursor doWaitCursor; CxDlgPropertySheetSqlWizard* pParent = (CxDlgPropertySheetSqlWizard*)GetParent(); CPropertyPage::OnInitDialog(); VERIFY (m_cListTable.SubclassDlgItem (IDC_LIST1, this)); VERIFY (m_cListView.SubclassDlgItem (IDC_LIST2, this)); LSCTRLHEADERPARAMS2 lsp1[LAYOUT_NUMBER] = { {IDS_HEADER_TABLE, 120, LVCFMT_LEFT, FALSE}, {IDS_HEADER_OWNER, 80, LVCFMT_LEFT, FALSE} }; LSCTRLHEADERPARAMS2 lsp2[LAYOUT_NUMBER] = { {IDS_HEADER_VIEW, 120, LVCFMT_LEFT, FALSE}, {IDS_HEADER_OWNER, 80, LVCFMT_LEFT, FALSE} }; UINT nMask = LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH; InitializeHeader2(&m_cListTable, LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH, lsp1, LAYOUT_NUMBER); InitializeHeader2(&m_cListView, LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH, lsp2, LAYOUT_NUMBER); // // Possible enhancement: personnalize according to database type m_ImageListTable.Create(IDB_TABLE, 16, 1, RGB(255, 0, 255)); m_ImageListView.Create (IDB_VIEW, 16, 1, RGB(255, 0, 255)); m_StateImageList.Create(IDB_STATEICONS, 16, 1, RGB(255, 0, 0)); m_cListTable.SetImageList(&m_ImageListTable, LVSIL_SMALL); m_cListView.SetImageList(&m_ImageListView, LVSIL_SMALL); m_cListTable.SetImageList(&m_StateImageList, LVSIL_STATE); m_cListView.SetImageList(&m_StateImageList, LVSIL_STATE); try { CaLLQueryInfo info(pParent->m_queryInfo); info.SetObjectType(OBT_TABLE); SQLW_CuCheckListBoxFillTables (&m_cListTable, &info); info.SetObjectType(OBT_VIEW); SQLW_CuCheckListBoxFillTables (&m_cListView , &info); } catch (CeSqlException e) { AfxMessageBox (e.GetReason(), MB_ICONEXCLAMATION|MB_OK); } catch (...) { // _T("Cannot Query Tables and Views"); AfxMessageBox (IDS_MSG_FAIL_2_QUERY_TABLExVIEW, MB_ICONEXCLAMATION|MB_OK); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CuDlgIpmPageLockLists::OnInitDialog() { CDialog::OnInitDialog(); VERIFY (m_cListCtrl.SubclassDlgItem (IDC_LIST1, this)); // // Initalize the Column Header of CListCtrl (CuListCtrl) LSCTRLHEADERPARAMS2 lsp[LAYOUT_NUMBER] = { {IDS_TC_LOCKLIST_ID, 91, LVCFMT_LEFT, FALSE}, {IDS_TC_SESSION, 60, LVCFMT_LEFT, FALSE}, {IDS_TC_LOCKS, 45, LVCFMT_LEFT, FALSE}, {IDS_TC_LOGICAL, 50, LVCFMT_LEFT, FALSE}, {IDS_TC_MAXL, 40, LVCFMT_LEFT, FALSE}, {IDS_TC_STATUS, 200, LVCFMT_LEFT, FALSE} }; InitializeHeader2(&m_cListCtrl, LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH, lsp, LAYOUT_NUMBER); m_ImageList.Create(IDB_TM_LOCKLIST, 16, 1, RGB(255, 0, 255)); CImageList im; if (im.Create(IDB_TM_LOCKLIST_BLOCKED_YES, 16, 1, RGB(255, 0, 255))) { HICON hIconBlock = im.ExtractIcon(0); if (hIconBlock) { m_ImageList.Add (hIconBlock); DestroyIcon (hIconBlock); } } m_cListCtrl.SetImageList(&m_ImageList, LVSIL_SMALL); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CuDlgIpmPageProcesses::OnInitDialog() { CDialog::OnInitDialog(); VERIFY (m_cListCtrl.SubclassDlgItem (IDC_LIST1, this)); // // Initalize the Column Header of CListCtrl (CuListCtrl) LSCTRLHEADERPARAMS2 lsp[LAYOUT_NUMBER] = { {IDS_TC_INTERNAL_ID, 76, LVCFMT_LEFT, FALSE}, {IDS_TC_OP_SYS_ID, 60, LVCFMT_LEFT, FALSE}, {IDS_TC_TYPE, 110, LVCFMT_LEFT, FALSE}, {IDS_TC_OPENDB, 60, LVCFMT_LEFT, FALSE}, {IDS_TC_WRITE, 40, LVCFMT_LEFT, FALSE}, {IDS_TC_FORCE, 40, LVCFMT_LEFT, FALSE}, {IDS_TC_WAIT, 40, LVCFMT_LEFT, FALSE}, {IDS_TC_BEGIN, 40, LVCFMT_LEFT, FALSE}, {IDS_TC_END, 40, LVCFMT_LEFT, FALSE} }; InitializeHeader2(&m_cListCtrl, LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH, lsp, LAYOUT_NUMBER); m_ImageList.Create(IDB_TM_LOGPROCESS, 16, 1, RGB(255, 0, 255)); m_cListCtrl.SetImageList(&m_ImageList, LVSIL_SMALL); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CuDlgReplicationStaticPageRaiseEvent::OnInitDialog() { CDialog::OnInitDialog(); VERIFY (m_cListCtrl.SubclassDlgItem (IDC_LIST1, this)); // // Initalize the Column Header of CListCtrl (CuListCtrl) // If modify this constant and the column width, make sure do not forget // to port to the OnLoad() and OnGetData() members. const int LAYOUT_NUMBER = 3; LSCTRLHEADERPARAMS2 lsp[LAYOUT_NUMBER] = { {IDS_TC_ACTION, 300, LVCFMT_LEFT, FALSE}, {IDS_TC_EVENT, 80, LVCFMT_LEFT, FALSE}, {IDS_TC_SVR_FLAG, 80, LVCFMT_LEFT, FALSE} }; InitializeHeader2(&m_cListCtrl, LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH, lsp, LAYOUT_NUMBER); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CuDlgIpmPageActiveDatabases::OnInitDialog() { CDialog::OnInitDialog(); VERIFY (m_cListCtrl.SubclassDlgItem (IDC_LIST1, this)); // // Initalize the Column Header of CListCtrl (CuListCtrl) LSCTRLHEADERPARAMS2 lsp[LAYOUT_NUMBER] = { {IDS_TC_DATABASE, 91, LVCFMT_LEFT, FALSE}, {IDS_TC_STATUS, 110, LVCFMT_LEFT, FALSE}, {IDS_TC_TX_CNT, 50, LVCFMT_LEFT, FALSE}, {IDS_TC_BEGIN, 55, LVCFMT_LEFT, FALSE}, {IDS_TC_END, 55, LVCFMT_LEFT, FALSE}, {IDS_TC_READ, 55, LVCFMT_LEFT, FALSE}, {IDS_TC_WRITE, 55, LVCFMT_LEFT, FALSE} }; InitializeHeader2(&m_cListCtrl, LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH, lsp, LAYOUT_NUMBER); // // Possible enhancement: personnalize according to database type m_ImageList.Create(IDB_TM_DB, 16, 1, RGB(255, 0, 255)); UINT narrayImage[3] = {IDB_TM_DB_TYPE_DISTRIBUTED, IDB_TM_DB_TYPE_COORDINATOR, IDB_TM_DB_TYPE_ERROR}; for (int i = 0; i<3; i++) { CImageList im; if (im.Create(narrayImage[i], 16, 1, RGB(255, 0, 255))) { HICON hIconBlock = im.ExtractIcon(0); if (hIconBlock) { m_ImageList.Add (hIconBlock); DestroyIcon (hIconBlock); } } } m_cListCtrl.SetImageList(&m_ImageList, LVSIL_SMALL); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CuDlgReplicationServerPageAssignment::OnInitDialog() { CDialog::OnInitDialog(); VERIFY (m_cListCtrl.SubclassDlgItem (IDC_LIST1, this)); // // Initalize the Column Header of CListCtrl (CuListCtrl) // If modify this constant and the column width, make sure do not forget // to port to the OnLoad() and OnGetData() members. const int LAYOUT_NUMBER = 5; LSCTRLHEADERPARAMS2 lsp[LAYOUT_NUMBER] = { {IDS_TC_DATABASE_NUM, 75, LVCFMT_RIGHT,FALSE}, {IDS_TC_DB_NAME, 110, LVCFMT_LEFT, FALSE}, {IDS_TC_CDDS, 48, LVCFMT_RIGHT,FALSE}, {IDS_TC_CDDS_NAME, 82, LVCFMT_LEFT, FALSE}, {IDS_TC_TARGET_TYPE, 120, LVCFMT_LEFT, FALSE} }; InitializeHeader2(&m_cListCtrl, LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH, lsp, LAYOUT_NUMBER); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CuDlgReplicationServerPageStartupSetting::OnInitDialog() { CDialog::OnInitDialog(); VERIFY (m_cListCtrl.SubclassDlgItem (IDC_LIST1, this)); m_ImageList.Create(1, 18, TRUE, 1, 0); m_cListCtrl.SetImageList (&m_ImageList, LVSIL_SMALL); m_ImageCheck.Create (IDB_CHECK, 16, 1, RGB (255, 0, 0)); m_cListCtrl.SetCheckImageList(&m_ImageCheck); // // Initalize the Column Header of CListCtrl (CuListCtrl) // If modify this constant and the column width, make sure do not forget // to port to the OnLoad() and OnGetData() members. const int LAYOUT_NUMBER = 3; LSCTRLHEADERPARAMS2 lsp[LAYOUT_NUMBER] = { {IDS_TC_PARAM, 200, LVCFMT_LEFT,FALSE}, {IDS_TC_VALUE, 100, LVCFMT_LEFT,TRUE}, {IDS_TC_UNIT, 80, LVCFMT_LEFT,FALSE} }; InitializeHeader2(&m_cListCtrl, LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH, lsp, LAYOUT_NUMBER); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CuDlgReplicationStaticPageActivity::OnInitDialog() { try { CDialog::OnInitDialog(); VERIFY (m_cListCtrl.SubclassDlgItem (IDC_LIST1, this)); // // Initalize the Column Header of CListCtrl (CuListCtrl) // If modify this constant and the column width, make sure do not forget // to port to the OnLoad() and OnGetData() members. const int LAYOUT_NUMBER = 6; LSCTRLHEADERPARAMS2 lsp[LAYOUT_NUMBER] = { {IDS_TC_EMPTY, 120, LVCFMT_LEFT, FALSE}, {IDS_TC_INSERT, 60, LVCFMT_RIGHT, FALSE}, {IDS_TC_UPDATE, 60, LVCFMT_RIGHT, FALSE}, {IDS_TC_DELETE, 60, LVCFMT_RIGHT, FALSE}, {IDS_TC_TOTAL, 60, LVCFMT_RIGHT, FALSE}, {IDS_TC_TRANSACTION,100, LVCFMT_RIGHT, FALSE} }; CString strOutGoing; //_T("Outgoing") CString strIncoming; //_T("Incoming") CString strTotal; //_T("Total") strOutGoing.LoadString(IDS_TC_OUTGOING); strIncoming.LoadString(IDS_TC_INCOMING); strTotal.LoadString(IDS_TC_TOTAL); InitializeHeader2(&m_cListCtrl, LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH, lsp, LAYOUT_NUMBER); m_cListCtrl.InsertItem (0, strOutGoing); m_cListCtrl.InsertItem (1, strIncoming); m_cListCtrl.InsertItem (2, strTotal); m_pDatabaseOutgoing = new CuDlgReplicationStaticPageActivityPerDatabase (CuDlgReplicationStaticPageActivityPerDatabase::MODE_OUTGOING, &m_cTab1); m_pDatabaseIncoming = new CuDlgReplicationStaticPageActivityPerDatabase (CuDlgReplicationStaticPageActivityPerDatabase::MODE_INCOMING, &m_cTab1); m_pDatabaseTotal = new CuDlgReplicationStaticPageActivityPerDatabase (CuDlgReplicationStaticPageActivityPerDatabase::MODE_TOTAL, &m_cTab1); m_pTableOutgoing = new CuDlgReplicationStaticPageActivityPerTable (CuDlgReplicationStaticPageActivityPerTable::MODE_OUTGOING, &m_cTab1); m_pTableIncoming = new CuDlgReplicationStaticPageActivityPerTable (CuDlgReplicationStaticPageActivityPerTable::MODE_INCOMING, &m_cTab1); m_pTableTotal = new CuDlgReplicationStaticPageActivityPerTable (CuDlgReplicationStaticPageActivityPerTable::MODE_TOTAL, &m_cTab1); m_pDatabaseOutgoing->Create (IDD_REPSTATIC_PAGE_ACTIVITY_TAB_DATABASE, &m_cTab1); m_pDatabaseIncoming->Create (IDD_REPSTATIC_PAGE_ACTIVITY_TAB_DATABASE, &m_cTab1); m_pDatabaseTotal->Create (IDD_REPSTATIC_PAGE_ACTIVITY_TAB_DATABASE, &m_cTab1); m_pTableOutgoing->Create (IDD_REPSTATIC_PAGE_ACTIVITY_TAB_TABLE, &m_cTab1); m_pTableIncoming->Create (IDD_REPSTATIC_PAGE_ACTIVITY_TAB_TABLE, &m_cTab1); m_pTableTotal->Create (IDD_REPSTATIC_PAGE_ACTIVITY_TAB_TABLE, &m_cTab1); // // Initalize the Tab Control. const int TAB_NUMBER = 6; TCITEM tcitem; UINT IdsTab[TAB_NUMBER] = { IDS_TC_OUTGOING, IDS_TC_INCOMING, IDS_TC_TOTAL, IDS_TC_OUTGOING, IDS_TC_INCOMING, IDS_TC_TOTAL }; CWnd* dlgArray[TAB_NUMBER] = { (CWnd*)m_pDatabaseOutgoing, (CWnd*)m_pDatabaseIncoming, (CWnd*)m_pDatabaseTotal, (CWnd*)m_pTableOutgoing, (CWnd*)m_pTableIncoming, (CWnd*)m_pTableTotal }; int nImage [TAB_NUMBER] = {0, 0, 0, 1, 1, 1}; m_tabImageList.Create(IDB_DATABASEOBJECT, 16, 1, RGB(255, 0, 255)); m_cTab1.SetImageList (&m_tabImageList); memset (&tcitem, 0, sizeof (tcitem)); tcitem.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM; tcitem.cchTextMax = 30; CString strHeader; for (int i=0; i<TAB_NUMBER; i++) { strHeader.LoadString(IdsTab[i]); tcitem.pszText = (LPTSTR)(LPCTSTR)strHeader; tcitem.iImage = nImage[i]; tcitem.lParam = (LPARAM)dlgArray[i]; m_cTab1.InsertItem (i, &tcitem); } DisplayPage(); } catch (...) { AfxMessageBox (IDS_E_PAGE_DETAIL); return FALSE; } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CuDlgMain::OnInitDialog() { CDialog::OnInitDialog(); VERIFY (m_listMainParam.SubclassDlgItem (IDC_LIST1, this)); m_ImageCheck.Create (IDB_CHECK4LISTCTRL, 16, 1, RGB (255, 0, 0)); m_listMainParam.SetCheckImageList(&m_ImageCheck); m_ImageList.Create (IDB_DIFFERENCE, 16, 1, RGB(255, 0, 255)); m_listMainParam.SetImageList(&m_ImageList, LVSIL_SMALL); // // Initalize the Column Header of CListCtrl (CuListCtrl) LSCTRLHEADERPARAMS2 lsp[LAYOUT_NUMBER] = { {IDS_TAB_PARAMETER, 220, LVCFMT_LEFT, FALSE}, {IDS_TAB_SNAPSHOT1, 150, LVCFMT_LEFT, FALSE}, {IDS_TAB_SNAPSHOT2, 150, LVCFMT_LEFT, FALSE}, {IDS_TAB_IGNORE, 80, LVCFMT_CENTER,TRUE} }; InitializeHeader2(&m_listMainParam, LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH, lsp, LAYOUT_NUMBER); TCITEM item; memset (&item, 0, sizeof (item)); item.mask = TCIF_TEXT|TCIF_PARAM|TCIF_IMAGE; item.cchTextMax = 32; #if defined (_VIRTUAL_NODE_AVAILABLE) const int nTabcount = 5; UINT nIds[nTabcount] = { IDS_TAB_CONFIG, IDS_TAB_ENVSYSTEM, IDS_TAB_ENVUSER, IDS_TAB_VNODE, IDS_TAB_OTHERHOST }; #else const int nTabcount = 4; UINT nIds[nTabcount] = { IDS_TAB_CONFIG, IDS_TAB_ENVSYSTEM, IDS_TAB_ENVUSER, IDS_TAB_OTHERHOST }; #endif CString strTabHeader; m_cTab1.SetImageList(&m_ImageList); int nTabCount = 0; CuDlgPageDifference* pDlgPage = NULL; for (int i=0; i<nTabcount; i++) { int nPos = m_cTab1.GetItemCount(); #if defined (_VIRTUAL_NODE_AVAILABLE) if (i == 3) pDlgPage = new CuDlgPageDifference(TRUE, NULL); else pDlgPage = new CuDlgPageDifference(); #else pDlgPage = new CuDlgPageDifference(); #endif pDlgPage->Create(IDD_PAGE_DIFFERENCE, &m_cTab1); if (i == OTHER_HOST_INDEX) { m_pPageOtherHost = pDlgPage; } strTabHeader.LoadString(nIds[i]); item.pszText = (LPTSTR)(LPCTSTR)strTabHeader; item.lParam = (LPARAM)pDlgPage; item.iImage = 3; m_cTab1.InsertItem (nPos, &item); } m_cTab1.DeleteItem(OTHER_HOST_INDEX); m_cTab1.SetCurSel(0); DisplayPage(); m_hIconMain = m_ImageList.ExtractIcon(3); m_cMainIcon.SetIcon(m_hIconMain); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }