update for HEAD-2003091401
[reactos.git] / subsys / system / explorer / Seashell / MFCExplorerDlg.cpp
1 // MFCExplorerDlg.cpp : implementation file
2 //
3
4 #include "stdafx.h"
5 #include "SeaShell.h"
6 #include "MFCExplorerDlg.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 // CMFCExplorerDlg dialog
16
17
18 CMFCExplorerDlg::CMFCExplorerDlg(LPCTSTR pszPath,CWnd* pParent /*=NULL*/)
19         : CDialog(CMFCExplorerDlg::IDD, pParent)
20 {
21         //{{AFX_DATA_INIT(CMFCExplorerDlg)
22                 // NOTE: the ClassWizard will add member initialization here
23         //}}AFX_DATA_INIT
24         if (pszPath)
25                 m_sPath = pszPath;
26 }
27
28
29 void CMFCExplorerDlg::DoDataExchange(CDataExchange* pDX)
30 {
31         CDialog::DoDataExchange(pDX);
32         //{{AFX_DATA_MAP(CMFCExplorerDlg)
33         DDX_Control(pDX, IDC_TREE_SHELL, m_tcShell);
34         DDX_Control(pDX, IDC_LIST_SHELL, m_lcShell);
35         DDX_Control(pDX, IDC_COMBO_SHELL, m_cbShell);
36         //}}AFX_DATA_MAP
37 }
38
39
40 BEGIN_MESSAGE_MAP(CMFCExplorerDlg, CDialog)
41         //{{AFX_MSG_MAP(CMFCExplorerDlg)
42         ON_BN_CLICKED(IDC_MFC_BUTT_DETAILS, OnMfcButtDetails)
43         ON_BN_CLICKED(IDC_MFC_BUTT_LARGE_ICONS, OnMfcButtLargeIcons)
44         ON_BN_CLICKED(IDC_MFC_BUTT_REPORT, OnMfcButtReport)
45         ON_BN_CLICKED(IDC_MFC_BUTT_SMALL_ICONS, OnMfcButtSmallIcons)
46         //}}AFX_MSG_MAP
47 END_MESSAGE_MAP()
48
49 /////////////////////////////////////////////////////////////////////////////
50 // CMFCExplorerDlg message handlers
51
52 void CMFCExplorerDlg::OnMfcButtDetails() 
53 {
54         // TODO: Add your control notification handler code here
55         m_lcShell.SetViewType(LVS_LIST);        
56 }
57
58 void CMFCExplorerDlg::OnMfcButtLargeIcons() 
59 {
60         // TODO: Add your control notification handler code here
61         m_lcShell.SetViewType(LVS_ICON);                
62 }
63
64 void CMFCExplorerDlg::OnMfcButtReport() 
65 {
66         // TODO: Add your control notification handler code here
67         m_lcShell.SetViewType(LVS_REPORT);      
68 }
69
70 void CMFCExplorerDlg::OnMfcButtSmallIcons() 
71 {
72         // TODO: Add your control notification handler code here
73         m_lcShell.SetViewType(LVS_SMALLICON);
74 }
75
76 BOOL CMFCExplorerDlg::OnInitDialog() 
77 {
78         CDialog::OnInitDialog();
79         
80         // TODO: Add extra initialization here
81         m_cbShell.SetTreeCtrlWnd(m_tcShell.GetSafeHwnd());
82         m_tcShell.SetListCtrlWnd(m_lcShell.GetSafeHwnd());
83         m_tcShell.SetComboBoxWnd(m_cbShell.GetSafeHwnd());
84         m_tcShell.LoadFolderItems(m_sPath);
85
86         return TRUE;  // return TRUE unless you set the focus to a control
87                       // EXCEPTION: OCX Property Pages should return FALSE
88 }