Exemple #1
0
BOOL CuDlgDBEventPane01::OnInitDialog() 
{
    CDialog::OnInitDialog();
    VERIFY (m_cListDBEvent.SubclassDlgItem (IDC_MFC_LIST1, this));

    CView* pView = (CView*)GetParent();
    ASSERT (pView);
    CDbeventDoc* pDoc = (CDbeventDoc*)pView->GetDocument();
    ASSERT (pDoc);
    pDoc->SetRegisteredDBEventList (&m_cListDBEvent);
    try
    {
        //
        // If the Document is load, then we update the control.
        UpdateControl();
    }
    catch (CMemoryException* e)
    {
        VDBA_OutOfMemoryMessage();
        e->Delete();
    }
    catch (...)
    {
        throw;
    }
    return TRUE;  // return TRUE unless you set the focus to a control
                  // EXCEPTION: OCX Property Pages should return FALSE
}
Exemple #2
0
LONG CuDlgDomPropLocationSpace::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
    //case FILTER_DOM_SYSTEMOBJECTS:
    //case FILTER_DOM_BASEOWNER:
    //case FILTER_DOM_OTHEROWNER:
    //case FILTER_DOM_BKREFRESH:          // Special item - no refresh code
    //case FILTER_DOM_BKREFRESH_DETAIL:   // Special item - no refresh code
      break;

    default:
      return 0L;    // nothing to change on the display
  }

  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);

  LOCATIONDATAMIN locData;
  x_strcpy ((char *)locData.LocationName, (const char *)lpRecord->objName);
  x_strcpy ((char *)locData.LocationArea, (const char *)lpRecord->szComplim);
  // Just in case - Normally not used by Create method with 2 parameters
  locData.LocationUsages[0] = ATTACHED_NO;   // DATA_PATH
  locData.LocationUsages[1] = ATTACHED_NO;   // WORK_PATH
  locData.LocationUsages[2] = ATTACHED_NO;   // JNL_PATH
  locData.LocationUsages[3] = ATTACHED_NO;   // CHK_PATH
  locData.LocationUsages[4] = ATTACHED_NO;   // DMP_PATH

  try
  {
    ResetDisplay();
    CaPieInfoData* pPieInfo = m_pDlgFrame->GetPieInformation();
    pPieInfo->Cleanup();
    if (!Pie_Create(pPieInfo, nNodeHandle, &locData))
    {
        AfxMessageBox (IDS_E_LOCATION_SPACE, MB_ICONEXCLAMATION|MB_OK);
        pPieInfo->Cleanup();
    }
    m_pDlgFrame->UpdatePieChart();
    m_pDlgFrame->UpdateLegend();
  }
  catch (CMemoryException* e)
  {
      VDBA_OutOfMemoryMessage();
      e->Delete();
  }
  return 0L;
}
Exemple #3
0
BOOL CuDlgDBEventPane02::OnInitDialog() 
{
    CDialog::OnInitDialog();
    VERIFY (m_cListRaisedDBEvent.SubclassDlgItem (IDC_MFC_LIST1, this));
    //
    // Initalize the Column Header of CListCtrl (CuListCtrl)
    //
    LV_COLUMN lvcolumn;
    UINT      strHeaderID[LAYOUT_NUMBER] = 
    {
        IDS_RAISEDDBE_NUM,
        IDS_RAISEDDBE_TIME, 
        IDS_RAISEDDBE_NAME, 
        IDS_RAISEDDBE_OWNER, 
        IDS_RAISEDDBE_TEXT
    };
    int i, hWidth   [LAYOUT_NUMBER] = {40, 100, 80, 100, 400};
    //
    // Set the number of columns: LAYOUT_NUMBER
    //
    memset (&lvcolumn, 0, sizeof (LV_COLUMN));
    lvcolumn.mask = LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH;
    for (i=0; i<LAYOUT_NUMBER; i++)
    {
        CString strHeader;
        strHeader.LoadString (strHeaderID[i]);
        lvcolumn.fmt = LVCFMT_LEFT;
        lvcolumn.pszText = (LPTSTR)(LPCTSTR)strHeader;
        lvcolumn.iSubItem = i;
        lvcolumn.cx = hWidth[i];
        m_cListRaisedDBEvent.InsertColumn (i, &lvcolumn); 
    }
    CView* pView = (CView*)GetParent();
    ASSERT (pView);
    CDbeventDoc* pDoc = (CDbeventDoc*)pView->GetDocument();
    ASSERT (pDoc);
    pDoc->SetRaisedDBEventList (&m_cListRaisedDBEvent);
    try
    {
        //
        // If the Document is load, then we update the control.
        UpdateControl();
    }
    catch (CMemoryException* e)
    {
        VDBA_OutOfMemoryMessage ();
        e->Delete();
    }
    catch (...)
    {
        throw;
    }
    return TRUE;  // return TRUE unless you set the focus to a control
                  // EXCEPTION: OCX Property Pages should return FALSE
}
Exemple #4
0
LONG CuDlgDomPropTableStatistic::OnLoad (WPARAM wParam, LPARAM lParam)
{
	int nCount = 0;
	try
	{
		LPCTSTR pClass = (LPCTSTR)wParam;
		ASSERT (lstrcmp (pClass, "CuDomPropDataTableStatistic") == 0);
		CuDomPropDataTableStatistic* pData = (CuDomPropDataTableStatistic*)lParam;
		m_nOT = pData->m_statisticData.m_nOT;
		m_statisticData = pData->m_statisticData;
		InitializeStatisticHeader(m_statisticData.m_nOT);

		//
		// List of statistic columns;
		CaTableStatisticColumn* pColumn = NULL;
		while (!m_statisticData.m_listColumn.IsEmpty())
		{
			pColumn = m_statisticData.m_listColumn.RemoveHead();
			if (m_cListColumn.InsertItem (nCount, "") != -1)
			{
				m_cListColumn.SetItemData (nCount, (DWORD)pColumn);
				nCount++;
			}
		}
		UpdateDisplayList1();
		m_bLoad = TRUE; // Prevent from calling OnItemchangedList1()
		m_cListColumn.SetItemState (pData->m_nSelectColumn, LVIS_SELECTED, LVIS_SELECTED);
		m_bLoad = FALSE;
		//
		// Draw statistic Items:
		DrawStatistic ();
		//
		// Extra information:
		m_bUniqueFlag          = m_statisticData.m_bUniqueFlag;
		m_bCompleteFlag        = m_statisticData.m_bCompleteFlag;
		m_strUniqueValues.Format (_T("%ld"), m_statisticData.m_lUniqueValue);
		m_strRepetitionFactors.Format (_T("%ld"), m_statisticData.m_lRepetitionFlag);
		UpdateData (FALSE);
		m_bExecuted = TRUE;
	}
	catch (CMemoryException* e)
	{
		VDBA_OutOfMemoryMessage();
		e->Delete();
	}
	catch (...)
	{
		//CString strMsg = _T("Internal error: cannot display the statistic of the table.");
		AfxMessageBox (VDBA_MfcResourceString(IDS_E_STAT_TABLE));
	}
	EnableButtons();
	return 0L;
}
Exemple #5
0
LONG CuDlgIpmPageClient::OnGetData (WPARAM wParam, LPARAM lParam)
{
	CuIpmPropertyDataPageClient* pData = NULL;
	try
	{
		pData = new CuIpmPropertyDataPageClient (&m_ssStruct);
	}
	catch (CMemoryException* e)
	{
		VDBA_OutOfMemoryMessage();
		e->Delete();
	}
	return (LRESULT)pData;
}
Exemple #6
0
LONG CuDlgDomPropTableStatistic::OnGetData (WPARAM wParam, LPARAM lParam)
{
	CuDomPropDataTableStatistic* pData = NULL;
	CaTableStatisticColumn* pColumn = NULL;
	CaTableStatisticColumn* pNewColumn = NULL;
	CaTableStatisticItem* pStatItem = NULL;
	CaTableStatisticItem* pNewStatItem = NULL;
	int i, nCount;
	try
	{
		nCount = m_cListColumn.GetItemCount();
		pData  = new CuDomPropDataTableStatistic();
		pData->m_statisticData = m_statisticData;
		pData->m_nSelectColumn = -1;
		for (i=0; i<nCount; i++)
		{
			pColumn = (CaTableStatisticColumn*)m_cListColumn.GetItemData(i);
			pNewColumn = new CaTableStatisticColumn();
			*pNewColumn= *pColumn;
			pData->m_statisticData.m_listColumn.AddTail(pNewColumn);
			if (m_cListColumn.GetItemState (i, LVIS_SELECTED) & LVIS_SELECTED)
				pData->m_nSelectColumn = i;
		}

		nCount = m_cListStatItem.GetItemCount();
		for (i=0; i<nCount; i++)
		{
			pStatItem = (CaTableStatisticItem*)m_cListStatItem.GetItemData(i);
			if (!pStatItem)
				continue;
			pNewStatItem = new CaTableStatisticItem();
			*pNewStatItem= *pStatItem;
			pData->m_statisticData.m_listItem.AddTail (pNewStatItem);
		}
	}
	catch (CMemoryException* e)
	{
		VDBA_OutOfMemoryMessage();
		e->Delete();
	}
	catch (...)
	{
		//CString strMsg = _T("Cannot allocate data for storing.");
		AfxMessageBox (VDBA_MfcResourceString(IDS_E_ALLOCATE_DATA));
		pData = NULL;
	}
	return (LRESULT)pData;
}
Exemple #7
0
LONG CuDlgIpmDetailLocation::OnGetData (WPARAM wParam, LPARAM lParam)
{
	CuIpmPropertyDataDetailLocation* pData = NULL;
	try
	{
		CuStatisticPieDoc* pDoc =  (CuStatisticPieDoc*)m_pDlgFrame->GetDoc();
		pData = new CuIpmPropertyDataDetailLocation ();
		pData->m_pPieInfo = pDoc->GetPieInfo();
	}
	catch (CMemoryException* e)
	{
		VDBA_OutOfMemoryMessage();
		e->Delete();
	}
	return (LRESULT)pData;
}
Exemple #8
0
LONG CuDlgIpmDetailLocation::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
	int ires = RES_ERR, nNodeHandle = (int)wParam;
	LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;

	ASSERT (pUps);
	switch (pUps->nIpmHint)
	{
	case 0:
	case FILTER_IPM_EXPRESS_REFRESH:
		break;
	default:
		return 0L;
	}
	try
	{
		ResetDisplay();
		if (pUps->nIpmHint != FILTER_IPM_EXPRESS_REFRESH)
		{
			memset (&m_locStruct, 0, sizeof (m_locStruct));
			m_locStruct = *(LPLOCATIONDATAMIN)pUps->pStruct;
		}

		CuStatisticPieDoc* pDoc   =  (CuStatisticPieDoc*)m_pDlgFrame->GetDoc();
		CuPieInfoData* pPieInfo = pDoc->GetPieInfo();
		if (Pie_Create(pPieInfo, nNodeHandle, (LPLOCATIONDATAMIN)&m_locStruct, TRUE))
		{
			m_pDlgFrame->DrawLegend (&m_cListLegend, TRUE);
		}
		else
		{
			//CString strMsg = _T("Location Space Statistic error");
			BfxMessageBox (VDBA_MfcResourceString(IDS_E_LOCATION_SPACE), MB_ICONEXCLAMATION|MB_OK);
			pPieInfo->Cleanup();
			m_cListLegend.ResetContent();
		}
		pDoc->UpdateAllViews (NULL);
	}
	catch (CMemoryException* e)
	{
		VDBA_OutOfMemoryMessage();
		e->Delete();
	}
	return 0L;
}
Exemple #9
0
void CuDlgDomPropTableStatistic::OnItemchangedList1(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
	*pResult = 0;
	if (m_bLoad)
		return;

	CaTableStatisticColumn* pColumn = NULL;
	if (pNMListView->iItem >= 0 && pNMListView->uNewState > 0 && (pNMListView->uNewState&LVIS_SELECTED))
	{
		CWaitCursor doWaitCursor;
		try
		{
			pColumn = (CaTableStatisticColumn*)m_cListColumn.GetItemData(pNMListView->iItem);
			CleanStatisticItem();
			if (!pColumn)
				return;
			if (!pColumn->m_bHasStatistic)
				return;
			//
			// Query the statistic for this column:
			//
			Table_GetStatistics (pColumn, m_statisticData);
			// Extra information:
			m_bUniqueFlag          = m_statisticData.m_bUniqueFlag;
			m_bCompleteFlag        = m_statisticData.m_bCompleteFlag;
			m_strUniqueValues.Format (_T("%ld"), m_statisticData.m_lUniqueValue);
			m_strRepetitionFactors.Format (_T("%ld"), m_statisticData.m_lRepetitionFlag);
			DrawStatistic ();
		}
		catch (CMemoryException* e)
		{
			VDBA_OutOfMemoryMessage();
			e->Delete();
		}
		catch (...)
		{
			//CString strMsg = _T("Internal error: cannot display the statistic of the table.");
			AfxMessageBox (VDBA_MfcResourceString(IDS_E_STAT_TABLE));
		}
	}
	UpdateData (FALSE);
	EnableButtons();

}
Exemple #10
0
LONG CuDlgIpmPageClient::OnLoad (WPARAM wParam, LPARAM lParam)
{
	LPCTSTR pClass = (LPCTSTR)wParam;
	LPSESSIONDATAMAX pSess = (LPSESSIONDATAMAX)lParam;
	ASSERT (lstrcmp (pClass, "CuIpmPropertyDataPageClient") == 0);
	memcpy (&m_ssStruct, pSess, sizeof (m_ssStruct));
	try
	{
		ResetDisplay();
		InitClassMembers ();
		UpdateData (FALSE);
	}
	catch (CMemoryException* e)
	{
		VDBA_OutOfMemoryMessage();
		e->Delete();
	}
	return 0L;
}
Exemple #11
0
LONG CuDlgIpmPageClient::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
	int res = RES_ERR;
	LPIPMUPDATEPARAMS  pUps = (LPIPMUPDATEPARAMS)lParam;
	ASSERT (pUps);
	switch (pUps->nIpmHint)
	{
	case 0:
	case FILTER_INTERNAL_SESSIONS:
	case FILTER_IPM_EXPRESS_REFRESH:
		break;
	default:
		return 0L;
	}
	//
	// Initialize the member variables: ...and call UpdateData();
	try
	{
		ResetDisplay();
		if (pUps->nIpmHint != FILTER_IPM_EXPRESS_REFRESH)
		{
			memset (&m_ssStruct, 0, sizeof (m_ssStruct));
			m_ssStruct.sessiondatamin = *(LPSESSIONDATAMIN)pUps->pStruct;
		}
		res = MonGetDetailInfo((int)wParam, &m_ssStruct, OT_MON_SESSION, 0);
		if (res != RES_SUCCESS)
		{
			InitClassMembers (TRUE);
		}
		else
		{
			InitClassMembers ();
		}
		UpdateData (FALSE);
	}
	catch (CMemoryException* e)
	{
		VDBA_OutOfMemoryMessage();
		e->Delete();
	}
	return 0L;
}
Exemple #12
0
LONG CuDlgDomPropLocationSpace::OnGetData (WPARAM wParam, LPARAM lParam)
{
    CuIpmPropertyDataPageLocation* pData = NULL;
    try
    {
        pData = new CuIpmPropertyDataPageLocation ();
        if (lParam == GETDIALOGDATAWITHDUP) {
          // Duplicate object
            pData->m_pPieInfo = new CaPieInfoData(m_pDlgFrame->GetPieInformation());
        }
        else
            pData->m_pPieInfo = m_pDlgFrame->GetPieInformation(); // no duplication
    }
    catch (CMemoryException* e)
    {
        VDBA_OutOfMemoryMessage();
        e->Delete();
    }
    return (LRESULT)pData;
}
Exemple #13
0
LONG CuDlgIpmDetailLocation::OnLoad (WPARAM wParam, LPARAM lParam)
{
	LPCTSTR pClass = (LPCTSTR)wParam;
	CuPieInfoData* pData = (CuPieInfoData*)lParam;
	ASSERT (lstrcmp (pClass, "CuIpmPropertyDataDetailLocation") == 0);
	if (!pData)
		return 0L;
	try
	{
		ResetDisplay();
		CuStatisticPieDoc* pDoc =  (CuStatisticPieDoc*)m_pDlgFrame->GetDoc();
		pDoc->SetPieInfo (pData);
		pDoc->UpdateAllViews (NULL);
		m_pDlgFrame->DrawLegend (&m_cListLegend, TRUE);
	}
	catch (CMemoryException* e)
	{
		VDBA_OutOfMemoryMessage();
		e->Delete();
	}
	return 0L;
}
Exemple #14
0
LONG CuDlgDomPropLocationSpace::OnLoad (WPARAM wParam, LPARAM lParam)
{
    LPCTSTR pClass = (LPCTSTR)wParam;
    CaPieInfoData* pData = (CaPieInfoData*)lParam;
    ASSERT (_tcscmp (pClass, _T("CuIpmPropertyDataPageLocation")) == 0);
    ResetDisplay();
    if (!pData)
        return 0L;
    try
    {
       if (!m_pDlgFrame)
           return 0;
        m_pDlgFrame->SetPieInformation(pData);
        m_pDlgFrame->UpdatePieChart();
        m_pDlgFrame->UpdateLegend();
    }
    catch (CMemoryException* e)
    {
        VDBA_OutOfMemoryMessage();
        e->Delete();
    }
    return 0L;
}
Exemple #15
0
LONG CuDlgDomPropTableStatistic::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
	// cast received parameters
	int nNodeHandle = (int)wParam;
	LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
	ASSERT (nNodeHandle != -1);
	ASSERT (pUps);
	if (pUps->nIpmHint == FILTER_DOM_BKREFRESH) {
		ASSERT (FALSE);   // Should not occur!
		return 0L;
	}

	try
	{
		if (pUps->nType != m_nOT)
		{
			CleanStatisticItem();
			CleanListColumns();
			InitializeStatisticHeader(pUps->nType);
		}
		m_nOT = pUps->nType;

		int nNodeHandle = (int)wParam;
		BOOL bCheck = FALSE; 
		LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
		ASSERT (nNodeHandle != -1);
		ASSERT (pUps);
		LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
		ASSERT (lpRecord);
		if (!lpRecord)
			return 0L;
		m_statisticData.Cleanup();
		//
		// Ignore selected actions on filters
		switch (pUps->nIpmHint)
		{
		case 0:
			//
			// Normal updating
			break;
		case -1:
			//
			// Selection changes in the Right pane 
			bCheck = TRUE;
			break;
		default:
			//
			// Nothing to change on the display
			return 0L;
		}
		
		//
		// Check if we need the update or not:
		if (bCheck && m_bExecuted)
		{
			if (m_statisticData.m_strDBName.CompareNoCase ((const char *)lpRecord->extra) == 0)
				if (m_statisticData.m_strTable.CompareNoCase ((const char *)lpRecord->objName) == 0)
					if (m_statisticData.m_strTableOwner.CompareNoCase ((const char *)lpRecord->ownerName) == 0)
						return 0L;
		}

		m_statisticData.m_nOT = m_nOT;
		m_statisticData.m_strVNode      = (LPCTSTR)(LPUCHAR)GetVirtNodeName (nNodeHandle);
		m_statisticData.m_strDBName     = (const char *)lpRecord->extra;
		if (m_nOT == OT_TABLE)
		{
			m_statisticData.m_strTable      = RemoveDisplayQuotesIfAny((LPCTSTR)StringWithoutOwner(lpRecord->objName));
			m_statisticData.m_strTableOwner = (const char *)lpRecord->ownerName;
		}
		else
		if (m_nOT == OT_INDEX)
		{
			m_statisticData.m_strTable      = lpRecord->extra2;
			m_statisticData.m_strTableOwner = (const char *)lpRecord->ownerName;
			m_statisticData.m_strIndex      = RemoveDisplayQuotesIfAny((LPCTSTR)StringWithoutOwner(lpRecord->objName));
		}

		CleanStatisticItem();
		QueryStatColumns();
		
		if (m_cListColumn.GetItemCount() > 0)
		{
			//
			// This line cause to execute the member: OnItemchangedList1()
			m_cListColumn.SetItemState (0, LVIS_SELECTED, LVIS_SELECTED);
		}
		UpdateData (FALSE);
		m_bExecuted = TRUE;
		EnableButtons();
		return 0L;
	}
	catch (CMemoryException* e)
	{
		VDBA_OutOfMemoryMessage();
		e->Delete();
	}
	catch (CeSQLException e)
	{
		AfxMessageBox (e.m_strReason, MB_ICONEXCLAMATION|MB_OK);
	}
	catch (...)
	{
		//CString strMsg = _T("Internal error: cannot display the statistic of the table.");
		AfxMessageBox (VDBA_MfcResourceString(IDS_E_STAT_TABLE));
	}
	CleanStatisticItem();
	m_statisticData.Cleanup();
	return 0L;
}
Exemple #16
0
void CuDlgDomPropTableStatistic::OnOutofmemoryList2(NMHDR* pNMHDR, LRESULT* pResult) 
{
	VDBA_OutOfMemoryMessage();
	*pResult = 1;
}