fix toggeling of toolbar windows

svn path=/trunk/; revision=9070
This commit is contained in:
Martin Fuchs 2004-04-10 12:07:11 +00:00
parent f9cb0ec833
commit 74b7a8a0ca
2 changed files with 9 additions and 8 deletions

View file

@ -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();

View file

@ -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);