Module: wine Branch: master Commit: 565036209080ad322bd96aa6a0cdc9adaae315e9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=565036209080ad322bd96aa6a0...
Author: Erich Hoover ehoover@mines.edu Date: Wed Sep 5 10:24:28 2012 -0600
hhctrl.ocx: Resize the window when HH_SET_WIN_TYPE is called.
---
dlls/hhctrl.ocx/chm.c | 6 +++--- dlls/hhctrl.ocx/help.c | 20 ++++++++++++++++++++ dlls/hhctrl.ocx/hhctrl.c | 3 ++- dlls/hhctrl.ocx/hhctrl.h | 3 ++- 4 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/dlls/hhctrl.ocx/chm.c b/dlls/hhctrl.ocx/chm.c index 4b2f36e..bff7186 100644 --- a/dlls/hhctrl.ocx/chm.c +++ b/dlls/hhctrl.ocx/chm.c @@ -250,7 +250,7 @@ static inline WCHAR *MergeChmString(LPCWSTR src, WCHAR **dst) return *dst; }
-void MergeChmProperties(HH_WINTYPEW *src, HHInfo *info) +void MergeChmProperties(HH_WINTYPEW *src, HHInfo *info, BOOL override) { DWORD unhandled_params = src->fsValidMembers & ~(HHWIN_PARAM_PROPERTIES|HHWIN_PARAM_STYLES |HHWIN_PARAM_EXSTYLES|HHWIN_PARAM_RECT|HHWIN_PARAM_NAV_WIDTH @@ -258,7 +258,7 @@ void MergeChmProperties(HH_WINTYPEW *src, HHInfo *info) |HHWIN_PARAM_EXPANSION|HHWIN_PARAM_TABPOS|HHWIN_PARAM_TABORDER |HHWIN_PARAM_HISTORY_COUNT|HHWIN_PARAM_CUR_TAB); HH_WINTYPEW *dst = &info->WinType; - DWORD merge = src->fsValidMembers & ~dst->fsValidMembers; + DWORD merge = override ? src->fsValidMembers : src->fsValidMembers & ~dst->fsValidMembers;
if (unhandled_params) FIXME("Unsupported fsValidMembers fields: 0x%x\n", unhandled_params); @@ -379,7 +379,7 @@ BOOL LoadWinTypeFromCHM(HHInfo *info) }
/* merge the new data with any pre-existing HH_WINTYPE structure */ - MergeChmProperties(&wintype, info); + MergeChmProperties(&wintype, info, FALSE); if (!info->WinType.pszFile) info->WinType.pszFile = info->stringsW.pszFile = strdupW(info->pCHMInfo->defTopic ? info->pCHMInfo->defTopic : null); if (!info->WinType.pszToc) diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c index 514b2a8..79e5e11 100644 --- a/dlls/hhctrl.ocx/help.c +++ b/dlls/hhctrl.ocx/help.c @@ -1565,6 +1565,26 @@ static LRESULT Help_OnSize(HWND hWnd) return 0; }
+void UpdateHelpWindow(HHInfo *info) +{ + if (!info->WinType.hwndHelp) + return; + + WARN("Only the size of the window is currently updated.\n"); + if (info->WinType.fsValidMembers & HHWIN_PARAM_RECT) + { + RECT *rect = &info->WinType.rcWindowPos; + INT x, y, width, height; + + x = rect->left; + y = rect->top; + width = rect->right - x; + height = rect->bottom - y; + SetWindowPos(info->WinType.hwndHelp, NULL, rect->left, rect->top, width, height, + SWP_NOZORDER | SWP_NOACTIVATE); + } +} + static LRESULT CALLBACK Help_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) diff --git a/dlls/hhctrl.ocx/hhctrl.c b/dlls/hhctrl.ocx/hhctrl.c index 7f11276..03592c8 100644 --- a/dlls/hhctrl.ocx/hhctrl.c +++ b/dlls/hhctrl.ocx/hhctrl.c @@ -327,7 +327,8 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat
TRACE("Changing WINTYPE, fsValidMembers=0x%x\n", wintype->fsValidMembers);
- MergeChmProperties(wintype, info); + MergeChmProperties(wintype, info, TRUE); + UpdateHelpWindow(info); return 0; } case HH_GET_WIN_TYPE: { diff --git a/dlls/hhctrl.ocx/hhctrl.h b/dlls/hhctrl.ocx/hhctrl.h index 7bdf26e..81b6879 100644 --- a/dlls/hhctrl.ocx/hhctrl.h +++ b/dlls/hhctrl.ocx/hhctrl.h @@ -218,7 +218,8 @@ HHInfo *CreateHelpViewer(HHInfo*,LPCWSTR,HWND) DECLSPEC_HIDDEN; void ReleaseHelpViewer(HHInfo*) DECLSPEC_HIDDEN; BOOL NavigateToUrl(HHInfo*,LPCWSTR) DECLSPEC_HIDDEN; BOOL NavigateToChm(HHInfo*,LPCWSTR,LPCWSTR) DECLSPEC_HIDDEN; -void MergeChmProperties(HH_WINTYPEW*,HHInfo*) DECLSPEC_HIDDEN; +void MergeChmProperties(HH_WINTYPEW*,HHInfo*,BOOL) DECLSPEC_HIDDEN; +void UpdateHelpWindow(HHInfo *info) DECLSPEC_HIDDEN;
void InitSearch(HHInfo *info, const char *needle) DECLSPEC_HIDDEN; void ReleaseSearch(HHInfo *info) DECLSPEC_HIDDEN;