From 6381c3ac661246fb565eb9dc4836980afec48911 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Thu, 28 Aug 2003 14:20:05 +0000 Subject: [PATCH] Implemented control panel window in cabinet view mode. svn path=/trunk/; revision=5896 --- .../system/explorer/shell/filechild.cpp | 15 +++++++++++---- .../subsys/system/explorer/shell/filechild.h | 1 + .../system/explorer/shell/mainframe.cpp | 4 +++- .../system/explorer/shell/shellbrowser.cpp | 19 +++++++++++++------ .../system/explorer/shell/shellbrowser.h | 1 + 5 files changed, 29 insertions(+), 11 deletions(-) diff --git a/reactos/subsys/system/explorer/shell/filechild.cpp b/reactos/subsys/system/explorer/shell/filechild.cpp index 8606ca39597..6813c0e86d8 100644 --- a/reactos/subsys/system/explorer/shell/filechild.cpp +++ b/reactos/subsys/system/explorer/shell/filechild.cpp @@ -52,6 +52,8 @@ FileChildWndInfo::FileChildWndInfo(LPCTSTR path) _pos.rcNormalPosition.top = CW_USEDEFAULT; _pos.rcNormalPosition.right = CW_USEDEFAULT; _pos.rcNormalPosition.bottom = CW_USEDEFAULT; + + _mode_explore = true; } @@ -119,7 +121,9 @@ FileChildWindow::FileChildWindow(HWND hwnd, const FileChildWndInfo& info) _root._entry->_data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY; - _left_hwnd = *(_left=new Pane(_hwnd, IDW_TREE_LEFT, IDW_HEADER_LEFT, _root._entry, true, 0)); + if (info._mode_explore) //TODO: Is not-explore-mode for FileChildWindow completely implemented? + _left_hwnd = *(_left=new Pane(_hwnd, IDW_TREE_LEFT, IDW_HEADER_LEFT, _root._entry, true, 0)); + _right_hwnd = *(_right=new Pane(_hwnd, IDW_TREE_RIGHT, IDW_HEADER_RIGHT, NULL, false, COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_INDEX|COL_LINKS)); _sortOrder = SORT_NAME; @@ -127,8 +131,10 @@ FileChildWindow::FileChildWindow(HWND hwnd, const FileChildWndInfo& info) set_curdir(entry, hwnd); - int idx = ListBox_FindItemData(_left_hwnd, ListBox_GetCurSel(_left_hwnd), _left->_cur); - ListBox_SetCurSel(_left_hwnd, idx); + if (_left_hwnd) { + int idx = ListBox_FindItemData(_left_hwnd, ListBox_GetCurSel(_left_hwnd), _left->_cur); + ListBox_SetCurSel(_left_hwnd, idx); + } //TODO: scroll to visibility @@ -284,7 +290,8 @@ void FileChildWindow::resize_children(int cx, int cy) rt.left+cx+1, wp.y, wp.cx-cx+2, wp.cy, wp.flags); } - hdwp = DeferWindowPos(hdwp, _left_hwnd, 0, rt.left, rt.top, _split_pos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE); + if (_left_hwnd) + hdwp = DeferWindowPos(hdwp, _left_hwnd, 0, rt.left, rt.top, _split_pos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE); hdwp = DeferWindowPos(hdwp, _right_hwnd, 0, rt.left+cx+1, rt.top, rt.right-cx, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE); diff --git a/reactos/subsys/system/explorer/shell/filechild.h b/reactos/subsys/system/explorer/shell/filechild.h index da2cd66c84e..e952e3d9022 100644 --- a/reactos/subsys/system/explorer/shell/filechild.h +++ b/reactos/subsys/system/explorer/shell/filechild.h @@ -34,6 +34,7 @@ struct FileChildWndInfo LPCTSTR _path; WINDOWPLACEMENT _pos; + bool _mode_explore; }; struct ShellChildWndInfo : public FileChildWndInfo diff --git a/reactos/subsys/system/explorer/shell/mainframe.cpp b/reactos/subsys/system/explorer/shell/mainframe.cpp index da9a1f42768..aee6903104d 100644 --- a/reactos/subsys/system/explorer/shell/mainframe.cpp +++ b/reactos/subsys/system/explorer/shell/mainframe.cpp @@ -218,7 +218,7 @@ LRESULT MainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) if (lparam) { // take over path from lparam path = (LPCTSTR)lparam; - shell_path = path; // creates as "rooted" window + shell_path = path; // create as "rooted" window } else { //TODO: read paths and window placements from registry GetCurrentDirectory(MAX_PATH, buffer); @@ -234,6 +234,8 @@ LRESULT MainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) create_info._pos.rcNormalPosition.right = 600; create_info._pos.rcNormalPosition.bottom = 280; + create_info._mode_explore = wparam? true: false; + // FileChildWindow::create(_hmdiclient, create_info); ShellBrowserChild::create(_hmdiclient, create_info); break;} diff --git a/reactos/subsys/system/explorer/shell/shellbrowser.cpp b/reactos/subsys/system/explorer/shell/shellbrowser.cpp index 0519989d48f..b64965c191b 100644 --- a/reactos/subsys/system/explorer/shell/shellbrowser.cpp +++ b/reactos/subsys/system/explorer/shell/shellbrowser.cpp @@ -86,16 +86,18 @@ LRESULT ShellBrowserChild::Init(LPCREATESTRUCT pcs) // create explorer treeview - _left_hwnd = CreateWindowEx(0, WC_TREEVIEW, NULL, - WS_CHILD|WS_TABSTOP|WS_VISIBLE|WS_CHILD|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_NOTOOLTIPS|TVS_SHOWSELALWAYS, - 0, rect.top, _split_pos-SPLIT_WIDTH/2, rect.bottom-rect.top, - _hwnd, (HMENU)IDC_FILETREE, g_Globals._hInstance, 0); + if (_create_info._mode_explore) + _left_hwnd = CreateWindowEx(0, WC_TREEVIEW, NULL, + WS_CHILD|WS_TABSTOP|WS_VISIBLE|WS_CHILD|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_NOTOOLTIPS|TVS_SHOWSELALWAYS, + 0, rect.top, _split_pos-SPLIT_WIDTH/2, rect.bottom-rect.top, + _hwnd, (HMENU)IDC_FILETREE, g_Globals._hInstance, 0); if (_left_hwnd) { InitializeTree(); InitDragDrop(); - } + } else + UpdateFolderView(_create_info._shell_path.get_folder()); return 0; } @@ -370,13 +372,18 @@ void ShellBrowserChild::OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv) return; } + UpdateFolderView(folder); +} + +void ShellBrowserChild::UpdateFolderView(IShellFolder* folder) +{ FOLDERSETTINGS fs; IShellView* pLastShellView = _pShellView; if (pLastShellView) pLastShellView->GetCurrentInfo(&fs); else { - fs.ViewMode = FVM_DETAILS; + fs.ViewMode = _left_hwnd? FVM_DETAILS: FVM_ICON; fs.fFlags = FWF_NOCLIENTEDGE; } diff --git a/reactos/subsys/system/explorer/shell/shellbrowser.h b/reactos/subsys/system/explorer/shell/shellbrowser.h index 3dfab0b8fc6..8d33cf9ecab 100644 --- a/reactos/subsys/system/explorer/shell/shellbrowser.h +++ b/reactos/subsys/system/explorer/shell/shellbrowser.h @@ -128,6 +128,7 @@ protected: void OnTreeItemRClick(int idCtrl, LPNMHDR pnmh); void OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv); + void UpdateFolderView(IShellFolder* folder); void Tree_DoItemMenu(HWND hwndTreeView, HTREEITEM hItem, LPPOINT pptScreen); bool expand_folder(ShellDirectory* entry); };