update for HEAD-2003091401
[reactos.git] / subsys / system / explorer / Seashell / ShellTreeDlg.cpp
1 // ShellTreeDlg.cpp : implementation file
2 //
3
4 #include "stdafx.h"
5 #include "SeaShell.h"
6 #include "ShellTreeDlg.h"
7 #include "UIMessages.h"
8
9 #ifdef _DEBUG
10 #define new DEBUG_NEW
11 #undef THIS_FILE
12 static char THIS_FILE[] = __FILE__;
13 #endif
14
15 /////////////////////////////////////////////////////////////////////////////
16 // CShellTreeDlg dialog
17
18
19 CShellTreeDlg::CShellTreeDlg(CWnd* pParent /*=NULL*/)
20         : CDialog(CShellTreeDlg::IDD, pParent)
21 {
22         //{{AFX_DATA_INIT(CShellTreeDlg)
23         m_stHelp = _T("");
24         m_stPath = _T("");
25         //}}AFX_DATA_INIT
26 }
27
28
29 void CShellTreeDlg::DoDataExchange(CDataExchange* pDX)
30 {
31         CDialog::DoDataExchange(pDX);
32         //{{AFX_DATA_MAP(CShellTreeDlg)
33         DDX_Control(pDX, IDC_SHELL_TREE, m_ShellTree);
34         DDX_Text(pDX, IDC_ST_HELP, m_stHelp);
35         DDX_Text(pDX, IDC_ST_PATH, m_stPath);
36         //}}AFX_DATA_MAP
37 }
38
39
40 BEGIN_MESSAGE_MAP(CShellTreeDlg, CDialog)
41         //{{AFX_MSG_MAP(CShellTreeDlg)
42         ON_MESSAGE(WM_SETMESSAGESTRING,OnSetmessagestring)
43         ON_MESSAGE(WM_APP_UPDATE_ALL_VIEWS,OnAppUpdateAllViews)
44         //}}AFX_MSG_MAP
45 END_MESSAGE_MAP()
46
47 /////////////////////////////////////////////////////////////////////////////
48 // CShellTreeDlg message handlers
49
50 BOOL CShellTreeDlg::OnInitDialog() 
51 {
52         CDialog::OnInitDialog();
53         
54         // TODO: Add extra initialization here
55         m_ShellTree.LoadFolderItems();
56         
57         return TRUE;  // return TRUE unless you set the focus to a control
58                       // EXCEPTION: OCX Property Pages should return FALSE
59 }
60
61 LRESULT CShellTreeDlg::OnAppUpdateAllViews(WPARAM wParam, LPARAM lParam)
62 {
63         if (wParam == HINT_TREE_SEL_CHANGED)
64         {
65                 const CRefreshShellFolder *pRefresh = reinterpret_cast<const CRefreshShellFolder*>(lParam);
66                 m_stPath = m_ShellTree.GetPathName(pRefresh->GetItem());                
67                 UpdateData(FALSE);
68         }
69         return 1;
70 }
71
72 LRESULT CShellTreeDlg::OnSetmessagestring(WPARAM wParam, LPARAM lParam)
73 {
74         if (lParam)
75         {
76                 m_stHelp = (LPCTSTR)lParam;             
77                 UpdateData(FALSE);
78         }
79         return 1;
80 }