Exemplo n.º 1
0
/*******************************************************************************
 Function Name    : OnRemove
 Input(s)         :     -
 Output           :     -
 Functionality    : This will will remove the selected item from the third list
                    and will put the first element in the first list and second
                    element in the second list.
 Member of        :     -
 Friend of        :     -
 Author(s)        : Amit Ranjan
 Date Created     : 23.04.2004
 Modifications    :
*******************************************************************************/
void CEnvVarHandlerDlg::OnRemove()
{
    CString ekey;
    if((m = m_EquiKeys.GetCurSel()) != LB_ERR)
    {
        GetDlgItem( IDC_CBTN_ADD )->EnableWindow(TRUE);
        m_EquiKeys.GetText( m,ekey );
        int k = ekey.Find(' ',0);
        if( k != -1)
        {
            m_UnSupKeys.AddString(ekey.Left(k));
            m_AltKeys.AddString(ekey.Right(1));
        }

        acAltKey [ ouUnSptdKey.nFind( ekey.Left( k)) ] = -1;

        m_EquiKeys.DeleteString(m);

        m_UnSupKeys.SetCurSel(0);
        m_AltKeys.SetCurSel(0);
        m_EquiKeys.SetCurSel(0);
    }

    if(m_EquiKeys.GetCount()==0)
    {
        GetDlgItem(IDC_CBTN_RMV)->EnableWindow(FALSE);
    }
}
Exemplo n.º 2
0
/*******************************************************************************
 Function Name    : OnAdd
 Input(s)         :     -
 Output           :     -
 Functionality    : This will take selected element from first two list and add
                    it to the third one.The element selected from the second
                    list will be added to acAltKey array at the place where the
                    first list element is stored in acUnSptdKey array.
 Member of        :     -
 Friend of        :     -
 Author(s)        : Amit Ranjan
 Date Created     : 23.04.2004
 Modifications    :
*******************************************************************************/
void CEnvVarHandlerDlg::OnAdd()
{
    int m = 0;

    CString uns,alt,uns1;

    m = m_UnSupKeys.GetCurSel();

    m_UnSupKeys.GetText( m,uns );//store selected element from first list
    m_UnSupKeys.GetText( m,uns1 );
    m_UnSupKeys.DeleteString( m );//delete it
    m = m_AltKeys.GetCurSel();

    m_AltKeys.GetText( m,alt );//store selected element from second list
    m_AltKeys.DeleteString( m );

    uns = uns+" --->  ";
    uns = uns + alt;
    m_EquiKeys.AddString( uns );//add both to third list

    acAltKey[ouUnSptdKey.nFind(uns1)] = alt[0];//add the key to acAltKeylist

    m_UnSupKeys.SetCurSel(0);//set first item selected
    m_AltKeys.SetCurSel(0);
    m_EquiKeys.SetCurSel(0);
    if(m_UnSupKeys.GetCount() == 0 || m_AltKeys.GetCount() == 0 )
    {
        GetDlgItem( IDC_CBTN_ADD )->EnableWindow(FALSE);
    }
    else
    {
        GetDlgItem( IDC_CBTN_ADD )->EnableWindow(TRUE);
    }
    GetDlgItem( IDC_CBTN_RMV )->EnableWindow(TRUE);
}
Exemplo n.º 3
0
/*******************************************************************************
 Function Name    : OnTerminate
 Input(s)         :     -
 Output           :     -
 Functionality    : This will take first item from list one and first item from
                    list two to make the default selection of available keys for
                    the unsupported keys.This will write the user intervention
                    for the alternate keys in the log file also.
 Member of        :     -
 Friend of        :     -
 Author(s)        : Amit Ranjan
 Date Created     : 27.04.2004
 Modifications    :
*******************************************************************************/
void CEnvVarHandlerDlg::OnTerminate()
{
    CString buffer;
    CString uns,alt,uns1;

    if(m_UnSupKeys.GetCount()>0)
    {
        if ( m_AltKeys.GetCount() > 0 )
        {
            MessageBox(defSTR_Warning6,MB_OK);
        }
        while(m_UnSupKeys.GetCount()!=0)
        {
            if(m_AltKeys.GetCount()>0)
            {
                m_UnSupKeys.GetText(0,uns);
                m_UnSupKeys.GetText(0,uns1);
                m_UnSupKeys.DeleteString(0);

                m_AltKeys.GetText(0,alt);
                m_AltKeys.DeleteString(0);

                uns = uns+" --->  ";
                uns = uns + alt;
                m_EquiKeys.AddString(uns);

                acAltKey[ ouUnSptdKey.nFind(uns1) ] = alt[0];
            }
            else
            {
                m_UnSupKeys.DeleteString(0);
            }
        }
    }

    /*if( m_EquiKeys.GetCount() > 0 )
    {
        fprintf(pFileLog,"---***********************************---");
        fprintf(pFileLog,"\n---*****CEnvVarHandlerDlg Of User Intervention*****---");
        fprintf(pFileLog,"\n---***********************************---");
        fprintf(pFileLog,"\n Unsupported Key -->Equivalent Key");
        fprintf(pFileLog,"\n ---------------    ---------------\n");
    }

    for(int m = 0; m <= m_EquiKeys.GetCount()-1; m++ )
    {
        m_EquiKeys.GetText( m,buffer );
        fprintf(pFileLog,"\t%s\n",buffer);
    }*/

    m_UnSupKeys.ResetContent();
    m_EquiKeys.ResetContent();
    m_AltKeys.ResetContent();
    CEnvVarHandlerDlg::OnOK();
}