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_REFRESH, "Refresh all lists"
IDM_ABOUT, "Display program information, version number and copyright" 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_OC, "ObjectClasses"
IDS_TREE_GBCC, "Grouped by Component Category" IDS_TREE_GBCC, "Grouped by Component Category"
IDS_TREE_O1O, "OLE 1.0 Objects" IDS_TREE_O1O, "OLE 1.0 Objects"

View File

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

View File

@ -62,6 +62,31 @@ void PopulateTree(void)
ITypeLib_Release(pTypeLib); 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) LRESULT CALLBACK TypeLibProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
switch(uMsg) switch(uMsg)
@ -81,11 +106,18 @@ LRESULT CALLBACK TypeLibProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
SetRight(typelib.hPaneWnd, typelib.hEdit); SetRight(typelib.hPaneWnd, typelib.hEdit);
PopulateTree(); PopulateTree();
SetFocus(typelib.hTree);
break; break;
} }
case WM_MENUSELECT:
UpdateTypeLibStatusBar(LOWORD(wParam));
break;
case WM_SETFOCUS:
SetFocus(typelib.hTree);
break;
case WM_SIZE: case WM_SIZE:
MoveWindow(typelib.hPaneWnd, 0, 0, if(wParam == SIZE_MINIMIZED) break;
LOWORD(lParam), HIWORD(lParam), TRUE); TypeLibResizeChild();
break; break;
case WM_DESTROY: case WM_DESTROY:
break; break;
@ -119,7 +151,11 @@ BOOL CreateTypeLibWindow(HINSTANCE hInst)
globals.hTypeLibWnd = CreateWindow(wszTypeLib, wszTitle, globals.hTypeLibWnd = CreateWindow(wszTypeLib, wszTitle,
WS_OVERLAPPEDWINDOW|WS_VISIBLE, WS_OVERLAPPEDWINDOW|WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, NULL, NULL, hInst, NULL); CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, NULL, NULL, hInst, NULL);
if(!globals.hTypeLibWnd) return FALSE; if(!globals.hTypeLibWnd) return FALSE;
typelib.hStatusBar = CreateStatusWindow(WS_VISIBLE|WS_CHILD,
(LPWSTR)wszTitle, globals.hTypeLibWnd, 0);
TypeLibResizeChild();
return TRUE; return TRUE;
} }