Implemented control panel window in cabinet view mode.

svn path=/trunk/; revision=5896
This commit is contained in:
Martin Fuchs 2003-08-28 14:20:05 +00:00
parent 063d8646a9
commit 6381c3ac66
5 changed files with 29 additions and 11 deletions

View file

@ -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);

View file

@ -34,6 +34,7 @@ struct FileChildWndInfo
LPCTSTR _path;
WINDOWPLACEMENT _pos;
bool _mode_explore;
};
struct ShellChildWndInfo : public FileChildWndInfo

View file

@ -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;}

View file

@ -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;
}

View file

@ -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);
};