MoveToGroupDlg.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // MoveToGroupDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "cp_main.h"
  5. #include "MoveToGroupDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CMoveToGroupDlg dialog
  13. CMoveToGroupDlg::CMoveToGroupDlg(CWnd* pParent /*=NULL*/)
  14. : CDialog(CMoveToGroupDlg::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(CMoveToGroupDlg)
  17. // NOTE: the ClassWizard will add member initialization here
  18. //}}AFX_DATA_INIT
  19. m_nSelectedGroup = -1;
  20. }
  21. void CMoveToGroupDlg::DoDataExchange(CDataExchange* pDX)
  22. {
  23. CDialog::DoDataExchange(pDX);
  24. //{{AFX_DATA_MAP(CMoveToGroupDlg)
  25. DDX_Control(pDX, IDC_TREE, m_Tree);
  26. //}}AFX_DATA_MAP
  27. }
  28. BEGIN_MESSAGE_MAP(CMoveToGroupDlg, CDialog)
  29. //{{AFX_MSG_MAP(CMoveToGroupDlg)
  30. ON_WM_SIZE()
  31. //}}AFX_MSG_MAP
  32. ON_MESSAGE(NM_GROUP_TREE_MESSAGE, OnTreeSelect)
  33. END_MESSAGE_MAP()
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CMoveToGroupDlg message handlers
  36. BOOL CMoveToGroupDlg::OnInitDialog()
  37. {
  38. CDialog::OnInitDialog();
  39. m_Tree.m_lSelectedFolderID = m_nSelectedGroup;
  40. m_Tree.SetNotificationWndEx(m_hWnd);
  41. m_Tree.FillTree();
  42. return TRUE; // return TRUE unless you set the focus to a control
  43. // EXCEPTION: OCX Property Pages should return FALSE
  44. }
  45. LRESULT CMoveToGroupDlg::OnTreeSelect(WPARAM wParam, LPARAM lParam)
  46. {
  47. int nID = (int)wParam;
  48. if(nID >= 0)
  49. {
  50. m_nSelectedGroup = nID;
  51. OnOK();
  52. }
  53. else
  54. {
  55. OnCancel();
  56. }
  57. return TRUE;
  58. }
  59. void CMoveToGroupDlg::OnOK()
  60. {
  61. m_nSelectedGroup = m_Tree.GetSelectedTree();
  62. CDialog::OnOK();
  63. }
  64. void CMoveToGroupDlg::OnSize(UINT nType, int cx, int cy)
  65. {
  66. CDialog::OnSize(nType, cx, cy);
  67. // TODO: Add your message handler code here
  68. }