Ejemplo n.º 1
0
void CParmFindOneDlg::OnTablMode() 
{
   UpdateData();
   EnableTable();
   ModifyTable();
   UpdateData(FALSE);
}
Ejemplo n.º 2
0
BOOL CParmFindOneDlg::OnInitDialog() 
{
   CParamDlg::OnInitDialog();

   m_TableSave = *m_pTable;

   SetValues();

   m_InValSpin.SetRange(0, SHRT_MAX);
   m_TableLenSpin.SetRange(1, SHRT_MAX);

   EnableTable();
   m_TableLenStr.Format("%d", m_pTable->Length());
   UpdateTable(FALSE);
   UpdateData(FALSE);

   return TRUE;
}
Ejemplo n.º 3
0
/////////////////////////////////////////////////////////////////////////////
// BOOL CS3Dialog::RefreshControls
//
/////////////////////////////////////////////////////////////////////////////
BOOL CS3Dialog::RefreshControls()
{
    BOOL		fConnected;
    
    CTable* pCToTable = m_pCTableCopy->m_pCToTable;
    CTable* pCFromTable = m_pCTableCopy->m_pCFromTable;
    CDataSource* pCDataSource = pCToTable->m_pCDataSource;

    // Must have a connection to edit other controls
    fConnected = pCToTable->IsConnected();

    //Enable certain dialog controls, only if connected
    EnableWindow(GetDlgItem(m_hWnd, IDE_TO_TABLE),		fConnected);
    EnableWindow(GetDlgItem(m_hWnd, IDT_TARGET),		fConnected);
    EnableWindow(GetDlgItem(m_hWnd, IDT_TOTABLEHELP),	fConnected);
    
    //Store the selected ProviderName and ProviderDesc
    LRESULT iSel = 0;
    if((iSel = SendMessage(GetDlgItem(m_hWnd, IDC_PROVIDER_NAME), CB_GETCURSEL, 0, 0L)) != CB_ERR)
    {
        //Since we have the CBS_SORT turned on, the order in the Combo Box does
        //not match our array, so we pass the array index (lParam) as the item data
        LRESULT lParam = SendMessage(GetDlgItem(m_hWnd, IDC_PROVIDER_NAME), CB_GETITEMDATA, iSel, 0L);
        ASSERT(lParam < (LONG)pCDataSource->m_cProviderInfo);
        pCDataSource->m_pwszProviderName = pCDataSource->m_rgProviderInfo[lParam].wszName;
        pCDataSource->m_pwszProviderParseName = pCDataSource->m_rgProviderInfo[lParam].wszParseName;
    }
    
    // Show user the connection string, and enable Next that requires connection
    if(fConnected)
    {
        //CONNECTSTATUS
        SetDlgItemText(m_hWnd, IDT_CONNECTSTATUS, "");
        
        //CONNECT_STRING
        wSetDlgItemText(m_hWnd, IDT_TO_CONNECT, wsz_CONNECT_STRING_,
            pCDataSource->m_pwszProviderName, 
            pCDataSource->m_pwszDataSource, 
            pCDataSource->m_pwszDBMS,
            pCDataSource->m_pwszDBMSVer,
            pCDataSource->m_pwszProviderFileName,
            pCDataSource->m_pwszProviderVer);

        //TABLEHELPMSG
        wSetDlgItemText(m_hWnd, IDT_TOTABLEHELP, wsz_TOTABLEHELP_, 
            pCDataSource->m_pwszTableTerm);
    }
    else
    {
        //CONNECTSTATUS
        wSetDlgItemText(m_hWnd, IDT_CONNECTSTATUS, wsz_NOT_CONNECTED);

        //CONNECT_STRING
        wSetDlgItemText(m_hWnd, IDT_TO_CONNECT, L"");
    }
    
    // If there is already a Table from previous selections, just use that one
    wSetDlgItemText(m_hWnd, IDE_TO_TABLE, pCToTable->m_TableInfo.wszTableName[0] ? pCToTable->m_TableInfo.wszTableName : pCFromTable->m_TableInfo.wszTableName);
    
    // Determine if there is enough information to move on
    return EnableTable();
}