コード例 #1
0
//
// Two cases:
// 1) Check change on the value column (1)
// 2) Check change on the protected column (3)
void CuEditableListCtrlGenericDerived::OnCheckChange (int iItem, int iSubItem, BOOL bCheck)
{
	TRACE1 ("CuEditableListCtrlGeneric::OnCheckChange (%d)\n", (int)bCheck);
	CString strOnOff = bCheck? "ON": "OFF";
	DERIVEDLINEINFO* pData = (DERIVEDLINEINFO*)GetItemData (iItem);
	if (pData)
	{
		BOOL bOk = FALSE;
		CString strOldName = pData->szname;
		switch (iSubItem)
		{
		case 1:
			bOk = VCBBllOnEditDependent(pData,   (LPTSTR)(LPCTSTR)strOnOff);
			break;
		case 3:
			strOnOff = bCheck? "yes": "no";
			bOk = VCBBllOnDependentProtectChange (pData, (LPTSTR)(LPCTSTR)strOnOff);
			break;
		default:
			break;
		}

		ASSERT (strOldName == pData->szname);
		VCBF_GenericDerivedAddItem (this, (LPCTSTR)strOldName, GetGenericForCache());
	}
}
コード例 #2
0
LONG CuEditableListCtrlGeneric::OnEditSpinDlgOK (UINT wParam, LONG lParam)
{
	int iItem, iSubItem;
	int iMin, iMax;
	CString s = EDITSPIN_GetText();
	if (s.IsEmpty())
	{
		EDITSPIN_GetRange (iMin, iMax);
		s.Format (_T("%d"), iMin);
	}
	EDITSPIN_GetEditItem(iItem, iSubItem);
	if (iItem < 0)
		return 0L;

	try
	{
		GENERICLINEINFO* pData = (GENERICLINEINFO*)GetItemData (iItem);
		if (pData)
		{
			CString strOldName = pData->szname;
			if (GetGenericForCache())
			{
				//
				// Special care of cache management.
				VCBFllCachePaneOnEdit (pData, (LPTSTR)(LPCTSTR)s);
			}
			else
			{
				VCBFllGenPaneOnEdit(pData, (LPTSTR)(LPCTSTR)s);
			}		ASSERT (strOldName == pData->szname);
			VCBF_GenericSetItem (this, pData, iItem);
		}
	}
	catch (CeVcbfException e)
	{
		//
		// Catch critical error 
		TRACE1 ("CuEditableListCtrlGeneric::OnEditSpinDlgOK has caught exception: %s\n", e.m_strReason);
		CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
		pMain->CloseApplication (FALSE);
	}
	catch (CMemoryException* e)
	{
		VCBF_OutOfMemoryMessage ();
		e->Delete();
	}
	catch (...)
	{
		TRACE0 ("Other error occured ...\n");
	}
	return 0L;
}
コード例 #3
0
LONG CuEditableListCtrlGenericDerived::OnEditSpinDlgOK (UINT wParam, LONG lParam)
{
	int iItem, iSubItem;
	int iMin, iMax;
	CString s = EDITSPIN_GetText();
	if (s.IsEmpty())
	{
		EDITSPIN_GetRange (iMin, iMax);
		s.Format (_T("%d"), iMin);
	}
	EDITSPIN_GetEditItem(iItem, iSubItem);
	if (iItem < 0)
		return 0L;
	try
	{
		DERIVEDLINEINFO* pData = (DERIVEDLINEINFO*)GetItemData (iItem);
		if (pData)
		{
			CString strOldName = pData->szname;
			BOOL bOk = VCBBllOnEditDependent(pData, (LPTSTR)(LPCTSTR)s);
			ASSERT (strOldName == pData->szname);
			VCBF_GenericDerivedAddItem (this, (LPCTSTR)strOldName, GetGenericForCache());
		}
	}
	catch (CeVcbfException e)
	{
		//
		// Catch critical error 
		TRACE1 ("CuEditableListCtrlGenericDerived::OnEditSpinDlgOK has caught exception: %s\n", e.m_strReason);
		CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
		pMain->CloseApplication (FALSE);
	}
	catch (CMemoryException* e)
	{
		VCBF_OutOfMemoryMessage ();
		e->Delete();
	}
	catch (...)
	{
		TRACE0 ("Other error occured ...\n");
	}
	return 0L;
}
コード例 #4
0
void CuEditableListCtrlGeneric::OnCheckChange (int iItem, int iSubItem, BOOL bCheck)
{
	TRACE1 ("CuEditableListCtrlGeneric::OnCheckChange (%d)\n", (int)bCheck);
	CString strOnOff = bCheck? "ON": "OFF";
	GENERICLINEINFO* pData = (GENERICLINEINFO*)GetItemData (iItem);

	try
	{
		if (pData)
		{
			CString strOldName = (LPCTSTR)pData->szname;
			if (GetGenericForCache())
			{
				//
				// Special care of cache management.
				VCBFllCachePaneOnEdit (pData, (LPTSTR)(LPCTSTR)strOnOff);
			}
			else
			{
				VCBFllGenPaneOnEdit(pData, (LPTSTR)(LPCTSTR)strOnOff);
			}
			ASSERT (strOldName == pData->szname);
			VCBF_GenericSetItem (this, pData, iItem);
		}
	}
	catch (CeVcbfException e)
	{
		//
		// Catch critical error 
		TRACE1 ("CuEditableListCtrlGeneric::OnCheckChange has caught exception: %s\n", e.m_strReason);
		CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
		pMain->CloseApplication (FALSE);
	}
	catch (CMemoryException* e)
	{
		VCBF_OutOfMemoryMessage ();
		e->Delete();
	}
	catch (...)
	{
		TRACE0 ("Other error occured ...\n");
	}
}