mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 20:03:12 +00:00
Implemented control panel window in cabinet view mode.
svn path=/trunk/; revision=5896
This commit is contained in:
parent
063d8646a9
commit
6381c3ac66
5 changed files with 29 additions and 11 deletions
|
@ -52,6 +52,8 @@ FileChildWndInfo::FileChildWndInfo(LPCTSTR path)
|
||||||
_pos.rcNormalPosition.top = CW_USEDEFAULT;
|
_pos.rcNormalPosition.top = CW_USEDEFAULT;
|
||||||
_pos.rcNormalPosition.right = CW_USEDEFAULT;
|
_pos.rcNormalPosition.right = CW_USEDEFAULT;
|
||||||
_pos.rcNormalPosition.bottom = 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;
|
_root._entry->_data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
|
||||||
|
|
||||||
|
|
||||||
|
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));
|
_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));
|
_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;
|
_sortOrder = SORT_NAME;
|
||||||
|
@ -127,8 +131,10 @@ FileChildWindow::FileChildWindow(HWND hwnd, const FileChildWndInfo& info)
|
||||||
|
|
||||||
set_curdir(entry, hwnd);
|
set_curdir(entry, hwnd);
|
||||||
|
|
||||||
|
if (_left_hwnd) {
|
||||||
int idx = ListBox_FindItemData(_left_hwnd, ListBox_GetCurSel(_left_hwnd), _left->_cur);
|
int idx = ListBox_FindItemData(_left_hwnd, ListBox_GetCurSel(_left_hwnd), _left->_cur);
|
||||||
ListBox_SetCurSel(_left_hwnd, idx);
|
ListBox_SetCurSel(_left_hwnd, idx);
|
||||||
|
}
|
||||||
|
|
||||||
//TODO: scroll to visibility
|
//TODO: scroll to visibility
|
||||||
|
|
||||||
|
@ -284,6 +290,7 @@ void FileChildWindow::resize_children(int cx, int cy)
|
||||||
rt.left+cx+1, wp.y, wp.cx-cx+2, wp.cy, wp.flags);
|
rt.left+cx+1, wp.y, wp.cx-cx+2, wp.cy, wp.flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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, _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);
|
hdwp = DeferWindowPos(hdwp, _right_hwnd, 0, rt.left+cx+1, rt.top, rt.right-cx, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
|
||||||
|
|
|
@ -34,6 +34,7 @@ struct FileChildWndInfo
|
||||||
LPCTSTR _path;
|
LPCTSTR _path;
|
||||||
|
|
||||||
WINDOWPLACEMENT _pos;
|
WINDOWPLACEMENT _pos;
|
||||||
|
bool _mode_explore;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ShellChildWndInfo : public FileChildWndInfo
|
struct ShellChildWndInfo : public FileChildWndInfo
|
||||||
|
|
|
@ -218,7 +218,7 @@ LRESULT MainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
||||||
if (lparam) {
|
if (lparam) {
|
||||||
// take over path from lparam
|
// take over path from lparam
|
||||||
path = (LPCTSTR)lparam;
|
path = (LPCTSTR)lparam;
|
||||||
shell_path = path; // creates as "rooted" window
|
shell_path = path; // create as "rooted" window
|
||||||
} else {
|
} else {
|
||||||
//TODO: read paths and window placements from registry
|
//TODO: read paths and window placements from registry
|
||||||
GetCurrentDirectory(MAX_PATH, buffer);
|
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.right = 600;
|
||||||
create_info._pos.rcNormalPosition.bottom = 280;
|
create_info._pos.rcNormalPosition.bottom = 280;
|
||||||
|
|
||||||
|
create_info._mode_explore = wparam? true: false;
|
||||||
|
|
||||||
// FileChildWindow::create(_hmdiclient, create_info);
|
// FileChildWindow::create(_hmdiclient, create_info);
|
||||||
ShellBrowserChild::create(_hmdiclient, create_info);
|
ShellBrowserChild::create(_hmdiclient, create_info);
|
||||||
break;}
|
break;}
|
||||||
|
|
|
@ -86,6 +86,7 @@ LRESULT ShellBrowserChild::Init(LPCREATESTRUCT pcs)
|
||||||
|
|
||||||
|
|
||||||
// create explorer treeview
|
// create explorer treeview
|
||||||
|
if (_create_info._mode_explore)
|
||||||
_left_hwnd = CreateWindowEx(0, WC_TREEVIEW, NULL,
|
_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,
|
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,
|
0, rect.top, _split_pos-SPLIT_WIDTH/2, rect.bottom-rect.top,
|
||||||
|
@ -95,7 +96,8 @@ LRESULT ShellBrowserChild::Init(LPCREATESTRUCT pcs)
|
||||||
InitializeTree();
|
InitializeTree();
|
||||||
|
|
||||||
InitDragDrop();
|
InitDragDrop();
|
||||||
}
|
} else
|
||||||
|
UpdateFolderView(_create_info._shell_path.get_folder());
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -370,13 +372,18 @@ void ShellBrowserChild::OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UpdateFolderView(folder);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShellBrowserChild::UpdateFolderView(IShellFolder* folder)
|
||||||
|
{
|
||||||
FOLDERSETTINGS fs;
|
FOLDERSETTINGS fs;
|
||||||
IShellView* pLastShellView = _pShellView;
|
IShellView* pLastShellView = _pShellView;
|
||||||
|
|
||||||
if (pLastShellView)
|
if (pLastShellView)
|
||||||
pLastShellView->GetCurrentInfo(&fs);
|
pLastShellView->GetCurrentInfo(&fs);
|
||||||
else {
|
else {
|
||||||
fs.ViewMode = FVM_DETAILS;
|
fs.ViewMode = _left_hwnd? FVM_DETAILS: FVM_ICON;
|
||||||
fs.fFlags = FWF_NOCLIENTEDGE;
|
fs.fFlags = FWF_NOCLIENTEDGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -128,6 +128,7 @@ protected:
|
||||||
void OnTreeItemRClick(int idCtrl, LPNMHDR pnmh);
|
void OnTreeItemRClick(int idCtrl, LPNMHDR pnmh);
|
||||||
void OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv);
|
void OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv);
|
||||||
|
|
||||||
|
void UpdateFolderView(IShellFolder* folder);
|
||||||
void Tree_DoItemMenu(HWND hwndTreeView, HTREEITEM hItem, LPPOINT pptScreen);
|
void Tree_DoItemMenu(HWND hwndTreeView, HTREEITEM hItem, LPPOINT pptScreen);
|
||||||
bool expand_folder(ShellDirectory* entry);
|
bool expand_folder(ShellDirectory* entry);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue