preparations for SDI code merge

svn path=/trunk/; revision=8462
This commit is contained in:
Martin Fuchs
2004-02-28 23:33:15 +00:00
parent 504a0756cf
commit 56aef8d72d
9 changed files with 76 additions and 44 deletions
@@ -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
@@ -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;
}
@@ -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);
@@ -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)
@@ -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)
{
//@@
}
@@ -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);
@@ -286,3 +286,11 @@ LRESULT WebChildWindow::WndProc(UINT message, WPARAM wparam, LPARAM lparam)
return 0;
}
void WebChildWindow::jump_to(void* path)
{
//@@
}
@@ -1075,4 +1075,6 @@ protected:
auto_ptr<EventConnector> _connector;
LRESULT WndProc(UINT message, WPARAM wparam, LPARAM lparam);
virtual void jump_to(void* path);
};
@@ -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;