Exemple #1
0
/*******************************************************************************
  Function Name  : OnSelchangeComboSymbol
  Input(s)       : -
  Output         : -
  Functionality  : This function will be called by the framework if the item
                   selection in the combobox got changed. This will update the
                   selection in the global list and inm graph control
  Member of      : CGraphLeftView
  Author(s)      : Raja N
  Date Created   : 09/12/2004
  Modifications  :
*******************************************************************************/
void CGraphLeftView::OnSelchangeComboSymbol()
{
    UpdateData();

    CGraphElement odSelectedElement;
    // Get handle to selected message item
    int hSelItem = m_omSignalList.GetNextItem(-1, LVNI_SELECTED);

    if ( hSelItem != -1 )
    {
        CGraphList* podList = NULL;
        CGraphChildFrame* pParentWnd = NULL;
        pParentWnd = static_cast<CGraphChildFrame*>(pomGetParentWindow());

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

        // Update Element Details
        if( podList != NULL )
        {
            odSelectedElement = podList->m_omElementList[ hSelItem ];
            odSelectedElement.m_nPointType = m_nSymbolType;
            podList->m_omElementList[ hSelItem ] = odSelectedElement;
            vUpdateGraphControl( defFROM_POINT_TYPE, m_nSymbolType );
        }
        else
        {
            AfxMessageBox( defSTR_ELEMENT_NOT_FOUND, MB_ICONSTOP);
        }
    }
}
Exemple #2
0
/*******************************************************************************
  Function Name  : OnColorChange
  Input(s)       : lparam - Not Used
                   wparam - ID of the control
  Output         : -
  Functionality  : This function processes Color change event posted from the
                   CColorPopup dialog. This function updates global list value
                   as per the current selection
  Member of      : CLeftView
  Author(s)      : Raja N
  Date Created   : 09/12/2004
  Modifications  :
*******************************************************************************/
LRESULT CGraphLeftView::OnColorChange(WPARAM /*wparam*/, LPARAM lparam)
{
    CGraphElement odSelectedElement;
    // Get handle to selected message item
    int hSelItem = m_omSignalList.GetNextItem(-1, LVNI_SELECTED);

    if ( hSelItem != -1 )
    {
        CGraphList* podList = NULL;
        CGraphChildFrame* pParentWnd = NULL;
        pParentWnd = (CGraphChildFrame*)pomGetParentWindow();

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

        // Update Element Details
        if( podList != NULL )
        {
            if( hSelItem < podList->m_omElementList.GetSize() )
            {
                odSelectedElement = podList->m_omElementList[ hSelItem ];

                // Switch the Control ID
                switch( lparam )
                {
                        // Update Line Color
                    case IDC_LINE_COLOR:
                        odSelectedElement.m_nLineColor =
                            m_omLineColor.GetColour();
                        // Update List member
                        podList->m_omElementList[ hSelItem ] =
                            odSelectedElement;
                        // Update UI List Color
                        m_omSignalList.SetItemData( hSelItem,
                                                    odSelectedElement.m_nLineColor );
                        // Update Control
                        vUpdateGraphControl( defFROM_LINE_COLOR,
                                             odSelectedElement.m_nLineColor );
                        ((CGraphBottomView*)pParentWnd->m_pomBottomView)
                        ->vInsertSignalData();
                        ((CGraphBottomView*)pParentWnd->m_pomBottomView)
                        ->vUpdateSignalData();
                        break;

                        // Update Sample point color
                    case IDC_POINT_COLOR:
                        odSelectedElement.m_nPointColor =
                            m_omPointColor.GetColour();
                        // Update list member
                        podList->m_omElementList[ hSelItem ] =
                            odSelectedElement;
                        // Update Control
                        vUpdateGraphControl( defFROM_POINT_COLOR,
                                             odSelectedElement.m_nPointColor );
                        break;

                    default:
                        ASSERT( FALSE );
                }
            }
            else
            {
                AfxMessageBox( defSTR_ELEMENT_NOT_FOUND, MB_ICONSTOP);
            }
        }
    }

    return 0;
}