Example #1
0
BOOL CaReplicationItemList::GetModifyEdit()
{
	CString Tempo,strValue,strErrorMsg;
	POSITION pos = GetHeadPosition();

	while (pos != NULL) {
		CaReplicationItem* obj = GetNext(pos);
		if (obj->IsValueModifyByUser() == TRUE)
			return TRUE;
	}
	return FALSE;
}
Example #2
0
void CuDlgReplicationServerPageStartupSetting::EnableButtons()
{
	BOOL bEnableSaveButton      = FALSE;
	BOOL bEnableEditButton      = FALSE;
	BOOL bEnableRestorButton    = FALSE;
	BOOL bEnableRestoreAllButton= FALSE;

	if (m_cListCtrl.GetItemCount() > 0)
	{
		bEnableRestoreAllButton = TRUE;
		int nCount = m_cListCtrl.GetItemCount();
		for (int i=0; i<nCount; i++)
		{
			CaReplicationItem* pItem = (CaReplicationItem*)m_cListCtrl.GetItemData(i);
			if (pItem->IsValueModifyByUser())
			{
				bEnableSaveButton = TRUE;
				break;
			}
		}
		int nSelected = m_cListCtrl.GetNextItem (-1, LVNI_SELECTED);
		if (nSelected != -1)
		{
			CaReplicationItem* pItem = (CaReplicationItem*)m_cListCtrl.GetItemData(nSelected);
			if (!pItem->IsReadOnlyFlag())
			{
				bEnableRestorButton = TRUE;
				bEnableEditButton   = TRUE;
			}
		}
	}
	GetDlgItem(IDC_BUTTON1)->EnableWindow (bEnableSaveButton);
	GetDlgItem(IDC_BUTTON2)->EnableWindow (bEnableEditButton);
	GetDlgItem(IDC_BUTTON3)->EnableWindow (bEnableRestorButton);
	GetDlgItem(IDC_BUTTON4)->EnableWindow (bEnableRestoreAllButton);
}