Author: gedmurphy
Date: Sun Oct 5 16:21:04 2008
New Revision: 36658
URL:
http://svn.reactos.org/svn/reactos?rev=36658&view=rev
Log:
Remove the address and command windows from the bottom of the file browser. They're
buggy and they're not too pretty
Modified:
trunk/reactos/base/shell/explorer/shell/mainframe.cpp
trunk/reactos/base/shell/explorer/shell/mainframe.h
Modified: trunk/reactos/base/shell/explorer/shell/mainframe.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/shell/…
==============================================================================
--- trunk/reactos/base/shell/explorer/shell/mainframe.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/shell/mainframe.cpp [iso-8859-1] Sun Oct 5 16:21:04
2008
@@ -190,22 +190,6 @@
WindowCanvas canvas(hwnd);
RECT rect = {0, 0, 0, 0};
DrawText(canvas, TEXT("My"), -1, &rect,
DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT);
- HFONT hfont = GetStockFont(DEFAULT_GUI_FONT);
-
- _haddressedit = CreateWindow(TEXT("EDIT"), NULL, WS_CHILD|WS_VISIBLE, 0, 0, 0,
rect.bottom,
- hwnd, (HMENU)IDW_ADDRESSBAR, g_Globals._hInstance, 0);
- SetWindowFont(_haddressedit, hfont, FALSE);
- new EditController(_haddressedit);
-
- _hcommandedit = CreateWindow(TEXT("EDIT"), TEXT("> "),
WS_CHILD|WS_VISIBLE, 0, 0, 0, rect.bottom,
- hwnd, (HMENU)IDW_COMMANDBAR, g_Globals._hInstance, 0);
- SetWindowFont(_hcommandedit, hfont, FALSE);
- new EditController(_hcommandedit);
-
- /* CreateStatusWindow does not accept WS_BORDER
- _hstatusbar = CreateWindowEx(WS_EX_NOPARENTNOTIFY, STATUSCLASSNAME, 0,
- WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_BORDER|CCS_NODIVIDER, 0,0,0,0,
- hwnd, (HMENU)IDW_STATUSBAR, g_Globals._hInstance, 0);*/
_hstatusbar = CreateStatusWindow(WS_CHILD|WS_VISIBLE, 0, hwnd, IDW_STATUSBAR);
CheckMenuItem(_menu_info._hMenuView, ID_VIEW_STATUSBAR, MF_BYCOMMAND|MF_CHECKED);
@@ -336,10 +320,6 @@
SendMessage(_hstatusbar, SB_SETTEXT, 0, lparam);
break;
- case PM_URL_CHANGED:
- SetWindowText(_haddressedit, (LPCTSTR)lparam);
- break;
-
default:
return false;
}
@@ -419,59 +399,12 @@
launch_file(_hwnd, TEXT("http://www.sky.franken.de/explorer/"), SW_SHOW);
break;
- case IDW_ADDRESSBAR:
- if (code == 1) {
- TCHAR url[BUFFER_LEN];
-
- if (GetWindowText(_haddressedit, url, BUFFER_LEN))
- go_to(url, false);
- }
- break;
-
- case IDW_COMMANDBAR:
- if (code == 1)
- ExecuteCommandbar(NULL);
- break;
-
default:
return 1; // no command handlers in Window::Command()
}
return 0;
}
-
-
-void MainFrameBase::ExecuteCommandbar(LPCTSTR dir)
-{
- TCHAR cmd[BUFFER_LEN];
-
- if (GetWindowText(_hcommandedit, cmd, BUFFER_LEN)) {
- CONTEXT("ExecuteCommandbar - ShellExecute()");
-
- // remove command prompt from 'cmd' string
- LPCTSTR p = cmd;
-
- if (*p == '>')
- ++p;
-
- while(*p == ' ')
- ++p;
-
- if (dir) {
- // remove "file://" from directory URL
- if (!_tcsnicmp(dir, TEXT("file://"), 7))
- dir += 7;
- }
-
- ///@todo use SHGetFileInfo() with SHGFI_EXETYPE flag to determine EXE type and open
console window
-
- HINSTANCE hinst = ShellExecute(_hwnd, NULL, p, NULL, dir, SW_SHOWNORMAL);
-
- if ((int)hinst <= 32)
- display_error(_hwnd, GetLastError());
- }
-}
-
int MainFrameBase::Notify(int id, NMHDR* pnmh)
{
@@ -555,15 +488,6 @@
SendMessage(_hstatusbar, SB_SETPARTS, 2, (LPARAM)&parts);
ClientRect rt(_hstatusbar);
rect.bottom -= rt.bottom;
- }
-
- if (IsWindowVisible(_haddressedit) || IsWindowVisible(_hcommandedit)) {
- ClientRect rt(_haddressedit);
- rect.bottom -= rt.bottom;
-
- int mid = (rect.right-rect.left) / 2; ///@todo use split bar
- SetWindowPos(_haddressedit, 0, 0, rect.bottom, mid, rt.bottom,
SWP_NOACTIVATE|SWP_NOZORDER);
- SetWindowPos(_hcommandedit, 0, mid+1, rect.bottom, rect.right-(mid+1), rt.bottom,
SWP_NOACTIVATE|SWP_NOZORDER);
}
if (IsWindowVisible(_hsidebar)) {
@@ -1172,20 +1096,6 @@
MainFrameBase::Create(ExplorerCmd());
break;
- case IDW_COMMANDBAR:
- if (code == 1) {
- TCHAR url[BUFFER_LEN];
- LPCTSTR dir;
-
- if (GetWindowText(_haddressedit, url, BUFFER_LEN))
- dir = url;
- else
- dir = NULL;
-
- ExecuteCommandbar(dir);
- }
- break;
-
///@todo There are even more menu items!
default:
@@ -1258,15 +1168,6 @@
SendMessage(_hstatusbar, SB_SETPARTS, 2, (LPARAM)&parts);
ClientRect rt(_hstatusbar);
rect.bottom -= rt.bottom;
- }
-
- if (IsWindowVisible(_haddressedit) || IsWindowVisible(_hcommandedit)) {
- ClientRect rt(_haddressedit);
- rect.bottom -= rt.bottom;
-
- int mid = (rect.right-rect.left) / 2; ///@todo use split bar
- SetWindowPos(_haddressedit, 0, 0, rect.bottom, mid, rt.bottom,
SWP_NOACTIVATE|SWP_NOZORDER);
- SetWindowPos(_hcommandedit, 0, mid+1, rect.bottom, rect.right-(mid+1), rt.bottom,
SWP_NOACTIVATE|SWP_NOZORDER);
}
if (IsWindowVisible(_hsidebar)) {
@@ -1559,11 +1460,6 @@
MainFrameBase::Create(ExplorerCmd(_url, true));
break;
- case IDW_COMMANDBAR:
- if (code == 1)
- ExecuteCommandbar(_url);
- break;
-
default:
return super::Command(id, code);
}
@@ -1600,15 +1496,6 @@
rect.bottom -= rt.bottom;
}
- if (IsWindowVisible(_haddressedit) || IsWindowVisible(_hcommandedit)) {
- ClientRect rt(_haddressedit);
- rect.bottom -= rt.bottom;
-
- int mid = (rect.right-rect.left) / 2; ///@todo use split bar
- SetWindowPos(_haddressedit, 0, 0, rect.bottom, mid, rt.bottom,
SWP_NOACTIVATE|SWP_NOZORDER);
- SetWindowPos(_hcommandedit, 0, mid+1, rect.bottom, rect.right-(mid+1), rt.bottom,
SWP_NOACTIVATE|SWP_NOZORDER);
- }
-
if (IsWindowVisible(_hsidebar)) {
WindowRect rt(_hsidebar);
rect.left += rt.right-rt.left;
@@ -1698,28 +1585,6 @@
// set size of new created shell view windows
resize_children();
-
- TCHAR path[MAX_PATH];
-
- if (entry->get_path(path, COUNTOF(path))) {
- String url;
-
- if (path[0] == ':')
- url.printf(TEXT("shell://%s"), path);
- else
- url.printf(TEXT("file://%s"), path);
-
- set_url(url);
- }
-}
-
-void SDIMainFrame::set_url(LPCTSTR url)
-{
- if (_url != url) {
- _url = url;
-
- SetWindowText(_haddressedit, url); //SendMessage(_hwndFrame, PM_URL_CHANGED, 0,
(LPARAM)url);
- }
}
void SDIMainFrame::jump_to(LPCTSTR path, int mode)
Modified: trunk/reactos/base/shell/explorer/shell/mainframe.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/shell/…
==============================================================================
--- trunk/reactos/base/shell/explorer/shell/mainframe.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/shell/mainframe.h [iso-8859-1] Sun Oct 5 16:21:04
2008
@@ -53,9 +53,6 @@
WindowHandle _htoolbar;
WindowHandle _hstatusbar;
- WindowHandle _haddressedit;
- WindowHandle _hcommandedit;
-
WindowHandle _hsidebar;
HIMAGELIST _himl;
@@ -88,8 +85,6 @@
void FillBookmarks();
virtual bool go_to(LPCTSTR url, bool new_window);
-
- void ExecuteCommandbar(LPCTSTR dir);
};
@@ -181,6 +176,4 @@
// interface BrowserCallback
virtual void entry_selected(Entry* entry);
-
- void set_url(LPCTSTR url);
};