oleview: Added base TypeLib Viewer menu functionality.

This commit is contained in:
Piotr Caban 2006-06-30 18:43:40 +02:00 committed by Alexandre Julliard
parent 49c779f06f
commit b3e9a3ba9f
2 changed files with 22 additions and 1 deletions

View File

@ -83,7 +83,7 @@ IDM_TYPELIB MENU
MENUITEM "&Group by type kind", IDM_GROUP
MENUITEM SEPARATOR
MENUITEM "&Toolbar", IDM_TOOLBAR
MENUITEM "&Status Bar", IDM_STATUSBAR
MENUITEM "&Status Bar", IDM_STATUSBAR,CHECKED
}
}

View File

@ -77,6 +77,25 @@ void TypeLibResizeChild(void)
client.right, client.bottom-stat.bottom, TRUE);
}
void TypeLibMenuCommand(WPARAM wParam, HWND hWnd)
{
BOOL vis;
switch(wParam)
{
case IDM_STATUSBAR:
vis = IsWindowVisible(typelib.hStatusBar);
ShowWindow(typelib.hStatusBar, vis ? SW_HIDE : SW_SHOW);
CheckMenuItem(GetMenu(hWnd), LOWORD(wParam),
vis ? MF_UNCHECKED : MF_CHECKED);
TypeLibResizeChild();
break;
case IDM_CLOSE:
DestroyWindow(hWnd);
break;
}
}
void UpdateTypeLibStatusBar(int itemID)
{
WCHAR info[MAX_LOAD_STRING];
@ -109,6 +128,8 @@ LRESULT CALLBACK TypeLibProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
SetFocus(typelib.hTree);
break;
}
case WM_COMMAND:
TypeLibMenuCommand(LOWORD(wParam), hWnd);
case WM_MENUSELECT:
UpdateTypeLibStatusBar(LOWORD(wParam));
break;