void CuDlgPropertyPageSqlWizardInsert1::EnableWizardButtons() { CxDlgPropertySheetSqlWizard* pParent = (CxDlgPropertySheetSqlWizard*)GetParent(); CString strItem; BOOL bEnable = FALSE; BOOL bManual = IsDlgButtonChecked (IDC_RADIO3); int i, nCount = m_cCheckListBoxColumn.GetCount(); for (i=0; i<nCount; i++) { if (m_cCheckListBoxColumn.GetCheck(i)) { m_cCheckListBoxColumn.GetText (i, strItem); if (strItem.CompareNoCase (m_strAll) != 0) { bEnable = TRUE; break; } } } if (bManual) { if (bEnable) pParent->SetWizardButtons(PSWIZB_NEXT|PSWIZB_BACK); else pParent->SetWizardButtons(PSWIZB_BACK); } else pParent->SetWizardButtons(PSWIZB_NEXT|PSWIZB_BACK); }
BOOL CuDlgPropertyPageSqlWizardUpdate1::OnSetActive() { CxDlgPropertySheetSqlWizard* pParent = (CxDlgPropertySheetSqlWizard*)GetParent(); pParent->SetWizardButtons(PSWIZB_NEXT|PSWIZB_BACK); EnableWizardButtons(); return CPropertyPage::OnSetActive(); }
void CuDlgPropertyPageSqlWizardUpdate1::EnableWizardButtons() { CxDlgPropertySheetSqlWizard* pParent = (CxDlgPropertySheetSqlWizard*)GetParent(); CString strItem; BOOL bEnable = FALSE; int i, nCount = m_cCheckListBoxColumn.GetCount(); // // Skip the first item: for (i=1; i<nCount; i++) { if (m_cCheckListBoxColumn.GetCheck(i)) { bEnable = TRUE; break; } } if (bEnable) pParent->SetWizardButtons(PSWIZB_NEXT|PSWIZB_BACK); else pParent->SetWizardButtons(PSWIZB_BACK); }
BOOL CuDlgPropertyPageSqlWizardUpdate3::OnSetActive() { CWaitCursor doWaitCursor; int i, idx, nCount; CString strItem; CxDlgPropertySheetSqlWizard* pParent = (CxDlgPropertySheetSqlWizard*)GetParent(); pParent->SetWizardButtons(PSWIZB_FINISH|PSWIZB_BACK); CStringList& listStrColumn = pParent->m_PageUpdate2.m_listStrColumn; CuCheckListBox& checkListBox = pParent->m_PageUpdate1.m_cCheckListBoxColumn; m_cComboValues.ResetContent(); POSITION pos = listStrColumn.GetHeadPosition(); while (pos != NULL) { strItem = listStrColumn.GetNext (pos); m_cComboValues.AddString (strItem); } m_cComboValues.SetCurSel(0); // // Remove the columns in 'm_cListCtrl' that are not (checked) in 'checkListBox': nCount = m_cListCtrl.GetItemCount(); i = 0; while (i < nCount && nCount > 0) { strItem = m_cListCtrl.GetItemText (i, 0); idx = checkListBox.FindStringExact (-1, strItem); if (idx == LB_ERR || !checkListBox.GetCheck(idx)) { m_cListCtrl.DeleteItem (i); nCount = m_cListCtrl.GetItemCount(); continue; } i++; } CaColumn* lpData = NULL; // // Add the columns that are checked in 'checkListBox' but not in 'm_cListCtrl': LVFINDINFO lvfindinfo; idx = -1; memset (&lvfindinfo, 0, sizeof (LVFINDINFO)); lvfindinfo.flags = LVFI_STRING; nCount = checkListBox.GetCount(); for (i=0; i<nCount; i++) { lpData = (CaColumn*)checkListBox.GetItemData(i); if (checkListBox.GetCheck(i) && lpData) { checkListBox.GetText (i, strItem); lvfindinfo.psz = (LPCTSTR)strItem; if (m_cListCtrl.FindItem (&lvfindinfo) == -1) { idx = m_cListCtrl.GetItemCount(); m_cListCtrl.InsertItem (idx, strItem); m_cListCtrl.SetItemData (idx, (LPARAM)INGRESII_llIngresColumnType2AppType(lpData)); } } } EnableButtons(); return CPropertyPage::OnSetActive(); }