mirror of
https://github.com/reactos/reactos.git
synced 2026-07-07 13:09:40 +08:00
Remove the address and command windows from the bottom of the file browser. They're buggy and they're not too pretty
svn path=/trunk/; revision=36658
This commit is contained in:
@@ -190,22 +190,6 @@ MainFrameBase::MainFrameBase(HWND hwnd)
|
||||
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 @@ bool MainFrameBase::ProcessMessage(UINT nmsg, WPARAM wparam, LPARAM lparam, LRES
|
||||
SendMessage(_hstatusbar, SB_SETTEXT, 0, lparam);
|
||||
break;
|
||||
|
||||
case PM_URL_CHANGED:
|
||||
SetWindowText(_haddressedit, (LPCTSTR)lparam);
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -419,20 +399,6 @@ int MainFrameBase::Command(int id, int code)
|
||||
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()
|
||||
}
|
||||
@@ -440,39 +406,6 @@ int MainFrameBase::Command(int id, int code)
|
||||
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)
|
||||
{
|
||||
switch(pnmh->code) {
|
||||
@@ -557,15 +490,6 @@ void MainFrameBase::resize_frame(int cx, int cy)
|
||||
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;
|
||||
@@ -1172,20 +1096,6 @@ int MDIMainFrame::Command(int id, int code)
|
||||
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:
|
||||
@@ -1260,15 +1170,6 @@ void MDIMainFrame::resize_frame(int cx, int cy)
|
||||
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;
|
||||
@@ -1559,11 +1460,6 @@ int SDIMainFrame::Command(int id, int code)
|
||||
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 @@ void SDIMainFrame::resize_frame(int cx, int cy)
|
||||
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 @@ void SDIMainFrame::entry_selected(Entry* entry)
|
||||
|
||||
// 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)
|
||||
|
||||
@@ -53,9 +53,6 @@ struct MainFrameBase : public PreTranslateWindow
|
||||
WindowHandle _htoolbar;
|
||||
WindowHandle _hstatusbar;
|
||||
|
||||
WindowHandle _haddressedit;
|
||||
WindowHandle _hcommandedit;
|
||||
|
||||
WindowHandle _hsidebar;
|
||||
HIMAGELIST _himl;
|
||||
|
||||
@@ -88,8 +85,6 @@ protected:
|
||||
|
||||
void FillBookmarks();
|
||||
virtual bool go_to(LPCTSTR url, bool new_window);
|
||||
|
||||
void ExecuteCommandbar(LPCTSTR dir);
|
||||
};
|
||||
|
||||
|
||||
@@ -181,6 +176,4 @@ protected:
|
||||
|
||||
// interface BrowserCallback
|
||||
virtual void entry_selected(Entry* entry);
|
||||
|
||||
void set_url(LPCTSTR url);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user