AddFileDownTaskDlg.cpp
上传用户:qhonly
上传日期:2013-06-10
资源大小:487k
文件大小:3k
源码类别:

界面编程

开发平台:

Visual C++

  1. // AddFileDownTaskDlg.cpp : 实现文件
  2. //
  3. #include "stdafx.h"
  4. #include "WebGet.h"
  5. #include "AddFileDownTaskDlg.h"
  6. // CAddFileDownTaskDlg
  7. IMPLEMENT_DYNCREATE(CAddFileDownTaskDlg, CRTDialog)
  8. CAddFileDownTaskDlg::CAddFileDownTaskDlg(CWnd* pParent,BOOL IsSave)
  9. : CRTDialog(CAddFileDownTaskDlg::IDD,pParent)
  10. {
  11. m_ParentTypeName.Empty();
  12. m_SavePath.Empty();
  13. m_FileFilter = "*";
  14. m_bSave = IsSave;
  15. m_TypeName = "";
  16. }
  17. CAddFileDownTaskDlg::~CAddFileDownTaskDlg()
  18. {
  19. }
  20. void CAddFileDownTaskDlg::DoDataExchange(CDataExchange* pDX)
  21. {
  22. CRTDialog::DoDataExchange(pDX);
  23. DDX_Control(pDX,IDC_S_TypeName,m_s_TypeName);
  24. DDX_Control(pDX,IDC_S_SavePath,m_s_SavePath);
  25. DDX_Control(pDX,IDC_S_FileFilter,m_s_FileFilter);
  26. DDX_Control(pDX,IDC_S_ParentType,m_s_ParentType);
  27. DDX_Control(pDX,IDC_E_FileFilter,m_e_FileFilter);
  28. DDX_Control(pDX,IDC_E_SavePath,m_e_SavePath);
  29. DDX_Control(pDX,IDC_E_TypeName,m_e_TypeName);
  30. DDX_Control(pDX,IDOK,m_b_Add);
  31. DDX_Control(pDX,IDCANCEL,m_b_Close);
  32. DDX_Control(pDX,IDC_B_Browser,m_b_Browser);
  33. DDX_Control(pDX,IDC_S_ParentTypeName,m_s_ParentTypeName);
  34. }
  35. BEGIN_MESSAGE_MAP(CAddFileDownTaskDlg, CRTDialog)
  36. ON_EN_CHANGE(IDC_E_TypeName, OnEnChangeETypename)
  37. ON_BN_CLICKED(IDOK, OnBnClickedOk)
  38. END_MESSAGE_MAP()
  39. // CAddFileDownTaskDlg 诊断
  40. #ifdef _DEBUG
  41. void CAddFileDownTaskDlg::AssertValid() const
  42. {
  43. CRTDialog::AssertValid();
  44. }
  45. void CAddFileDownTaskDlg::Dump(CDumpContext& dc) const
  46. {
  47. CRTDialog::Dump(dc);
  48. }
  49. #endif //_DEBUG
  50. // CAddFileDownTaskDlg 消息处理程序
  51. BOOL CAddFileDownTaskDlg::OnInitDialog()
  52. {
  53. CRTDialog::OnInitDialog();
  54. if(!m_ParentTypeName.IsEmpty())m_s_ParentTypeName.SetWindowText(m_ParentTypeName);
  55. if(!m_SavePath.IsEmpty())m_e_SavePath.SetWindowText(m_SavePath);
  56. if(!m_FileFilter.IsEmpty())m_e_FileFilter.SetWindowText(m_FileFilter);
  57. if(m_bSave)
  58. {
  59. SetWindowText("分类编辑");
  60. m_b_Add.SetWindowText("保存");
  61. m_e_TypeName.SetWindowText(m_TypeName);
  62. }
  63. return TRUE; 
  64. }
  65. void CAddFileDownTaskDlg::OnEnChangeETypename()
  66. {
  67. CString strTypeName;
  68. m_e_TypeName.GetWindowText(strTypeName);
  69. strTypeName = strTypeName.Trim();
  70. if(strTypeName == "")
  71. {
  72. m_e_SavePath.SetWindowText(m_SavePath);
  73. }
  74. else
  75. {
  76. strTypeName = m_SavePath + "\" + strTypeName;
  77. m_e_SavePath.SetWindowText(strTypeName);
  78. }
  79. }
  80. void CAddFileDownTaskDlg::OnBnClickedOk()
  81. {
  82. m_e_SavePath.GetWindowText(m_SavePath);
  83. m_e_FileFilter.GetWindowText(m_FileFilter);
  84. m_e_TypeName.GetWindowText(m_TypeName);
  85. m_TypeName = m_TypeName.Trim();
  86. if(m_TypeName == "")return;
  87. CDialog::OnOK();
  88. }