From 74b7a8a0ca8ab4799f8bce18ccde5fc7ee51c247 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Sat, 10 Apr 2004 12:07:11 +0000 Subject: [PATCH] fix toggeling of toolbar windows svn path=/trunk/; revision=9070 --- .../subsys/system/explorer/shell/mainframe.cpp | 15 ++++++++------- reactos/subsys/system/explorer/shell/mainframe.h | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/reactos/subsys/system/explorer/shell/mainframe.cpp b/reactos/subsys/system/explorer/shell/mainframe.cpp index c61d0c74fdf..7fdd3e75a18 100644 --- a/reactos/subsys/system/explorer/shell/mainframe.cpp +++ b/reactos/subsys/system/explorer/shell/mainframe.cpp @@ -253,7 +253,6 @@ MainFrame::MainFrame(HWND hwnd) #endif -#ifdef _DEBUG // address & command bar WindowCanvas canvas(hwnd); RECT rect = {0, 0, 0, 0}; @@ -267,7 +266,6 @@ MainFrame::MainFrame(HWND hwnd) _hcommandedit = CreateWindow(TEXT("EDIT"), TEXT("> Command"), WS_CHILD|WS_VISIBLE, 0, 0, 0, rect.bottom, hwnd, (HMENU)IDW_ADDRESSBAR, g_Globals._hInstance, 0); SetWindowFont(_hcommandedit, hfont, FALSE); -#endif /* CreateStatusWindow does not accept WS_BORDER _hstatusbar = CreateWindowEx(WS_EX_NOPARENTNOTIFY, STATUSCLASSNAME, 0, @@ -605,15 +603,15 @@ int MainFrame::Command(int id, int code) #endif case ID_VIEW_TOOL_BAR: - toggle_child(_hwnd, id, _htoolbar); + toggle_child(_hwnd, id, _htoolbar, 0); break; case ID_VIEW_EXTRA_BAR: - toggle_child(_hwnd, id, _hextrabar); + toggle_child(_hwnd, id, _hextrabar, 1); break; case ID_VIEW_DRIVE_BAR: - toggle_child(_hwnd, id, _hdrivebar); + toggle_child(_hwnd, id, _hdrivebar, 2); break; case ID_VIEW_STATUSBAR: @@ -981,13 +979,16 @@ void MainFrame::fullscreen_move() } -void MainFrame::toggle_child(HWND hwnd, UINT cmd, HWND hchild) +void MainFrame::toggle_child(HWND hwnd, UINT cmd, HWND hchild, int band_idx) { BOOL vis = IsWindowVisible(hchild); CheckMenuItem(_menu_info._hMenuView, cmd, vis?MF_BYCOMMAND:MF_BYCOMMAND|MF_CHECKED); - ShowWindow(hchild, vis?SW_HIDE:SW_SHOW); + if (band_idx != -1) + SendMessage(_hwndrebar, RB_SHOWBAND, band_idx, !vis); + else + ShowWindow(hchild, vis?SW_HIDE:SW_SHOW); if (_fullscreen._mode) fullscreen_move(); diff --git a/reactos/subsys/system/explorer/shell/mainframe.h b/reactos/subsys/system/explorer/shell/mainframe.h index 37b6f317571..3840a340244 100644 --- a/reactos/subsys/system/explorer/shell/mainframe.h +++ b/reactos/subsys/system/explorer/shell/mainframe.h @@ -76,7 +76,7 @@ protected: int Command(int id, int code); int Notify(int id, NMHDR* pnmh); - void toggle_child(HWND hwnd, UINT cmd, HWND hchild); + void toggle_child(HWND hwnd, UINT cmd, HWND hchild, int band_idx=-1); bool activate_drive_window(LPCTSTR path); bool activate_child_window(LPCTSTR filesys);