コード例 #1
0
/*******************************************************************************
  Function Name  : OnLvnItemchangedListSignals
  Input(s)       : NMHDR *pNMHDR, LRESULT *pResult
  Output         : -
  Functionality  : This function handles the LVN_ITEMCHANGED event for
                   signals list control IDC_LIST_SIGNALS
  Member of      : CSigGrphConfigDlg
  Author(s)      : ArunKumar K
  Date Created   : 27-10-2010
  Modifications  :
*******************************************************************************/
void CSigGrphConfigDlg::OnLvnItemchangedListSignals(NMHDR* pNMHDR, LRESULT* pResult)
{
    NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;

    // Process only selection change message
    if(pNMListView->uNewState == ( LVIS_FOCUSED |LVIS_SELECTED ) )
    {
        // Get handle to selected message item
        int hSelItem = pNMListView->iItem;

        if ( hSelItem != -1 )
        {
            // Update selected element deteils
            CGraphList* podList = NULL;
            podList = &(m_pMainFrame->m_odGraphList[m_omCmbBusType.GetCurSel()]);

            // Update Element Details
            if( podList != NULL )
            {
                if( hSelItem < podList->m_omElementList.GetSize() )
                {
                    vSetElementDetails(podList->m_omElementList[ hSelItem ] );
                }
                else
                {
                    AfxMessageBox( defSTR_ELEMENT_NOT_FOUND, MB_ICONSTOP);
                }
            }
        }
    }

    // Update UI Controls
    vEnableDisableControls();
    *pResult = 0;
}
コード例 #2
0
ファイル: GraphLeftView.cpp プロジェクト: Ferrere/busmaster
/*******************************************************************************
  Function Name  : OnItemchangedListSignals
  Input(s)       : pNMHDR - Pointer to the list item struct
                   pResult - Pointer to the result value
  Output         : -
  Functionality  : This function will update line type, line color, point type,
                   point color, enable and visible properties of the selected
                   graph element
  Member of      : CGraphLeftView
  Author(s)      : Raja N
  Date Created   : 09/12/2004
  Modifications  :
*******************************************************************************/
void CGraphLeftView::OnItemchangedListSignals(NMHDR* pNMHDR, LRESULT* /*pResult*/)
{
    NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;

    // Process only selection change message
    if(pNMListView->uNewState == ( LVIS_FOCUSED |LVIS_SELECTED ) )
    {
        // Get handle to selected message item
        int hSelItem = pNMListView->iItem;

        if ( hSelItem != -1 )
        {
            // Update selected element deteils
            CGraphList* podList = NULL;
            CGraphChildFrame* pParentWnd = NULL;
            pParentWnd = (CGraphChildFrame*)pomGetParentWindow();

            if(pParentWnd != NULL)
            {
                podList = pParentWnd->pGetSignalListDetails();
            }
            else
            {
                return;
            }

            // Update Element Details
            if( podList != NULL )
            {
                if( hSelItem < podList->m_omElementList.GetSize() )
                {
                    vSetElementDetails(podList->m_omElementList[ hSelItem ] );
                    vUpdateGraphControl( defFRM_ELEMENT_SELECTION, hSelItem );
                }
                else
                {
                    AfxMessageBox( defSTR_ELEMENT_NOT_FOUND, MB_ICONSTOP);
                }
            }

            //SGW Code commented by Arun 21-10-2010
        }
    }

    // Update UI Controls
    vEnableDisableControls();
}
コード例 #3
0
/*******************************************************************************
  Function Name  : vUpdateLineDisplayOfElements
  Input(s)       : eDISPLAY_TYPE
  Output         : -
  Functionality  : This function will update the line display of all the
                   elements in currently selected bus.
  Member of      : CSigGrphConfigDlg
  Author(s)      : ArunKumar K
  Date Created   : 28-10-2010
  Modifications  :
*******************************************************************************/
void CSigGrphConfigDlg::vUpdateLineDisplayOfElements(eDISPLAY_TYPE eCurrDisplay)
{
    CGraphList* podList = NULL;
    CGraphElement odSelectedElement;
    podList = &(m_pMainFrame->m_odGraphList[m_omCmbBusType.GetCurSel()]);
    int nCounter = podList->m_omElementList.GetSize();
    for(int nIter = 0 ; nIter < nCounter; nIter++)
    {
        odSelectedElement = podList->m_omElementList[nIter];
        odSelectedElement.m_eDisplayType = eCurrDisplay;
        podList->m_omElementList[ nIter ] = odSelectedElement;
        int nCurrItem =m_omSignalList.GetSelectionMark();
        if(nCurrItem!=-1)
        {
            m_omSignalList.SetItemState( nCurrItem ,
                                         LVIS_SELECTED | LVIS_FOCUSED,
                                         LVIS_SELECTED | LVIS_FOCUSED);
            vSetElementDetails(podList->m_omElementList[ nCurrItem ] );
        }
    }
}