UINT CuDlgIpmTabCtrl::GetCurrentPageID() { if (!m_pCurrentProperty) return 0; CuPageInformation* pPageInfo = m_pCurrentProperty->GetPageInfo(); if (!pPageInfo) return 0; if (pPageInfo->GetNumberOfPage() == 0) return 0; UINT* pArrayID = pPageInfo->GetDlgID(); if (!pArrayID) return 0; int index = m_pCurrentProperty->GetCurSel(); if (index >= 0 && index < pPageInfo->GetNumberOfPage()) return pArrayID [index]; return 0; }
void CuDlgIpmTabCtrl::LoadPage (CuIpmProperty* pCurrentProperty) { CRect r; TC_ITEM item; int i, nPages; UINT* nTabID; UINT* nDlgID; CString strTab; CString strTitle; UINT nIDD; CWnd* pDlg; CuPageInformation* pPageInfo = NULL; if (m_pCurrentProperty) { m_pCurrentProperty->SetPageInfo (NULL); delete m_pCurrentProperty; } pPageInfo = pCurrentProperty->GetPageInfo(); m_pCurrentProperty = new CuIpmProperty (pCurrentProperty->GetCurSel(), pPageInfo); // // Set up the Title: pPageInfo->GetTitle (strTitle); m_staticHeader.SetWindowText (strTitle); UINT uFlags = SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER; if (!strTitle.IsEmpty()) { switch (pPageInfo->GetImageType()) { case 0: m_staticHeader.ResetBitmap (pPageInfo->GetIconImage()); break; case 1: m_staticHeader.ResetBitmap (pPageInfo->GetBitmapImage(), pPageInfo->GetImageMask()); break; default: m_staticHeader.ResetBitmap (NULL); } } else m_staticHeader.ResetBitmap (NULL); m_staticHeader.SetWindowPos(NULL, 0, 0, 0, 0, uFlags); nPages = pPageInfo->GetNumberOfPage(); if (nPages < 1) { m_pCurrentPage = NULL; return; } // // Construct the Tab(s) nTabID = pPageInfo->GetTabID(); nDlgID = pPageInfo->GetDlgID(); memset (&item, 0, sizeof (item)); item.mask = TCIF_TEXT; item.cchTextMax = 32; m_cTab1.DeleteAllItems(); for (i=0; i<nPages; i++) { strTab.LoadString (nTabID [i]); item.pszText = (LPTSTR)(LPCTSTR)strTab; m_cTab1.InsertItem (i, &item); } // // Display the selected page. nIDD = pPageInfo->GetDlgID (pCurrentProperty->GetCurSel()); pDlg = GetPage (nIDD); m_cTab1.SetCurSel (pCurrentProperty->GetCurSel()); m_cTab1.GetClientRect (r); m_cTab1.AdjustRect (FALSE, r); pDlg->MoveWindow (r); pDlg->ShowWindow(SW_SHOW); m_pCurrentPage = pDlg; // // Display the content (data) of this page. CuIpmPropertyData* pData = pCurrentProperty->GetPropertyData(); pData->NotifyLoad (m_pCurrentPage); // // Properties: CView* pView = (CView*)GetParent(); ASSERT (pView); CdIpmDoc* pDoc = (CdIpmDoc*)pView->GetDocument(); ASSERT (pDoc); if (pDoc) { UINT nMask = IPMMASK_FONT|IPMMASK_SHOWGRID; m_pCurrentPage->SendMessage (WMUSRMSG_CHANGE_SETTING, (WPARAM)nMask, (LPARAM)&(pDoc->GetProperty())); } }
UINT CConfigFrame::GetHelpID() { ASSERT (m_bAllViewCreated == TRUE); CConfRightDlg* pConfigRightDlg = GetCConfRightDlg(); CConfLeftDlg* pConfigLeftDlg = GetCConfLeftDlg(); ASSERT (pConfigLeftDlg); if (!pConfigLeftDlg) return 0; HTREEITEM hTreeItem = pConfigLeftDlg->m_tree_ctrl.GetSelectedItem(); // // Nothing has been selected in the left pane, the help is the one // of the left pane: if (!hTreeItem) return IDD_CONFIG_LEFT; // // If there is a selected item in the left pane, then check to see // if there is no pane in the right side, if so we must handle the special case: CuPageInformation* pPageInfo = NULL; CuCbfListViewItem* pItem = (CuCbfListViewItem*)pConfigLeftDlg->m_tree_ctrl.GetItemData (hTreeItem); if (!pItem) return IDD_CONFIG_LEFT; if (pItem && pItem->GetPageInformation() && pItem->GetPageInformation()->GetNumberOfPage() == 0) { // // No page in the right pane: pPageInfo = pItem->GetPageInformation(); if (pPageInfo->GetClassName().CompareNoCase (_T("RECOVER")) == 0) return IDHELP_RECOVER; if (pPageInfo->GetClassName().CompareNoCase (_T("ARCHIVE")) == 0) return IDHELP_ACHIVER; if (pPageInfo->GetClassName().CompareNoCase (_T("RMCMD")) == 0) return IDHELP_RMCMD; } UINT nIDHelp = 0; ASSERT (pConfigRightDlg); if (!pConfigRightDlg) return nIDHelp; CuCbfProperty* pProp = pConfigRightDlg->GetCurrentProperty(); if (!pProp) return nIDHelp; pPageInfo = pProp->GetPageInfo(); if (!pPageInfo) return nIDHelp; int nCurSel = pProp->GetCurSel(); if (nCurSel>=0 && nCurSel<pPageInfo->GetNumberOfPage() && pPageInfo->GetNumberOfPage()>0) nIDHelp = pPageInfo->GetDlgID(nCurSel); // // For the cache page the are three sub-panes (cache buffer, parameter, derived): if (nIDHelp == IDD_DBMS_PAGE_CACHE) { CuDlgDbmsCache* pCachePage = (CuDlgDbmsCache*)pConfigRightDlg->GetCurrentPage(); if (pCachePage) { CvDbmsCacheViewLeft* pCacheBuffer = pCachePage->GetLeftPane(); if (pCacheBuffer) { CuCacheCheckListCtrl* pListBuffer = pCacheBuffer->GetCacheListCtrl(); // // Cache buffer: if (pListBuffer->GetSelectedCount() == 0) nIDHelp = IDD_CACHE_LIST; else { CvDbmsCacheViewRight* pCacheRightPane = pCachePage->GetRightPane(); if (pCacheRightPane) { CuDlgCacheTab* pTab = pCacheRightPane->GetCacheTabDlg(); if (pTab) nIDHelp = pTab->GetHelpID(); } } } } } return nIDHelp; }