Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.6 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1998 **/
  4. /**********************************************************************/
  5. /*
  6. dlgfilt.cpp
  7. Implmentation of CDlgFilter, dialog wrapper for IDD_PACKETFILTERING
  8. FILE HISTORY:
  9. */
  10. #include "stdafx.h"
  11. #include "resource.h"
  12. #include "DlgFilt.h"
  13. #ifdef _DEBUG
  14. #define new DEBUG_NEW
  15. #undef THIS_FILE
  16. static char THIS_FILE[] = __FILE__;
  17. #endif
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CDlgFilter dialog
  20. CDlgFilter::CDlgFilter(CStrArray& Filters, CWnd* pParent /*=NULL*/)
  21. : CDialog(CDlgFilter::IDD, pParent), m_Filters(Filters)
  22. {
  23. //{{AFX_DATA_INIT(CDlgFilter)
  24. //}}AFX_DATA_INIT
  25. m_pBox = NULL;
  26. }
  27. CDlgFilter::~CDlgFilter()
  28. {
  29. delete m_pBox;
  30. }
  31. BEGIN_MESSAGE_MAP(CDlgFilter, CDialog)
  32. //{{AFX_MSG_MAP(CDlgFilter)
  33. ON_BN_CLICKED(IDC_BUTTONDELETE, OnButtondelete)
  34. //}}AFX_MSG_MAP
  35. END_MESSAGE_MAP()
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CDlgFilter message handlers
  38. BOOL CDlgFilter::OnInitDialog()
  39. {
  40. CDialog::OnInitDialog();
  41. try{
  42. m_pBox = new CStrBox<CListBox>(this, IDC_LISTFILTERS, m_Filters);
  43. }catch(CMemoryException&)
  44. {
  45. delete m_pBox;
  46. m_pBox = NULL;
  47. throw;
  48. }
  49. m_pBox->Fill();
  50. return TRUE; // return TRUE unless you set the focus to a control
  51. // EXCEPTION: OCX Property Pages should return FALSE
  52. }
  53. void CDlgFilter::OnButtondelete()
  54. {
  55. if(m_pBox)
  56. m_pBox->DeleteSelected();
  57. }