Exemple #1
0
LONG CuDlgStarDerived::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
	CWnd* pParent1 = GetParent ();              // CTabCtrl
	ASSERT_VALID (pParent1);
	CWnd* pParent2 = pParent1->GetParent ();    // CConfRightDlg
	ASSERT_VALID (pParent2);

	CButton* pButton1 = (CButton*)((CConfRightDlg*)pParent2)->GetDlgItem (IDC_BUTTON1);
	CButton* pButton2 = (CButton*)((CConfRightDlg*)pParent2)->GetDlgItem (IDC_BUTTON2);

	CString csButtonTitle;
	csButtonTitle.LoadString(IDS_BUTTON_EDIT_VALUE);
	pButton1->SetWindowText (csButtonTitle);

	csButtonTitle.LoadString(IDS_BUTTON_RECALCULATE);
	pButton2->SetWindowText (csButtonTitle);

	pButton1->ShowWindow (SW_SHOW);
	pButton2->ShowWindow (SW_SHOW);

	if (!IsWindow (m_ListCtrl.m_hWnd))
		return 0;
	VCBF_GenericDerivedAddItem (&m_ListCtrl);
	return 0L;
}
Exemple #2
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());
	}
}
Exemple #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;
}
Exemple #4
0
LONG CuDlgSecurityAuditingDerived::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
    //
    // First of all:
    // manage potential change between left group and right group of property pages
    //
    // Fix Oct 27, 97: lParam is NULL when OnUpdateData() called
    // after activation of "Preferences" tag followed by activation of "Configure" tag
    if (lParam) {
        CuSECUREItemData *pSecureData = (CuSECUREItemData*)lParam;
        // terminate old page family
        pSecureData->LowLevelDeactivationWithCheck();
        // set page family
        pSecureData->SetSpecialType(GEN_FORM_SECURE_C2);
        // Initiate new page family
        BOOL bOk = pSecureData->LowLevelActivationWithCheck();
        ASSERT (bOk);
    }

    CWnd* pParent1 = GetParent ();              // CTabCtrl
    ASSERT_VALID (pParent1);
    CWnd* pParent2 = pParent1->GetParent ();    // CConfRightDlg
    ASSERT_VALID (pParent2);

    CButton* pButton1 = (CButton*)((CConfRightDlg*)pParent2)->GetDlgItem (IDC_BUTTON1);
    CButton* pButton2 = (CButton*)((CConfRightDlg*)pParent2)->GetDlgItem (IDC_BUTTON2);

    CString csButtonTitle;
    csButtonTitle.LoadString(IDS_BUTTON_EDIT_VALUE);
    pButton1->SetWindowText (csButtonTitle);

    csButtonTitle.LoadString(IDS_BUTTON_RECALCULATE);
    pButton2->SetWindowText (csButtonTitle);

    pButton1->ShowWindow (SW_SHOW);
    pButton2->ShowWindow (SW_SHOW);

    if (!IsWindow (m_ListCtrl.m_hWnd))
        return 0;
    VCBF_GenericDerivedAddItem (&m_ListCtrl);
    return 0L;
}
Exemple #5
0
LONG CuDlgDbmsCacheDerived::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
	if (!IsWindow (m_ListCtrl.m_hWnd))
		return 0;
	CWnd* pParent1 = GetParent ();              // CTabCtrl
	ASSERT_VALID (pParent1);
	CWnd* pParent2 = pParent1->GetParent ();    // CuDlgCacheTab
	ASSERT_VALID (pParent2);
	CWnd* pParent3 = pParent2->GetParent ();    // CvDbmsCacheViewRight
	ASSERT_VALID (pParent3);
	CWnd* pParent4 = pParent3->GetParent ();    // CSplitterWnd
	ASSERT_VALID (pParent4);
	CWnd* pParent5 = pParent4->GetParent ();    // CfDbmsCacheFrame
	ASSERT_VALID (pParent5);
	CWnd* pParent6 = pParent5->GetParent ();    // CuDlgDmbsCache
	ASSERT_VALID (pParent6);
	CWnd* pParent7 = pParent6->GetParent ();    // CTabCtrl
	ASSERT_VALID (pParent1);
	CWnd* pParent8 = pParent7->GetParent ();    // CConfRightDlg
	ASSERT_VALID (pParent8);


	CButton* pButton1 = (CButton*)((CConfRightDlg*)pParent8)->GetDlgItem (IDC_BUTTON1);
	CButton* pButton2 = (CButton*)((CConfRightDlg*)pParent8)->GetDlgItem (IDC_BUTTON2);

	CString csButtonTitle;
	csButtonTitle.LoadString(IDS_BUTTON_EDIT_VALUE);
	pButton1->SetWindowText (csButtonTitle);
	csButtonTitle.LoadString(IDS_BUTTON_RECALCULATE);
	pButton2->SetWindowText (csButtonTitle);
	pButton1->ShowWindow (SW_SHOW);
	pButton2->ShowWindow (SW_SHOW);

	VCBF_GenericDerivedAddItem (&m_ListCtrl, NULL, TRUE);
	return 0L;
}