oleview: Added status bar to TypeLib Viewer.

This commit is contained in:
Piotr Caban 2006-06-30 18:42:14 +02:00 committed by Alexandre Julliard
parent 03c5387f92
commit 49c779f06f
3 changed files with 44 additions and 3 deletions

View File

@ -117,6 +117,10 @@ STRINGTABLE
IDM_REFRESH, "Refresh all lists"
IDM_ABOUT, "Display program information, version number and copyright"
IDM_SAVEAS, "Save as an .IDL or .H file"
IDM_CLOSE, "Close window"
IDM_GROUP, "Group typeinfos by kind"
IDS_TREE_OC, "ObjectClasses"
IDS_TREE_GBCC, "Grouped by Component Category"
IDS_TREE_O1O, "OLE 1.0 Objects"

View File

@ -107,6 +107,7 @@ typedef struct
HWND hPaneWnd;
HWND hTree;
HWND hEdit;
HWND hStatusBar;
}TYPELIB;
extern GLOBALS globals;

View File

@ -62,6 +62,31 @@ void PopulateTree(void)
ITypeLib_Release(pTypeLib);
}
void TypeLibResizeChild(void)
{
RECT client, stat;
MoveWindow(typelib.hStatusBar, 0, 0, 0, 0, TRUE);
if(IsWindowVisible(typelib.hStatusBar))
GetClientRect(typelib.hStatusBar, &stat);
else stat.bottom = 0;
GetClientRect(globals.hTypeLibWnd, &client);
MoveWindow(typelib.hPaneWnd, 0, 0,
client.right, client.bottom-stat.bottom, TRUE);
}
void UpdateTypeLibStatusBar(int itemID)
{
WCHAR info[MAX_LOAD_STRING];
if(!LoadString(globals.hMainInst, itemID, info, sizeof(WCHAR[MAX_LOAD_STRING])))
LoadString(globals.hMainInst, IDS_READY, info, sizeof(WCHAR[MAX_LOAD_STRING]));
SendMessage(typelib.hStatusBar, SB_SETTEXT, 0, (LPARAM)info);
}
LRESULT CALLBACK TypeLibProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
@ -81,11 +106,18 @@ LRESULT CALLBACK TypeLibProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
SetRight(typelib.hPaneWnd, typelib.hEdit);
PopulateTree();
SetFocus(typelib.hTree);
break;
}
case WM_MENUSELECT:
UpdateTypeLibStatusBar(LOWORD(wParam));
break;
case WM_SETFOCUS:
SetFocus(typelib.hTree);
break;
case WM_SIZE:
MoveWindow(typelib.hPaneWnd, 0, 0,
LOWORD(lParam), HIWORD(lParam), TRUE);
if(wParam == SIZE_MINIMIZED) break;
TypeLibResizeChild();
break;
case WM_DESTROY:
break;
@ -119,7 +151,11 @@ BOOL CreateTypeLibWindow(HINSTANCE hInst)
globals.hTypeLibWnd = CreateWindow(wszTypeLib, wszTitle,
WS_OVERLAPPEDWINDOW|WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, NULL, NULL, hInst, NULL);
if(!globals.hTypeLibWnd) return FALSE;
typelib.hStatusBar = CreateStatusWindow(WS_VISIBLE|WS_CHILD,
(LPWSTR)wszTitle, globals.hTypeLibWnd, 0);
TypeLibResizeChild();
return TRUE;
}