home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 April / VPR0004A.BIN / OLS / SADKT100 / sadkt100.lzh / SrcFiles.lzh / FilesDlg.cpp < prev    next >
C/C++ Source or Header  |  1999-12-31  |  2KB  |  87 lines

  1. // FilesDlg.cpp : インプリメンテーション ファイル
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "resource.h"
  6. #include "FilesDlg.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // FilesDlg ダイアログ
  16.  
  17.  
  18. FilesDlg::FilesDlg(CWnd* pParent /*=NULL*/)
  19.     : CDialog(FilesDlg::IDD, pParent)
  20. {
  21.     //{{AFX_DATA_INIT(FilesDlg)
  22.         // メモ - ClassWizard はこの位置にマッピング用のマクロを追加または削除します。
  23.     //}}AFX_DATA_INIT
  24.     m_csSel=_T("");
  25.  
  26. }
  27.  
  28.  
  29. void FilesDlg::DoDataExchange(CDataExchange* pDX)
  30. {
  31.     CDialog::DoDataExchange(pDX);
  32.     //{{AFX_DATA_MAP(FilesDlg)
  33.         // メモ - ClassWizard はこの位置にマッピング用のマクロを追加または削除します。
  34.     //}}AFX_DATA_MAP
  35. }
  36.  
  37.  
  38. BEGIN_MESSAGE_MAP(FilesDlg, CDialog)
  39.     //{{AFX_MSG_MAP(FilesDlg)
  40.     //}}AFX_MSG_MAP
  41. END_MESSAGE_MAP()
  42.  
  43. /////////////////////////////////////////////////////////////////////////////
  44. // FilesDlg メッセージ ハンドラ
  45.  
  46. void FilesDlg::SetListPointer(list<CString> *plt)
  47. {
  48.     m_psltF=plt;
  49. }
  50.  
  51.  
  52. BOOL FilesDlg::OnInitDialog() 
  53. {
  54.     CDialog::OnInitDialog();
  55.     
  56.     // TODO: この位置に初期化の補足処理を追加してください
  57.  
  58.     CListBox *pLT=(CListBox*)GetDlgItem(IDC_LT_FILES);
  59.     list<CString>::iterator p=m_psltF->begin();
  60.     for(; p!=m_psltF->end(); p++)
  61.         pLT->AddString(*p);
  62.  
  63.     return TRUE;  // コントロールにフォーカスを設定しないとき、戻り値は TRUE となります
  64.                   // 例外: OCX プロパティ ページの戻り値は FALSE となります
  65. }
  66.  
  67. void FilesDlg::OnOK() 
  68. {
  69.     // TODO: この位置にその他の検証用のコードを追加してください
  70.  
  71.     CListBox *pLT=(CListBox*)GetDlgItem(IDC_LT_FILES);
  72.     int nIndex=pLT->GetCurSel();
  73.     if(nIndex==LB_ERR){
  74.         MessageBox("表示するファイルを選択してください。", "対応ファイルの表示", MB_OK);
  75.         return;
  76.     }
  77.     list<CString>::iterator p=m_psltF->begin();
  78.     for(int i=0; p!=m_psltF->end(); i++, p++){
  79.         if(i==nIndex){
  80.             m_csSel=*p;
  81.             break;
  82.         }
  83.     }
  84.  
  85.     CDialog::OnOK();
  86. }
  87.