From 56aef8d72dc3990e70dcd753bd38ccaa2e1e5cde Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Sat, 28 Feb 2004 23:33:15 +0000 Subject: [PATCH] preparations for SDI code merge svn path=/trunk/; revision=8462 --- .../system/explorer/desktop/desktop.cpp | 2 +- .../system/explorer/shell/filechild.cpp | 52 +++++++++++-------- .../subsys/system/explorer/shell/filechild.h | 1 + .../system/explorer/shell/mainframe.cpp | 2 +- .../system/explorer/shell/shellbrowser.cpp | 50 ++++++++++-------- .../system/explorer/shell/shellbrowser.h | 2 + .../subsys/system/explorer/shell/webchild.cpp | 8 +++ .../subsys/system/explorer/shell/webchild.h | 2 + .../subsys/system/explorer/utility/window.h | 1 + 9 files changed, 76 insertions(+), 44 deletions(-) diff --git a/reactos/subsys/system/explorer/desktop/desktop.cpp b/reactos/subsys/system/explorer/desktop/desktop.cpp index b2901092d73..b944718001d 100644 --- a/reactos/subsys/system/explorer/desktop/desktop.cpp +++ b/reactos/subsys/system/explorer/desktop/desktop.cpp @@ -338,7 +338,7 @@ HWND DesktopWindow::Create() int height = GetSystemMetrics(SM_CYSCREEN); HWND hwndDesktop = Window::Create(WINDOW_CREATOR(DesktopWindow), - WS_EX_TOOLWINDOW, wcDesktop, TEXT("Program Manager"), WS_POPUP|WS_VISIBLE|WS_CLIPCHILDREN, + WS_EX_TOOLWINDOW, wcDesktop, TEXT("Program Manager"), WS_POPUP|WS_VISIBLE, //|WS_CLIPCHILDREN for SDI frames 0, 0, width, height, 0); // work around to display desktop bar in Wine diff --git a/reactos/subsys/system/explorer/shell/filechild.cpp b/reactos/subsys/system/explorer/shell/filechild.cpp index b3e596f8123..e1ddb0db808 100644 --- a/reactos/subsys/system/explorer/shell/filechild.cpp +++ b/reactos/subsys/system/explorer/shell/filechild.cpp @@ -95,6 +95,35 @@ WebChildWndInfo::WebChildWndInfo(HWND hmdiclient, LPCTSTR url) } +BOOL CALLBACK ExecuteDialog::WndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) +{ + static struct ExecuteDialog* dlg; + + switch(nmsg) { + case WM_INITDIALOG: + dlg = (struct ExecuteDialog*) lparam; + return 1; + + case WM_COMMAND: { + int id = (int)wparam; + + if (id == IDOK) { + GetWindowText(GetDlgItem(hwnd, 201), dlg->cmd, MAX_PATH); + dlg->cmdshow = Button_GetState(GetDlgItem(hwnd,214))&BST_CHECKED? + SW_SHOWMINIMIZED: SW_SHOWNORMAL; + EndDialog(hwnd, id); + } else if (id == IDCANCEL) + EndDialog(hwnd, id); + + return 1;} + } + + return 0; +} + + + // FileChildWindow + FileChildWindow::FileChildWindow(HWND hwnd, const FileChildWndInfo& info) : ChildWindow(hwnd, info) { @@ -615,28 +644,9 @@ int FileChildWindow::Notify(int id, NMHDR* pnmh) } -BOOL CALLBACK ExecuteDialog::WndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) +void FileChildWindow::jump_to(void* path) { - static struct ExecuteDialog* dlg; - switch(nmsg) { - case WM_INITDIALOG: - dlg = (struct ExecuteDialog*) lparam; - return 1; +//@@ - case WM_COMMAND: { - int id = (int)wparam; - - if (id == IDOK) { - GetWindowText(GetDlgItem(hwnd, 201), dlg->cmd, MAX_PATH); - dlg->cmdshow = Button_GetState(GetDlgItem(hwnd,214))&BST_CHECKED? - SW_SHOWMINIMIZED: SW_SHOWNORMAL; - EndDialog(hwnd, id); - } else if (id == IDCANCEL) - EndDialog(hwnd, id); - - return 1;} - } - - return 0; } diff --git a/reactos/subsys/system/explorer/shell/filechild.h b/reactos/subsys/system/explorer/shell/filechild.h index d510606986c..f4d17f64274 100644 --- a/reactos/subsys/system/explorer/shell/filechild.h +++ b/reactos/subsys/system/explorer/shell/filechild.h @@ -100,6 +100,7 @@ protected: int Notify(int id, NMHDR* pnmh); virtual void resize_children(int cx, int cy); + virtual void jump_to(void* path); void scan_entry(Entry* entry, HWND hwnd); diff --git a/reactos/subsys/system/explorer/shell/mainframe.cpp b/reactos/subsys/system/explorer/shell/mainframe.cpp index 3b7ae322ad1..a532b62c3ff 100644 --- a/reactos/subsys/system/explorer/shell/mainframe.cpp +++ b/reactos/subsys/system/explorer/shell/mainframe.cpp @@ -487,7 +487,7 @@ LRESULT MainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) // FileChildWindow::create(_hmdiclient, create_info); return (LRESULT)ShellBrowserChild::create(create_info); } - break;} + return TRUE;} // success case PM_GET_CONTROLWINDOW: if (wparam == FCW_STATUS) diff --git a/reactos/subsys/system/explorer/shell/shellbrowser.cpp b/reactos/subsys/system/explorer/shell/shellbrowser.cpp index 3e4e23fbdaa..9052c506c54 100644 --- a/reactos/subsys/system/explorer/shell/shellbrowser.cpp +++ b/reactos/subsys/system/explorer/shell/shellbrowser.cpp @@ -87,6 +87,26 @@ LRESULT ShellBrowserChild::Init(LPCREATESTRUCT pcs) // _himlLarge = (HIMAGELIST)SHGetFileInfo(TEXT("C:\\"), 0, &sfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX|SHGFI_LARGEICON); + const String& root_name = GetDesktopFolder().get_name(_create_info._root_shell_path, SHGDN_FORPARSING); + + _root._drive_type = DRIVE_UNKNOWN; + lstrcpy(_root._volname, root_name); // most of the time "Desktop" + _root._fs_flags = 0; + lstrcpy(_root._fs, TEXT("Desktop")); + +//@@ _root._entry->read_tree(shell_info._root_shell_path.get_folder(), info._shell_path, SORT_NAME/*_sortOrder*/); + +/*@todo + we should call read_tree() here to iterate through the hierarchy and open all folders from shell_info._root_shell_path to shell_info._shell_path + -> see FileChildWindow::FileChildWindow() +*/ + _root._entry = new ShellDirectory(GetDesktopFolder(), _create_info._root_shell_path, _hwnd); + _root._entry->read_directory(); + + /* already filled by ShellDirectory constructor + lstrcpy(_root._entry->_data.cFileName, TEXT("Desktop")); */ + + // create explorer treeview if (_create_info._open_mode & OWM_EXPLORE) _left_hwnd = CreateWindowEx(0, WC_TREEVIEW, NULL, @@ -112,26 +132,6 @@ void ShellBrowserChild::InitializeTree() TreeView_SetImageList(_left_hwnd, _himlSmall, TVSIL_NORMAL); TreeView_SetScrollTime(_left_hwnd, 100); - const String& root_name = GetDesktopFolder().get_name(_create_info._root_shell_path, SHGDN_FORPARSING); - - _root._drive_type = DRIVE_UNKNOWN; - lstrcpy(_root._volname, root_name); // most of the time "Desktop" - _root._fs_flags = 0; - lstrcpy(_root._fs, TEXT("Desktop")); - -//@@ _root._entry->read_tree(shell_info._root_shell_path.get_folder(), info._shell_path, SORT_NAME/*_sortOrder*/); - -/*@todo - we should call read_tree() here to iterate through the hierarchy and open all folders from shell_info._root_shell_path to shell_info._shell_path - -> see FileChildWindow::FileChildWindow() -*/ - _root._entry = new ShellDirectory(GetDesktopFolder(), _create_info._root_shell_path, _hwnd); - _root._entry->read_directory(); - - /* already filled by ShellDirectory constructor - lstrcpy(_root._entry->_data.cFileName, TEXT("Desktop")); */ - - TV_ITEM tvItem; tvItem.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN; @@ -460,7 +460,7 @@ HRESULT ShellBrowserChild::OnDefaultCommand(LPIDA pida) { CONTEXT("ShellBrowserChild::OnDefaultCommand()"); - if (pida->cidl>=1) { + if (pida->cidl >= 1) { if (_left_hwnd) { // explorer mode if (_last_sel) { ShellDirectory* parent = (ShellDirectory*)TreeView_GetItemData(_left_hwnd, _last_sel); @@ -521,3 +521,11 @@ bool ShellBrowserChild::expand_folder(ShellDirectory* entry) return false; } + + +void ShellBrowserChild::jump_to(void* path) +{ + +//@@ + +} diff --git a/reactos/subsys/system/explorer/shell/shellbrowser.h b/reactos/subsys/system/explorer/shell/shellbrowser.h index 4b8fec06966..0df72a068c7 100644 --- a/reactos/subsys/system/explorer/shell/shellbrowser.h +++ b/reactos/subsys/system/explorer/shell/shellbrowser.h @@ -125,6 +125,8 @@ protected: int InsertSubitems(HTREEITEM hParentItem, Entry* entry, IShellFolder* pParentFolder); bool InitDragDrop(); + virtual void jump_to(void* path); + HRESULT OnDefaultCommand(LPIDA pida); void OnTreeGetDispInfo(int idCtrl, LPNMHDR pnmh); diff --git a/reactos/subsys/system/explorer/shell/webchild.cpp b/reactos/subsys/system/explorer/shell/webchild.cpp index 959d03329c6..e53acbe0a4a 100644 --- a/reactos/subsys/system/explorer/shell/webchild.cpp +++ b/reactos/subsys/system/explorer/shell/webchild.cpp @@ -286,3 +286,11 @@ LRESULT WebChildWindow::WndProc(UINT message, WPARAM wparam, LPARAM lparam) return 0; } + + +void WebChildWindow::jump_to(void* path) +{ + +//@@ + +} diff --git a/reactos/subsys/system/explorer/shell/webchild.h b/reactos/subsys/system/explorer/shell/webchild.h index 207b5b640c3..25e7dbbb5e4 100644 --- a/reactos/subsys/system/explorer/shell/webchild.h +++ b/reactos/subsys/system/explorer/shell/webchild.h @@ -1075,4 +1075,6 @@ protected: auto_ptr _connector; LRESULT WndProc(UINT message, WPARAM wparam, LPARAM lparam); + + virtual void jump_to(void* path); }; diff --git a/reactos/subsys/system/explorer/utility/window.h b/reactos/subsys/system/explorer/utility/window.h index cad07b198b7..62edba0ab57 100644 --- a/reactos/subsys/system/explorer/utility/window.h +++ b/reactos/subsys/system/explorer/utility/window.h @@ -293,6 +293,7 @@ protected: LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); virtual void resize_children(int cx, int cy); + virtual void jump_to(void* path) = 0; protected: MenuInfo*_menu_info;