Sweden-Number/programs/winhelp/winhelp.c

1074 lines
29 KiB
C
Raw Normal View History

Release 960506 Mon May 6 12:56:26 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [DEVELOPERS-HINTS] Added paragraph on naming conventions for Win16/Win32/Winelib. * [controls/menu.c] Create a default system menu that is the same for all windows instead of making a copy every time. * [include/wintypes.h] Added WINELIB_NAME and DECL_WINELIB_TYPE macros. Added xx16 and xx32 definitions for most types. General clean-up. * [memory/global.c] [memory/local.c] [*/*] Renamed Global and Local heap functions to xxx16. Added all xxx32 versions of the same functions. * [memory/selector.c] Mask out lower bits of selector in FreeSelector(). * [misc/lstr.c] Fixed wvsprintf(). * [windows/class.c] Changed the class structure to make Win32 support easier. * [windows/defwnd.c] Added handling of WM_INITMENUPOPUP for system menu to gray out invalid options. * [windows/winpos.c] Bug fix: the WINDOSPOS structure pointer in WM_NCCALCSIZE must be a SEGPTR. Sun May 5 03:51:26 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Implementation of moveable and (rudimentary) support for discardable local memory, plus several bug fixes. Sat May 4 18:33:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [include/windows.h] [windows/win.c] [if1632/user.spec] FindWindowEx() implemented (someone reported it was missing for FrameMaker 4.1). * [if1632/kernel32.spec] [if1632/user32.spec] [win32/memory.c] [win32/resource.c] Misc small stubs/small functions which bring win95 binaries further down the road. (IsBadCodePtr, LocalReAlloc,GetCursorPos) Small fix in WIN32_LoadAcceleratorsA. Fri May 3 19:43:12 1996 Frans van Dorsselaer <dorssel@rulhm1.LeidenUniv.nl> * [controls/edit.c] [controls/EDIT.TODO] Changed / fixed some types and typecasts. Fixed the scrollbar reset after WM_SETHANDLE / WM_SETTEXT. Added heap initialization in WM_CREATE. Fri May 3 19:30:02 1996 Greg Kreider <kreider@natlab.research.philips.com> * [controls/combo.c] [controls/listbox.c] Pass WM_[HV]SCROLL to listbox, but not combo. Don't try to redraw non-existant scroll bars (changes dwStyle flags). Combo box gets border. Combo box includes button (otherwise button won't trigger dropdown). Proper border around RectButton. Check size consistancy of combo, listbox, and button after resizing or before painting. These routines still aren't completely correct. Localize size checks in separate routines. Listboxes are white. Thu May 2 19:21:23 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/combo.c][include/commdlg.h][include/commdlg.c] [resources/sysres_De.rc][resources/sysres_En.rc] Introduced ChooseFont dialog, but needed some patches in handling of comboboxes with edit controls. Tue Apr 30 00:33:27 1996 Ulrich Schmid <uschmid@mail.hh.provi.de> * [programs/winhelp/*] Added a help viewer and a simple `.hlp' to `.sgml' converter. Mon Apr 29 14:17:57 1996 Tristan Tarrant <tst@sthinc.demon.co.uk> * [resources/sysres_*.rc] [misc/shell.c] Modified size of "About" dialog boxes. Sat Apr 27 18:10:11 Martin von Loewis <loewis@informatik.hu-berlin.de> * [if1632/Makefile.in][loader/builtin.c] crtdll.spec, ntdll.spec, wsock32.spec: new files. * [loader/pe_image.c] Fix error message if import by ordinal failed.
1996-05-06 18:06:24 +02:00
/*
* Help Viewer
*
* Copyright 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
*/
#include <stdio.h>
#include <windows.h>
#ifdef WINELIB
#include <resource.h>
#include <options.h>
#include <shell.h>
extern const char people[];
#endif
#include "winhelp.h"
VOID LIBWINE_Register_De(void);
VOID LIBWINE_Register_En(void);
Release 960805 Sun Aug 4 18:18:48 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/scroll.c] Attempted to implement undocumented scroll-bar messages. * [tools/build.c] [include/callback.h] [windows/winproc.c] CallTo16_* functions now get DS from the previous 16-bit stackframe. * [if1632/thunk.c] [include/callback.h] Added thunks to implement callbacks for the emulator. Now all the Enum* functions always take a real function pointer even in the emulator. * [loader/builtin.c] Removed binary search in BUILTIN_GetEntryPoint32(), as it didn't work with NULL entry points. Using linear search now. * [loader/module.c] Implemented IsSharedSelector(). * [loader/task.c] Changed SwitchStackTo/Back to use the instance data to store the previous stack instead of the TDB. Also copy the local variables onto the new stack. Added GetExeVersion() and SetTackSignalProc(). Implemented SetSigHandler(). Sat Aug 3 22:19:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk> * [controls/menu.c] "Fixed" problem in deleting menus where win32 could get into an endless loop when it crashed. I think I've fixed the symptoms, not the original problem so it might be worth further investigation. * [debugger/registers.c] Added missing #ifdefs on FS_REG and GS_REG, needed for FreeBSD to compile wine properly. * [files/dos_fs.c] Made DOSFS_Hash and DOSFS_Match non-static so they can be called from win32/findfile.c (q.v.). * [if1632/gdi32.spec] Added SetMapMode (call existing function) * [if1632/kernel32.spec] Added FindFirstFileA and SetFileAttributesA. * [if1632/user32.spec] Added BringWindowToTop, CreatePopupMenu, GetKeyState, GetParent, IsDlgButtonChecked (call existing functions) and IsDialogMessageA, UnhookWindowsHookEx. * [win32/file.c] Added stub function SetFileAttributes32A. It's a stub because I can't really work out what this function should do with most attributes in a Unix environment. Anyone care to expand it? * [win32/findfile.c] New file. Initial stab at FindFirstFile. This doesn't work as specified yet, though a lot of the groundwork is there. I haven't time to work on this for the next month, so if anyone wants to pick it up and run with it please do. * [win32/memory.c] Removed malloc.h from includes (covered by stdlib.h include, and gets rid of a warning in FreeBSD). * [win32/newfns.c] UnhookWindowsHookEx32A stub added. * [win32/user32.c] Added implementation of IsDialogMessage32A. * [windows/dialog.c] IsDlgButtonChecked now calls SendDlgItemMessage32A instead of SendDlgItemMessage16. Sat Aug 3 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/graphics.c] Removed rectangle checking (conflicted with nonstandard mapping modes). * [windows/dialog.c] Added check for child-style dialogs to DS_ABSALIGN coordinate conversion. * [objects/color.c] Cleaned up misc. bits Thu Aug 1 10:51:45 1996 Andrew Lewycky <plewycky@oise.utoronto.ca> * [windows/focus.c] [windows/event.c] [windows/win.c] [windows/defdlg.c] Fixes to focusing and activation. * [windows/defdlg.c] Properly(?) handle DM_GETDEFID. * [controls/combo.c] Handle CB_FINDSTRINGEXACT, CB_SETEDITSEL, CB_GETEDITSEL. CBCheckSize: Adjust edit position. Tue Jul 30 09:46:36 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/file.c] [include/file.h] [loader/module.c] [loader/ne_image.c] Pass HFILEs instead of unix-fds to self-loader code. Mon Jul 29 21:48:25 1996 Albrecht Kleine <kleine@ak.sax.de> * [include/metafile.h] [objects/metafile.c] [objects/text.c] Implemented handling of some new metafile records (META_...) in PlayMetaFileRecord(), rewrite of 'case META_EXTTEXTOUT'. Added functions like MF_StretchBlt() for usage in metafiles. Minor bugfix in CopyMetafile(). * [objects/bitmap.c][objects/dib.c] Added check for metafile-DC in Bitmap and DIB functions: CreateCompatibleBitmap() etc.
1996-08-05 19:42:43 +02:00
VOID LIBWINE_Register_Fi(void);
Release 960521 Tue May 21 14:06:07 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] Made ButtonWndProc a 32-bit window procedure. * [controls/desktop.c] Made DesktopWndProc a 32-bit window procedure. Added handling of WM_SETCURSOR. * [controls/menu.c] Allocate menu items and strings on the 32-bit system heap. Implemented Win32 versions for ChangeMenu, InsertMenu, ModifyMenu, AppendMenu and LoadMenuIndirect. * [controls/widgets.c] Added possibility to have 32-bit built-in classes. * [files/drive.c] Implemented GetLogicalDrive() and GetLogicalDriveStrings(). * [misc/spy.c] [include/spy.h] Added support for spying Win32 messages. * [loader/builtin.c] Fixed bug in -dll option parsing. * [memory/local.c] Added back the change by Huw D. M. Davies to free the block in LocalRealloc() before allocating the new one. * [objects/bitmap.c] [objects/cursoricon.c] [objects/oembitmap.c] Fixed bug in bitmap size that caused memory corruption for 24bpp. * [windows/defwnd.c] Implemented Win32 version of DefWindowProc(). * [windows/dialog.c] Implemented Win32 version of SendDlgItemMessage, Get/SetDlgItemText and Get/SetDlgItemInt. * [windows/mdi.c] Implemented Win32 version of DefFrameProc() and DefMDIChildProc(). Don't make a copy of the OBM bitmaps for every MDI window. * [windows/message.c] Implemented Win32 version of SendMessage(). * [windows/winproc.c] [windows/class.c] [windows/win.c] New scheme for 32-bit window procedures to replace aliases. All 32-bit window procedure get a 16-bit address pointing to a WINDOWPROC structure. Implemented Ansi<->Unicode translation for CallWindowProc(). Added translation of WM_DRAWITEM between Win16 and Win32. * [windows/win.c] [include/callback.h] Added ugly hack to build CREATESTRUCT on the stack when sending WM_NCCREATE. Implemented Win32 version of Get/SetWindowWord/Long and Get/SetWindowText. Fri May 17 10:20:16 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/button.c] Avoid gray text on gray background in disabled push buttons using a b/w raster and some raster operations (PatBlt,BitBlt). * [objects/text.c] DrawText(): don't draw an underbar anymore if DT_CALCRECT is set.
1996-05-21 17:01:41 +02:00
VOID LIBWINE_Register_Fr(void);
Release 960506 Mon May 6 12:56:26 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [DEVELOPERS-HINTS] Added paragraph on naming conventions for Win16/Win32/Winelib. * [controls/menu.c] Create a default system menu that is the same for all windows instead of making a copy every time. * [include/wintypes.h] Added WINELIB_NAME and DECL_WINELIB_TYPE macros. Added xx16 and xx32 definitions for most types. General clean-up. * [memory/global.c] [memory/local.c] [*/*] Renamed Global and Local heap functions to xxx16. Added all xxx32 versions of the same functions. * [memory/selector.c] Mask out lower bits of selector in FreeSelector(). * [misc/lstr.c] Fixed wvsprintf(). * [windows/class.c] Changed the class structure to make Win32 support easier. * [windows/defwnd.c] Added handling of WM_INITMENUPOPUP for system menu to gray out invalid options. * [windows/winpos.c] Bug fix: the WINDOSPOS structure pointer in WM_NCCALCSIZE must be a SEGPTR. Sun May 5 03:51:26 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Implementation of moveable and (rudimentary) support for discardable local memory, plus several bug fixes. Sat May 4 18:33:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [include/windows.h] [windows/win.c] [if1632/user.spec] FindWindowEx() implemented (someone reported it was missing for FrameMaker 4.1). * [if1632/kernel32.spec] [if1632/user32.spec] [win32/memory.c] [win32/resource.c] Misc small stubs/small functions which bring win95 binaries further down the road. (IsBadCodePtr, LocalReAlloc,GetCursorPos) Small fix in WIN32_LoadAcceleratorsA. Fri May 3 19:43:12 1996 Frans van Dorsselaer <dorssel@rulhm1.LeidenUniv.nl> * [controls/edit.c] [controls/EDIT.TODO] Changed / fixed some types and typecasts. Fixed the scrollbar reset after WM_SETHANDLE / WM_SETTEXT. Added heap initialization in WM_CREATE. Fri May 3 19:30:02 1996 Greg Kreider <kreider@natlab.research.philips.com> * [controls/combo.c] [controls/listbox.c] Pass WM_[HV]SCROLL to listbox, but not combo. Don't try to redraw non-existant scroll bars (changes dwStyle flags). Combo box gets border. Combo box includes button (otherwise button won't trigger dropdown). Proper border around RectButton. Check size consistancy of combo, listbox, and button after resizing or before painting. These routines still aren't completely correct. Localize size checks in separate routines. Listboxes are white. Thu May 2 19:21:23 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/combo.c][include/commdlg.h][include/commdlg.c] [resources/sysres_De.rc][resources/sysres_En.rc] Introduced ChooseFont dialog, but needed some patches in handling of comboboxes with edit controls. Tue Apr 30 00:33:27 1996 Ulrich Schmid <uschmid@mail.hh.provi.de> * [programs/winhelp/*] Added a help viewer and a simple `.hlp' to `.sgml' converter. Mon Apr 29 14:17:57 1996 Tristan Tarrant <tst@sthinc.demon.co.uk> * [resources/sysres_*.rc] [misc/shell.c] Modified size of "About" dialog boxes. Sat Apr 27 18:10:11 Martin von Loewis <loewis@informatik.hu-berlin.de> * [if1632/Makefile.in][loader/builtin.c] crtdll.spec, ntdll.spec, wsock32.spec: new files. * [loader/pe_image.c] Fix error message if import by ordinal failed.
1996-05-06 18:06:24 +02:00
static BOOL WINHELP_RegisterWinClasses();
static LRESULT WINHELP_MainWndProc(HWND, UINT, WPARAM, LPARAM);
static LRESULT WINHELP_TextWndProc(HWND, UINT, WPARAM, LPARAM);
static LRESULT WINHELP_ButtonBoxWndProc(HWND, UINT, WPARAM, LPARAM);
static VOID WINHELP_CheckPopup(UINT);
static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE);
static VOID WINHELP_InitFonts(HWND hWnd);
static VOID WINHELP_DeleteLines(WINHELP_WINDOW*);
static VOID WINHELP_DeleteWindow(WINHELP_WINDOW*);
static VOID WINHELP_SetupText(HWND hWnd);
static BOOL WINHELP_AppendText(WINHELP_LINE***, WINHELP_LINE_PART***,
LPSIZE, LPSIZE, INT*, INT, LPCSTR, UINT,
HFONT, COLORREF, HLPFILE_LINK*);
WINHELP_GLOBALS Globals = {3, 0, 0, 0, 0, 0};
static BOOL MacroTest = FALSE;
/***********************************************************************
*
* WinMain
*/
int PASCAL WinMain (HANDLE hInstance, HANDLE prev, LPSTR cmdline, int show)
{
LPCSTR opt_lang = "En";
CHAR lang[3];
MSG msg;
LONG lHash = 0;
INT langnum;
#if defined(WINELIB) && !defined(HAVE_WINE_CONSTRUCTOR)
/* Register resources */
LIBWINE_Register_De();
LIBWINE_Register_En();
Release 960805 Sun Aug 4 18:18:48 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/scroll.c] Attempted to implement undocumented scroll-bar messages. * [tools/build.c] [include/callback.h] [windows/winproc.c] CallTo16_* functions now get DS from the previous 16-bit stackframe. * [if1632/thunk.c] [include/callback.h] Added thunks to implement callbacks for the emulator. Now all the Enum* functions always take a real function pointer even in the emulator. * [loader/builtin.c] Removed binary search in BUILTIN_GetEntryPoint32(), as it didn't work with NULL entry points. Using linear search now. * [loader/module.c] Implemented IsSharedSelector(). * [loader/task.c] Changed SwitchStackTo/Back to use the instance data to store the previous stack instead of the TDB. Also copy the local variables onto the new stack. Added GetExeVersion() and SetTackSignalProc(). Implemented SetSigHandler(). Sat Aug 3 22:19:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk> * [controls/menu.c] "Fixed" problem in deleting menus where win32 could get into an endless loop when it crashed. I think I've fixed the symptoms, not the original problem so it might be worth further investigation. * [debugger/registers.c] Added missing #ifdefs on FS_REG and GS_REG, needed for FreeBSD to compile wine properly. * [files/dos_fs.c] Made DOSFS_Hash and DOSFS_Match non-static so they can be called from win32/findfile.c (q.v.). * [if1632/gdi32.spec] Added SetMapMode (call existing function) * [if1632/kernel32.spec] Added FindFirstFileA and SetFileAttributesA. * [if1632/user32.spec] Added BringWindowToTop, CreatePopupMenu, GetKeyState, GetParent, IsDlgButtonChecked (call existing functions) and IsDialogMessageA, UnhookWindowsHookEx. * [win32/file.c] Added stub function SetFileAttributes32A. It's a stub because I can't really work out what this function should do with most attributes in a Unix environment. Anyone care to expand it? * [win32/findfile.c] New file. Initial stab at FindFirstFile. This doesn't work as specified yet, though a lot of the groundwork is there. I haven't time to work on this for the next month, so if anyone wants to pick it up and run with it please do. * [win32/memory.c] Removed malloc.h from includes (covered by stdlib.h include, and gets rid of a warning in FreeBSD). * [win32/newfns.c] UnhookWindowsHookEx32A stub added. * [win32/user32.c] Added implementation of IsDialogMessage32A. * [windows/dialog.c] IsDlgButtonChecked now calls SendDlgItemMessage32A instead of SendDlgItemMessage16. Sat Aug 3 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/graphics.c] Removed rectangle checking (conflicted with nonstandard mapping modes). * [windows/dialog.c] Added check for child-style dialogs to DS_ABSALIGN coordinate conversion. * [objects/color.c] Cleaned up misc. bits Thu Aug 1 10:51:45 1996 Andrew Lewycky <plewycky@oise.utoronto.ca> * [windows/focus.c] [windows/event.c] [windows/win.c] [windows/defdlg.c] Fixes to focusing and activation. * [windows/defdlg.c] Properly(?) handle DM_GETDEFID. * [controls/combo.c] Handle CB_FINDSTRINGEXACT, CB_SETEDITSEL, CB_GETEDITSEL. CBCheckSize: Adjust edit position. Tue Jul 30 09:46:36 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/file.c] [include/file.h] [loader/module.c] [loader/ne_image.c] Pass HFILEs instead of unix-fds to self-loader code. Mon Jul 29 21:48:25 1996 Albrecht Kleine <kleine@ak.sax.de> * [include/metafile.h] [objects/metafile.c] [objects/text.c] Implemented handling of some new metafile records (META_...) in PlayMetaFileRecord(), rewrite of 'case META_EXTTEXTOUT'. Added functions like MF_StretchBlt() for usage in metafiles. Minor bugfix in CopyMetafile(). * [objects/bitmap.c][objects/dib.c] Added check for metafile-DC in Bitmap and DIB functions: CreateCompatibleBitmap() etc.
1996-08-05 19:42:43 +02:00
LIBWINE_Register_Fi();
Release 960521 Tue May 21 14:06:07 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] Made ButtonWndProc a 32-bit window procedure. * [controls/desktop.c] Made DesktopWndProc a 32-bit window procedure. Added handling of WM_SETCURSOR. * [controls/menu.c] Allocate menu items and strings on the 32-bit system heap. Implemented Win32 versions for ChangeMenu, InsertMenu, ModifyMenu, AppendMenu and LoadMenuIndirect. * [controls/widgets.c] Added possibility to have 32-bit built-in classes. * [files/drive.c] Implemented GetLogicalDrive() and GetLogicalDriveStrings(). * [misc/spy.c] [include/spy.h] Added support for spying Win32 messages. * [loader/builtin.c] Fixed bug in -dll option parsing. * [memory/local.c] Added back the change by Huw D. M. Davies to free the block in LocalRealloc() before allocating the new one. * [objects/bitmap.c] [objects/cursoricon.c] [objects/oembitmap.c] Fixed bug in bitmap size that caused memory corruption for 24bpp. * [windows/defwnd.c] Implemented Win32 version of DefWindowProc(). * [windows/dialog.c] Implemented Win32 version of SendDlgItemMessage, Get/SetDlgItemText and Get/SetDlgItemInt. * [windows/mdi.c] Implemented Win32 version of DefFrameProc() and DefMDIChildProc(). Don't make a copy of the OBM bitmaps for every MDI window. * [windows/message.c] Implemented Win32 version of SendMessage(). * [windows/winproc.c] [windows/class.c] [windows/win.c] New scheme for 32-bit window procedures to replace aliases. All 32-bit window procedure get a 16-bit address pointing to a WINDOWPROC structure. Implemented Ansi<->Unicode translation for CallWindowProc(). Added translation of WM_DRAWITEM between Win16 and Win32. * [windows/win.c] [include/callback.h] Added ugly hack to build CREATESTRUCT on the stack when sending WM_NCCREATE. Implemented Win32 version of Get/SetWindowWord/Long and Get/SetWindowText. Fri May 17 10:20:16 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/button.c] Avoid gray text on gray background in disabled push buttons using a b/w raster and some raster operations (PatBlt,BitBlt). * [objects/text.c] DrawText(): don't draw an underbar anymore if DT_CALCRECT is set.
1996-05-21 17:01:41 +02:00
LIBWINE_Register_Fr();
Release 960506 Mon May 6 12:56:26 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [DEVELOPERS-HINTS] Added paragraph on naming conventions for Win16/Win32/Winelib. * [controls/menu.c] Create a default system menu that is the same for all windows instead of making a copy every time. * [include/wintypes.h] Added WINELIB_NAME and DECL_WINELIB_TYPE macros. Added xx16 and xx32 definitions for most types. General clean-up. * [memory/global.c] [memory/local.c] [*/*] Renamed Global and Local heap functions to xxx16. Added all xxx32 versions of the same functions. * [memory/selector.c] Mask out lower bits of selector in FreeSelector(). * [misc/lstr.c] Fixed wvsprintf(). * [windows/class.c] Changed the class structure to make Win32 support easier. * [windows/defwnd.c] Added handling of WM_INITMENUPOPUP for system menu to gray out invalid options. * [windows/winpos.c] Bug fix: the WINDOSPOS structure pointer in WM_NCCALCSIZE must be a SEGPTR. Sun May 5 03:51:26 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Implementation of moveable and (rudimentary) support for discardable local memory, plus several bug fixes. Sat May 4 18:33:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [include/windows.h] [windows/win.c] [if1632/user.spec] FindWindowEx() implemented (someone reported it was missing for FrameMaker 4.1). * [if1632/kernel32.spec] [if1632/user32.spec] [win32/memory.c] [win32/resource.c] Misc small stubs/small functions which bring win95 binaries further down the road. (IsBadCodePtr, LocalReAlloc,GetCursorPos) Small fix in WIN32_LoadAcceleratorsA. Fri May 3 19:43:12 1996 Frans van Dorsselaer <dorssel@rulhm1.LeidenUniv.nl> * [controls/edit.c] [controls/EDIT.TODO] Changed / fixed some types and typecasts. Fixed the scrollbar reset after WM_SETHANDLE / WM_SETTEXT. Added heap initialization in WM_CREATE. Fri May 3 19:30:02 1996 Greg Kreider <kreider@natlab.research.philips.com> * [controls/combo.c] [controls/listbox.c] Pass WM_[HV]SCROLL to listbox, but not combo. Don't try to redraw non-existant scroll bars (changes dwStyle flags). Combo box gets border. Combo box includes button (otherwise button won't trigger dropdown). Proper border around RectButton. Check size consistancy of combo, listbox, and button after resizing or before painting. These routines still aren't completely correct. Localize size checks in separate routines. Listboxes are white. Thu May 2 19:21:23 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/combo.c][include/commdlg.h][include/commdlg.c] [resources/sysres_De.rc][resources/sysres_En.rc] Introduced ChooseFont dialog, but needed some patches in handling of comboboxes with edit controls. Tue Apr 30 00:33:27 1996 Ulrich Schmid <uschmid@mail.hh.provi.de> * [programs/winhelp/*] Added a help viewer and a simple `.hlp' to `.sgml' converter. Mon Apr 29 14:17:57 1996 Tristan Tarrant <tst@sthinc.demon.co.uk> * [resources/sysres_*.rc] [misc/shell.c] Modified size of "About" dialog boxes. Sat Apr 27 18:10:11 Martin von Loewis <loewis@informatik.hu-berlin.de> * [if1632/Makefile.in][loader/builtin.c] crtdll.spec, ntdll.spec, wsock32.spec: new files. * [loader/pe_image.c] Fix error message if import by ordinal failed.
1996-05-06 18:06:24 +02:00
#endif
Globals.hInstance = hInstance;
/* Get options */
while (*cmdline && (*cmdline == ' ' || *cmdline == '-'))
{
CHAR option;
LPCSTR topic_id;
if (*cmdline++ == ' ') continue;
option = *cmdline;
if (option) cmdline++;
while (*cmdline && *cmdline == ' ') cmdline++;
switch(option)
{
case 'i':
case 'I':
topic_id = cmdline;
while (*cmdline && *cmdline != ' ') cmdline++;
if (*cmdline) *cmdline++ = '\0';
lHash = HLPFILE_Hash(topic_id);
break;
case '3':
case '4':
Globals.wVersion = option - '0';
break;
case 't':
MacroTest = TRUE;
break;
}
}
#ifdef WINELIB
opt_lang = langNames[Options.language];
#endif
/* Find language specific string table */
for (langnum = 0; langnum <= MAX_LANGUAGE_NUMBER; langnum++)
{
Globals.wStringTableOffset = langnum * 0x100;
if (LoadString(hInstance, IDS_LANGUAGE_ID, lang, sizeof(lang)) &&
!lstrcmp(opt_lang, lang))
break;
}
if (langnum > MAX_LANGUAGE_NUMBER)
{
/* Find fallback language */
for (langnum = 0; langnum <= MAX_LANGUAGE_NUMBER; langnum++)
{
Globals.wStringTableOffset = langnum * 0x100;
if (LoadString(hInstance, IDS_LANGUAGE_ID, lang, sizeof(lang)))
break;
}
if (langnum > MAX_LANGUAGE_NUMBER)
{
MessageBox(0, "No language found", "FATAL ERROR", MB_OK);
return(1);
}
}
/* Change Resource names */
lstrcpyn(STRING_MENU_Xx + lstrlen(STRING_MENU_Xx) - 2, lang, 3);
/* Create primary window */
WINHELP_RegisterWinClasses();
WINHELP_CreateHelpWindow(cmdline, lHash, "main", FALSE, NULL, NULL, show);
/* Message loop */
while (GetMessage (&msg, 0, 0, 0))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return 0;
}
/***********************************************************************
*
* RegisterWinClasses
*/
static BOOL WINHELP_RegisterWinClasses()
{
WNDCLASS class_main, class_button_box, class_text, class_shadow;
class_main.style = CS_HREDRAW | CS_VREDRAW;
class_main.lpfnWndProc = WINHELP_MainWndProc;
class_main.cbClsExtra = 0;
class_main.cbWndExtra = sizeof(LONG);
class_main.hInstance = Globals.hInstance;
class_main.hIcon = LoadIcon (0, IDI_APPLICATION);
class_main.hCursor = LoadCursor (0, IDC_ARROW);
class_main.hbrBackground = GetStockObject (WHITE_BRUSH);
class_main.lpszMenuName = 0;
class_main.lpszClassName = MAIN_WIN_CLASS_NAME;
class_button_box = class_main;
class_button_box.lpfnWndProc = WINHELP_ButtonBoxWndProc;
class_button_box.hbrBackground = GetStockObject(GRAY_BRUSH);
class_button_box.lpszClassName = BUTTON_BOX_WIN_CLASS_NAME;
class_text = class_main;
class_text.lpfnWndProc = WINHELP_TextWndProc;
class_text.lpszClassName = TEXT_WIN_CLASS_NAME;
class_shadow = class_main;
class_shadow.lpfnWndProc = DefWindowProc;
class_shadow.hbrBackground = GetStockObject(GRAY_BRUSH);
class_shadow.lpszClassName = SHADOW_WIN_CLASS_NAME;
return (RegisterClass(&class_main) &&
RegisterClass(&class_button_box) &&
RegisterClass(&class_text) &&
RegisterClass(&class_shadow));
}
/***********************************************************************
*
* WINHELP_CreateHelpWindow
*/
VOID WINHELP_CreateHelpWindow(LPCSTR lpszFile, LONG lHash, LPCSTR lpszWindow,
BOOL bPopup, HWND hParentWnd, LPPOINT mouse, INT nCmdShow)
{
CHAR szCaption[MAX_STRING_LEN];
CHAR szContents[MAX_STRING_LEN];
CHAR szSearch[MAX_STRING_LEN];
CHAR szBack[MAX_STRING_LEN];
CHAR szHistory[MAX_STRING_LEN];
SIZE size = {CW_USEDEFAULT, CW_USEDEFAULT};
POINT origin = {240, 0};
LPSTR ptr;
HGLOBAL handle;
WINHELP_WINDOW *win, *oldwin;
HLPFILE_PAGE *page;
HLPFILE_MACRO *macro;
HWND hWnd;
BOOL bPrimary;
if (bPopup)
lpszWindow = NULL;
Release 960521 Tue May 21 14:06:07 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] Made ButtonWndProc a 32-bit window procedure. * [controls/desktop.c] Made DesktopWndProc a 32-bit window procedure. Added handling of WM_SETCURSOR. * [controls/menu.c] Allocate menu items and strings on the 32-bit system heap. Implemented Win32 versions for ChangeMenu, InsertMenu, ModifyMenu, AppendMenu and LoadMenuIndirect. * [controls/widgets.c] Added possibility to have 32-bit built-in classes. * [files/drive.c] Implemented GetLogicalDrive() and GetLogicalDriveStrings(). * [misc/spy.c] [include/spy.h] Added support for spying Win32 messages. * [loader/builtin.c] Fixed bug in -dll option parsing. * [memory/local.c] Added back the change by Huw D. M. Davies to free the block in LocalRealloc() before allocating the new one. * [objects/bitmap.c] [objects/cursoricon.c] [objects/oembitmap.c] Fixed bug in bitmap size that caused memory corruption for 24bpp. * [windows/defwnd.c] Implemented Win32 version of DefWindowProc(). * [windows/dialog.c] Implemented Win32 version of SendDlgItemMessage, Get/SetDlgItemText and Get/SetDlgItemInt. * [windows/mdi.c] Implemented Win32 version of DefFrameProc() and DefMDIChildProc(). Don't make a copy of the OBM bitmaps for every MDI window. * [windows/message.c] Implemented Win32 version of SendMessage(). * [windows/winproc.c] [windows/class.c] [windows/win.c] New scheme for 32-bit window procedures to replace aliases. All 32-bit window procedure get a 16-bit address pointing to a WINDOWPROC structure. Implemented Ansi<->Unicode translation for CallWindowProc(). Added translation of WM_DRAWITEM between Win16 and Win32. * [windows/win.c] [include/callback.h] Added ugly hack to build CREATESTRUCT on the stack when sending WM_NCCREATE. Implemented Win32 version of Get/SetWindowWord/Long and Get/SetWindowText. Fri May 17 10:20:16 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/button.c] Avoid gray text on gray background in disabled push buttons using a b/w raster and some raster operations (PatBlt,BitBlt). * [objects/text.c] DrawText(): don't draw an underbar anymore if DT_CALCRECT is set.
1996-05-21 17:01:41 +02:00
else if (!lpszWindow || !lpszWindow[0])
Release 960506 Mon May 6 12:56:26 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [DEVELOPERS-HINTS] Added paragraph on naming conventions for Win16/Win32/Winelib. * [controls/menu.c] Create a default system menu that is the same for all windows instead of making a copy every time. * [include/wintypes.h] Added WINELIB_NAME and DECL_WINELIB_TYPE macros. Added xx16 and xx32 definitions for most types. General clean-up. * [memory/global.c] [memory/local.c] [*/*] Renamed Global and Local heap functions to xxx16. Added all xxx32 versions of the same functions. * [memory/selector.c] Mask out lower bits of selector in FreeSelector(). * [misc/lstr.c] Fixed wvsprintf(). * [windows/class.c] Changed the class structure to make Win32 support easier. * [windows/defwnd.c] Added handling of WM_INITMENUPOPUP for system menu to gray out invalid options. * [windows/winpos.c] Bug fix: the WINDOSPOS structure pointer in WM_NCCALCSIZE must be a SEGPTR. Sun May 5 03:51:26 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Implementation of moveable and (rudimentary) support for discardable local memory, plus several bug fixes. Sat May 4 18:33:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [include/windows.h] [windows/win.c] [if1632/user.spec] FindWindowEx() implemented (someone reported it was missing for FrameMaker 4.1). * [if1632/kernel32.spec] [if1632/user32.spec] [win32/memory.c] [win32/resource.c] Misc small stubs/small functions which bring win95 binaries further down the road. (IsBadCodePtr, LocalReAlloc,GetCursorPos) Small fix in WIN32_LoadAcceleratorsA. Fri May 3 19:43:12 1996 Frans van Dorsselaer <dorssel@rulhm1.LeidenUniv.nl> * [controls/edit.c] [controls/EDIT.TODO] Changed / fixed some types and typecasts. Fixed the scrollbar reset after WM_SETHANDLE / WM_SETTEXT. Added heap initialization in WM_CREATE. Fri May 3 19:30:02 1996 Greg Kreider <kreider@natlab.research.philips.com> * [controls/combo.c] [controls/listbox.c] Pass WM_[HV]SCROLL to listbox, but not combo. Don't try to redraw non-existant scroll bars (changes dwStyle flags). Combo box gets border. Combo box includes button (otherwise button won't trigger dropdown). Proper border around RectButton. Check size consistancy of combo, listbox, and button after resizing or before painting. These routines still aren't completely correct. Localize size checks in separate routines. Listboxes are white. Thu May 2 19:21:23 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/combo.c][include/commdlg.h][include/commdlg.c] [resources/sysres_De.rc][resources/sysres_En.rc] Introduced ChooseFont dialog, but needed some patches in handling of comboboxes with edit controls. Tue Apr 30 00:33:27 1996 Ulrich Schmid <uschmid@mail.hh.provi.de> * [programs/winhelp/*] Added a help viewer and a simple `.hlp' to `.sgml' converter. Mon Apr 29 14:17:57 1996 Tristan Tarrant <tst@sthinc.demon.co.uk> * [resources/sysres_*.rc] [misc/shell.c] Modified size of "About" dialog boxes. Sat Apr 27 18:10:11 Martin von Loewis <loewis@informatik.hu-berlin.de> * [if1632/Makefile.in][loader/builtin.c] crtdll.spec, ntdll.spec, wsock32.spec: new files. * [loader/pe_image.c] Fix error message if import by ordinal failed.
1996-05-06 18:06:24 +02:00
lpszWindow = Globals.active_win->lpszName;
bPrimary = lpszWindow && !lstrcmpi(lpszWindow, "main");
/* Read help file */
if (lpszFile[0])
{
page = lHash ? HLPFILE_PageByHash(lpszFile, lHash) : HLPFILE_Contents(lpszFile);
/* Add Suffix `.hlp' */
if (!page && lstrcmpi(lpszFile + strlen(lpszFile) - 4, ".hlp"))
{
CHAR szFile_hlp[MAX_PATHNAME_LEN];
lstrcpyn(szFile_hlp, lpszFile, sizeof(szFile_hlp) - 4);
szFile_hlp[sizeof(szFile_hlp) - 5] = '\0';
lstrcat(szFile_hlp, ".hlp");
page = lHash ? HLPFILE_PageByHash(szFile_hlp, lHash) : HLPFILE_Contents(szFile_hlp);
if (!page)
{
WINHELP_MessageBoxIDS_s(IDS_HLPFILE_ERROR_s, lpszFile, IDS_ERROR, MB_OK);
if (Globals.win_list) return;
}
}
}
else page = 0;
/* Calculate horizontal size and position of a popup window */
if (bPopup)
{
RECT parent_rect;
GetWindowRect(hParentWnd, &parent_rect);
size.cx = (parent_rect.right - parent_rect.left) / 2;
origin = *mouse;
ClientToScreen(hParentWnd, &origin);
origin.x -= size.cx / 2;
origin.x = MIN(origin.x, GetSystemMetrics(SM_CXSCREEN) - size.cx);
origin.x = MAX(origin.x, 0);
}
/* Initialize WINHELP_WINDOW struct */
handle = GlobalAlloc(GMEM_FIXED, sizeof(WINHELP_WINDOW) +
(lpszWindow ? strlen(lpszWindow) + 1 : 0));
if (!handle) return;
win = GlobalLock(handle);
win->hSelf = handle;
win->next = Globals.win_list;
Globals.win_list = win;
if (lpszWindow)
{
ptr = GlobalLock(handle);
ptr += sizeof(WINHELP_WINDOW);
lstrcpy(ptr, (LPSTR) lpszWindow);
win->lpszName = ptr;
}
else win->lpszName = NULL;
win->page = page;
win->first_button = 0;
win->first_line = 0;
win->hMainWnd = 0;
win->hButtonBoxWnd = 0;
win->hTextWnd = 0;
win->hShadowWnd = 0;
Globals.active_win = win;
/* Initialize default pushbuttons */
if (MacroTest && !bPopup)
MACRO_CreateButton("BTN_TEST", "&Test", "MacroTest");
if (bPrimary && page)
{
LoadString(Globals.hInstance, IDS_CONTENTS, szContents, sizeof(szContents));
LoadString(Globals.hInstance, IDS_SEARCH, szSearch, sizeof(szSearch));
LoadString(Globals.hInstance, IDS_BACK, szBack, sizeof(szBack));
LoadString(Globals.hInstance, IDS_HISTORY, szHistory, sizeof(szHistory));
MACRO_CreateButton("BTN_CONTENTS", szContents, "Contents()");
MACRO_CreateButton("BTN_SEARCH", szSearch, "Search()");
MACRO_CreateButton("BTN_BACK", szBack, "Back()");
MACRO_CreateButton("BTN_HISTORY", szHistory, "History()");
}
/* Initialize file specific pushbuttons */
if (!bPopup && page)
for (macro = page->file->first_macro; macro; macro = macro->next)
MACRO_ExecuteMacro(macro->lpszMacro);
/* Reuse existing window */
if (lpszWindow)
for (oldwin = win->next; oldwin; oldwin = oldwin->next)
if (oldwin->lpszName && !lstrcmpi(oldwin->lpszName, lpszWindow))
{
WINHELP_BUTTON *button;
win->hMainWnd = oldwin->hMainWnd;
win->hButtonBoxWnd = oldwin->hButtonBoxWnd;
win->hTextWnd = oldwin->hTextWnd;
oldwin->hMainWnd = oldwin->hButtonBoxWnd = oldwin->hTextWnd = 0;
SetWindowLong(win->hMainWnd, 0, (LONG) win);
SetWindowLong(win->hButtonBoxWnd, 0, (LONG) win);
SetWindowLong(win->hTextWnd, 0, (LONG) win);
WINHELP_InitFonts(win->hMainWnd);
SetWindowText(win->hMainWnd, page->file->lpszTitle);
WINHELP_SetupText(win->hTextWnd);
InvalidateRect(win->hTextWnd, NULL, TRUE);
SendMessage(win->hMainWnd, WM_USER, 0, 0);
UpdateWindow(win->hTextWnd);
for (button = oldwin->first_button; button; button = button->next)
DestroyWindow(button->hWnd);
WINHELP_DeleteWindow(oldwin);
return;
}
/* Create main Window */
if (!page) LoadString(Globals.hInstance, IDS_WINE_HELP, szCaption, sizeof(szCaption));
hWnd = CreateWindow (bPopup ? TEXT_WIN_CLASS_NAME : MAIN_WIN_CLASS_NAME,
Release 960717 Wed Jul 17 16:10:16 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [configure.in] Generate include/config.h instead of putting everything on the command-line. Removed -with-malloc-debug option (not useful for end users anyway). Added check for memmove(). * [include/wintypes.h] [*/Makefile.in] Added definition of __WINE__ symbol when compiling Wine code (emulator or library) as opposed to user programs. * [debugger/editline.c] [debugger/readline/*] Moved all the readline code into debugger/editline.c. Removed the readline subdirectory. * [files/profile.c] Added PROFILE_GetWineIniInt(). * [include/stackframe.h] [loader/task.c] The 16-bit stackframe now also exists for Winelib (even though it only ever contains one frame). * [loader/module.c] Added function MODULE_CreateDummyModule() to create a dummy Win16 module for Winelib and Win32. * [memory/ldt.c] Make sure the ldt entry contents will be acceptable for the Linux kernel. * [memory/selector.c] Fixed SetSelectorLimit() when the limit is in pages. * [misc/port.c] Added memmove(). * [miscemu/dpmi.c] Clear the segment registers that contain the selector being freed in int31/ax=0001. Added missing break after SelectorAccessRights call. * [win32/struct32.c] Added conversions for MDICREATESTRUCT. * [windows/winproc.c] Added message conversions for WM_MDICREATE. Tue Jul 16 19:46:24 1996 Pavel Kankovsky <KAN@frode.dcit.cz> * [windows/class.c] Added GetExePtr() call in CLASS_FindClassByAtom(). Mon Jul 15 17:49:38 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [if1632/*.spec] Some more trivial specs added. * [if1632/gdi32.spec] [objects/font.c][windows/dialog.c] CreateFont32* added, changed to new naming std. * [include/windows.h] [include/mmsystem.h] [include/wintypes.h] Some defines/types added. * [win32/thread.c] TlsSetValue() returns boolean. * [win32/resource.c] [loader/pe_resource.c] [loader/resource.c] [controls/menu.c] [objects/bitmap.c] Cleanup of the resource functions, mostly changes to new naming standard and fixing of argument types so that they agree with the win16/win32 API. Thu Jul 11 15:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/winpos.c] ShowWindow() fixes. * [windows/mdi.c] Fix reversed LPARAM in WM_MDIACTIVATE. * [wine.ini] New option AllocSystemColors tells Wine how many colors to grab from the system colormap. * [objects/bitblt.c] [objects/dc.c] Fixed pink garbage over Word buttons in PseudoColor. Added optional DSTINVERT shortcut for faster text selection. * [misc/wsprintf.c] Skip bogus segmented pointers in wsvnprintf16(). * [objects/gdiobj.c] Added palette handling to UnrealizeObject(). * [objects/color.c] [objects/palette.c] [windows/dce.c] Wine gets palette manager with support for more than 20 colors. Only PseudoColor and TrueColor visuals tested so far. * [windows/winpos.c] [windows/win.c] Set X size hints for WS_EX_DLGMODALFRAME windows (no resize) and use XReconfigureWMWindows() instead of XConfigureWindow() in managed mode. * [memory/global.c] Do not allocate more than 640K of DOS memory. * [misc/main.c] Do not allow -desktop and -managed together.
1996-07-17 22:02:21 +02:00
page ? page->file->lpszTitle : szCaption,
Release 960506 Mon May 6 12:56:26 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [DEVELOPERS-HINTS] Added paragraph on naming conventions for Win16/Win32/Winelib. * [controls/menu.c] Create a default system menu that is the same for all windows instead of making a copy every time. * [include/wintypes.h] Added WINELIB_NAME and DECL_WINELIB_TYPE macros. Added xx16 and xx32 definitions for most types. General clean-up. * [memory/global.c] [memory/local.c] [*/*] Renamed Global and Local heap functions to xxx16. Added all xxx32 versions of the same functions. * [memory/selector.c] Mask out lower bits of selector in FreeSelector(). * [misc/lstr.c] Fixed wvsprintf(). * [windows/class.c] Changed the class structure to make Win32 support easier. * [windows/defwnd.c] Added handling of WM_INITMENUPOPUP for system menu to gray out invalid options. * [windows/winpos.c] Bug fix: the WINDOSPOS structure pointer in WM_NCCALCSIZE must be a SEGPTR. Sun May 5 03:51:26 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Implementation of moveable and (rudimentary) support for discardable local memory, plus several bug fixes. Sat May 4 18:33:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [include/windows.h] [windows/win.c] [if1632/user.spec] FindWindowEx() implemented (someone reported it was missing for FrameMaker 4.1). * [if1632/kernel32.spec] [if1632/user32.spec] [win32/memory.c] [win32/resource.c] Misc small stubs/small functions which bring win95 binaries further down the road. (IsBadCodePtr, LocalReAlloc,GetCursorPos) Small fix in WIN32_LoadAcceleratorsA. Fri May 3 19:43:12 1996 Frans van Dorsselaer <dorssel@rulhm1.LeidenUniv.nl> * [controls/edit.c] [controls/EDIT.TODO] Changed / fixed some types and typecasts. Fixed the scrollbar reset after WM_SETHANDLE / WM_SETTEXT. Added heap initialization in WM_CREATE. Fri May 3 19:30:02 1996 Greg Kreider <kreider@natlab.research.philips.com> * [controls/combo.c] [controls/listbox.c] Pass WM_[HV]SCROLL to listbox, but not combo. Don't try to redraw non-existant scroll bars (changes dwStyle flags). Combo box gets border. Combo box includes button (otherwise button won't trigger dropdown). Proper border around RectButton. Check size consistancy of combo, listbox, and button after resizing or before painting. These routines still aren't completely correct. Localize size checks in separate routines. Listboxes are white. Thu May 2 19:21:23 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/combo.c][include/commdlg.h][include/commdlg.c] [resources/sysres_De.rc][resources/sysres_En.rc] Introduced ChooseFont dialog, but needed some patches in handling of comboboxes with edit controls. Tue Apr 30 00:33:27 1996 Ulrich Schmid <uschmid@mail.hh.provi.de> * [programs/winhelp/*] Added a help viewer and a simple `.hlp' to `.sgml' converter. Mon Apr 29 14:17:57 1996 Tristan Tarrant <tst@sthinc.demon.co.uk> * [resources/sysres_*.rc] [misc/shell.c] Modified size of "About" dialog boxes. Sat Apr 27 18:10:11 Martin von Loewis <loewis@informatik.hu-berlin.de> * [if1632/Makefile.in][loader/builtin.c] crtdll.spec, ntdll.spec, wsock32.spec: new files. * [loader/pe_image.c] Fix error message if import by ordinal failed.
1996-05-06 18:06:24 +02:00
bPopup ? WS_POPUPWINDOW | WS_BORDER : WS_OVERLAPPEDWINDOW,
origin.x, origin.y, size.cx, size.cy,
0, bPrimary ? LoadMenu(Globals.hInstance, STRING_MENU_Xx) : 0,
Release 960717 Wed Jul 17 16:10:16 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [configure.in] Generate include/config.h instead of putting everything on the command-line. Removed -with-malloc-debug option (not useful for end users anyway). Added check for memmove(). * [include/wintypes.h] [*/Makefile.in] Added definition of __WINE__ symbol when compiling Wine code (emulator or library) as opposed to user programs. * [debugger/editline.c] [debugger/readline/*] Moved all the readline code into debugger/editline.c. Removed the readline subdirectory. * [files/profile.c] Added PROFILE_GetWineIniInt(). * [include/stackframe.h] [loader/task.c] The 16-bit stackframe now also exists for Winelib (even though it only ever contains one frame). * [loader/module.c] Added function MODULE_CreateDummyModule() to create a dummy Win16 module for Winelib and Win32. * [memory/ldt.c] Make sure the ldt entry contents will be acceptable for the Linux kernel. * [memory/selector.c] Fixed SetSelectorLimit() when the limit is in pages. * [misc/port.c] Added memmove(). * [miscemu/dpmi.c] Clear the segment registers that contain the selector being freed in int31/ax=0001. Added missing break after SelectorAccessRights call. * [win32/struct32.c] Added conversions for MDICREATESTRUCT. * [windows/winproc.c] Added message conversions for WM_MDICREATE. Tue Jul 16 19:46:24 1996 Pavel Kankovsky <KAN@frode.dcit.cz> * [windows/class.c] Added GetExePtr() call in CLASS_FindClassByAtom(). Mon Jul 15 17:49:38 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [if1632/*.spec] Some more trivial specs added. * [if1632/gdi32.spec] [objects/font.c][windows/dialog.c] CreateFont32* added, changed to new naming std. * [include/windows.h] [include/mmsystem.h] [include/wintypes.h] Some defines/types added. * [win32/thread.c] TlsSetValue() returns boolean. * [win32/resource.c] [loader/pe_resource.c] [loader/resource.c] [controls/menu.c] [objects/bitmap.c] Cleanup of the resource functions, mostly changes to new naming standard and fixing of argument types so that they agree with the win16/win32 API. Thu Jul 11 15:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/winpos.c] ShowWindow() fixes. * [windows/mdi.c] Fix reversed LPARAM in WM_MDIACTIVATE. * [wine.ini] New option AllocSystemColors tells Wine how many colors to grab from the system colormap. * [objects/bitblt.c] [objects/dc.c] Fixed pink garbage over Word buttons in PseudoColor. Added optional DSTINVERT shortcut for faster text selection. * [misc/wsprintf.c] Skip bogus segmented pointers in wsvnprintf16(). * [objects/gdiobj.c] Added palette handling to UnrealizeObject(). * [objects/color.c] [objects/palette.c] [windows/dce.c] Wine gets palette manager with support for more than 20 colors. Only PseudoColor and TrueColor visuals tested so far. * [windows/winpos.c] [windows/win.c] Set X size hints for WS_EX_DLGMODALFRAME windows (no resize) and use XReconfigureWMWindows() instead of XConfigureWindow() in managed mode. * [memory/global.c] Do not allocate more than 640K of DOS memory. * [misc/main.c] Do not allow -desktop and -managed together.
1996-07-17 22:02:21 +02:00
Globals.hInstance, win);
Release 960506 Mon May 6 12:56:26 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [DEVELOPERS-HINTS] Added paragraph on naming conventions for Win16/Win32/Winelib. * [controls/menu.c] Create a default system menu that is the same for all windows instead of making a copy every time. * [include/wintypes.h] Added WINELIB_NAME and DECL_WINELIB_TYPE macros. Added xx16 and xx32 definitions for most types. General clean-up. * [memory/global.c] [memory/local.c] [*/*] Renamed Global and Local heap functions to xxx16. Added all xxx32 versions of the same functions. * [memory/selector.c] Mask out lower bits of selector in FreeSelector(). * [misc/lstr.c] Fixed wvsprintf(). * [windows/class.c] Changed the class structure to make Win32 support easier. * [windows/defwnd.c] Added handling of WM_INITMENUPOPUP for system menu to gray out invalid options. * [windows/winpos.c] Bug fix: the WINDOSPOS structure pointer in WM_NCCALCSIZE must be a SEGPTR. Sun May 5 03:51:26 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Implementation of moveable and (rudimentary) support for discardable local memory, plus several bug fixes. Sat May 4 18:33:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [include/windows.h] [windows/win.c] [if1632/user.spec] FindWindowEx() implemented (someone reported it was missing for FrameMaker 4.1). * [if1632/kernel32.spec] [if1632/user32.spec] [win32/memory.c] [win32/resource.c] Misc small stubs/small functions which bring win95 binaries further down the road. (IsBadCodePtr, LocalReAlloc,GetCursorPos) Small fix in WIN32_LoadAcceleratorsA. Fri May 3 19:43:12 1996 Frans van Dorsselaer <dorssel@rulhm1.LeidenUniv.nl> * [controls/edit.c] [controls/EDIT.TODO] Changed / fixed some types and typecasts. Fixed the scrollbar reset after WM_SETHANDLE / WM_SETTEXT. Added heap initialization in WM_CREATE. Fri May 3 19:30:02 1996 Greg Kreider <kreider@natlab.research.philips.com> * [controls/combo.c] [controls/listbox.c] Pass WM_[HV]SCROLL to listbox, but not combo. Don't try to redraw non-existant scroll bars (changes dwStyle flags). Combo box gets border. Combo box includes button (otherwise button won't trigger dropdown). Proper border around RectButton. Check size consistancy of combo, listbox, and button after resizing or before painting. These routines still aren't completely correct. Localize size checks in separate routines. Listboxes are white. Thu May 2 19:21:23 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/combo.c][include/commdlg.h][include/commdlg.c] [resources/sysres_De.rc][resources/sysres_En.rc] Introduced ChooseFont dialog, but needed some patches in handling of comboboxes with edit controls. Tue Apr 30 00:33:27 1996 Ulrich Schmid <uschmid@mail.hh.provi.de> * [programs/winhelp/*] Added a help viewer and a simple `.hlp' to `.sgml' converter. Mon Apr 29 14:17:57 1996 Tristan Tarrant <tst@sthinc.demon.co.uk> * [resources/sysres_*.rc] [misc/shell.c] Modified size of "About" dialog boxes. Sat Apr 27 18:10:11 Martin von Loewis <loewis@informatik.hu-berlin.de> * [if1632/Makefile.in][loader/builtin.c] crtdll.spec, ntdll.spec, wsock32.spec: new files. * [loader/pe_image.c] Fix error message if import by ordinal failed.
1996-05-06 18:06:24 +02:00
ShowWindow (hWnd, nCmdShow);
UpdateWindow (hWnd);
}
/***********************************************************************
*
* WINHELP_MainWndProc
*/
static LRESULT WINHELP_MainWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
WINHELP_WINDOW *win;
WINHELP_BUTTON *button;
RECT rect, button_box_rect;
INT text_top;
WINHELP_CheckPopup(msg);
switch (msg)
{
case WM_NCCREATE:
win = (WINHELP_WINDOW*) ((LPCREATESTRUCT) lParam)->lpCreateParams;
SetWindowLong(hWnd, 0, (LONG) win);
win->hMainWnd = hWnd;
break;
case WM_CREATE:
win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0);
/* Create button box and text Window */
CreateWindow(BUTTON_BOX_WIN_CLASS_NAME, "", WS_CHILD | WS_VISIBLE,
Release 960717 Wed Jul 17 16:10:16 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [configure.in] Generate include/config.h instead of putting everything on the command-line. Removed -with-malloc-debug option (not useful for end users anyway). Added check for memmove(). * [include/wintypes.h] [*/Makefile.in] Added definition of __WINE__ symbol when compiling Wine code (emulator or library) as opposed to user programs. * [debugger/editline.c] [debugger/readline/*] Moved all the readline code into debugger/editline.c. Removed the readline subdirectory. * [files/profile.c] Added PROFILE_GetWineIniInt(). * [include/stackframe.h] [loader/task.c] The 16-bit stackframe now also exists for Winelib (even though it only ever contains one frame). * [loader/module.c] Added function MODULE_CreateDummyModule() to create a dummy Win16 module for Winelib and Win32. * [memory/ldt.c] Make sure the ldt entry contents will be acceptable for the Linux kernel. * [memory/selector.c] Fixed SetSelectorLimit() when the limit is in pages. * [misc/port.c] Added memmove(). * [miscemu/dpmi.c] Clear the segment registers that contain the selector being freed in int31/ax=0001. Added missing break after SelectorAccessRights call. * [win32/struct32.c] Added conversions for MDICREATESTRUCT. * [windows/winproc.c] Added message conversions for WM_MDICREATE. Tue Jul 16 19:46:24 1996 Pavel Kankovsky <KAN@frode.dcit.cz> * [windows/class.c] Added GetExePtr() call in CLASS_FindClassByAtom(). Mon Jul 15 17:49:38 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [if1632/*.spec] Some more trivial specs added. * [if1632/gdi32.spec] [objects/font.c][windows/dialog.c] CreateFont32* added, changed to new naming std. * [include/windows.h] [include/mmsystem.h] [include/wintypes.h] Some defines/types added. * [win32/thread.c] TlsSetValue() returns boolean. * [win32/resource.c] [loader/pe_resource.c] [loader/resource.c] [controls/menu.c] [objects/bitmap.c] Cleanup of the resource functions, mostly changes to new naming standard and fixing of argument types so that they agree with the win16/win32 API. Thu Jul 11 15:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/winpos.c] ShowWindow() fixes. * [windows/mdi.c] Fix reversed LPARAM in WM_MDIACTIVATE. * [wine.ini] New option AllocSystemColors tells Wine how many colors to grab from the system colormap. * [objects/bitblt.c] [objects/dc.c] Fixed pink garbage over Word buttons in PseudoColor. Added optional DSTINVERT shortcut for faster text selection. * [misc/wsprintf.c] Skip bogus segmented pointers in wsvnprintf16(). * [objects/gdiobj.c] Added palette handling to UnrealizeObject(). * [objects/color.c] [objects/palette.c] [windows/dce.c] Wine gets palette manager with support for more than 20 colors. Only PseudoColor and TrueColor visuals tested so far. * [windows/winpos.c] [windows/win.c] Set X size hints for WS_EX_DLGMODALFRAME windows (no resize) and use XReconfigureWMWindows() instead of XConfigureWindow() in managed mode. * [memory/global.c] Do not allocate more than 640K of DOS memory. * [misc/main.c] Do not allow -desktop and -managed together.
1996-07-17 22:02:21 +02:00
0, 0, 0, 0, hWnd, 0, Globals.hInstance, win);
Release 960506 Mon May 6 12:56:26 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [DEVELOPERS-HINTS] Added paragraph on naming conventions for Win16/Win32/Winelib. * [controls/menu.c] Create a default system menu that is the same for all windows instead of making a copy every time. * [include/wintypes.h] Added WINELIB_NAME and DECL_WINELIB_TYPE macros. Added xx16 and xx32 definitions for most types. General clean-up. * [memory/global.c] [memory/local.c] [*/*] Renamed Global and Local heap functions to xxx16. Added all xxx32 versions of the same functions. * [memory/selector.c] Mask out lower bits of selector in FreeSelector(). * [misc/lstr.c] Fixed wvsprintf(). * [windows/class.c] Changed the class structure to make Win32 support easier. * [windows/defwnd.c] Added handling of WM_INITMENUPOPUP for system menu to gray out invalid options. * [windows/winpos.c] Bug fix: the WINDOSPOS structure pointer in WM_NCCALCSIZE must be a SEGPTR. Sun May 5 03:51:26 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Implementation of moveable and (rudimentary) support for discardable local memory, plus several bug fixes. Sat May 4 18:33:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [include/windows.h] [windows/win.c] [if1632/user.spec] FindWindowEx() implemented (someone reported it was missing for FrameMaker 4.1). * [if1632/kernel32.spec] [if1632/user32.spec] [win32/memory.c] [win32/resource.c] Misc small stubs/small functions which bring win95 binaries further down the road. (IsBadCodePtr, LocalReAlloc,GetCursorPos) Small fix in WIN32_LoadAcceleratorsA. Fri May 3 19:43:12 1996 Frans van Dorsselaer <dorssel@rulhm1.LeidenUniv.nl> * [controls/edit.c] [controls/EDIT.TODO] Changed / fixed some types and typecasts. Fixed the scrollbar reset after WM_SETHANDLE / WM_SETTEXT. Added heap initialization in WM_CREATE. Fri May 3 19:30:02 1996 Greg Kreider <kreider@natlab.research.philips.com> * [controls/combo.c] [controls/listbox.c] Pass WM_[HV]SCROLL to listbox, but not combo. Don't try to redraw non-existant scroll bars (changes dwStyle flags). Combo box gets border. Combo box includes button (otherwise button won't trigger dropdown). Proper border around RectButton. Check size consistancy of combo, listbox, and button after resizing or before painting. These routines still aren't completely correct. Localize size checks in separate routines. Listboxes are white. Thu May 2 19:21:23 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/combo.c][include/commdlg.h][include/commdlg.c] [resources/sysres_De.rc][resources/sysres_En.rc] Introduced ChooseFont dialog, but needed some patches in handling of comboboxes with edit controls. Tue Apr 30 00:33:27 1996 Ulrich Schmid <uschmid@mail.hh.provi.de> * [programs/winhelp/*] Added a help viewer and a simple `.hlp' to `.sgml' converter. Mon Apr 29 14:17:57 1996 Tristan Tarrant <tst@sthinc.demon.co.uk> * [resources/sysres_*.rc] [misc/shell.c] Modified size of "About" dialog boxes. Sat Apr 27 18:10:11 Martin von Loewis <loewis@informatik.hu-berlin.de> * [if1632/Makefile.in][loader/builtin.c] crtdll.spec, ntdll.spec, wsock32.spec: new files. * [loader/pe_image.c] Fix error message if import by ordinal failed.
1996-05-06 18:06:24 +02:00
CreateWindow(TEXT_WIN_CLASS_NAME, "", WS_CHILD | WS_VISIBLE,
Release 960717 Wed Jul 17 16:10:16 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [configure.in] Generate include/config.h instead of putting everything on the command-line. Removed -with-malloc-debug option (not useful for end users anyway). Added check for memmove(). * [include/wintypes.h] [*/Makefile.in] Added definition of __WINE__ symbol when compiling Wine code (emulator or library) as opposed to user programs. * [debugger/editline.c] [debugger/readline/*] Moved all the readline code into debugger/editline.c. Removed the readline subdirectory. * [files/profile.c] Added PROFILE_GetWineIniInt(). * [include/stackframe.h] [loader/task.c] The 16-bit stackframe now also exists for Winelib (even though it only ever contains one frame). * [loader/module.c] Added function MODULE_CreateDummyModule() to create a dummy Win16 module for Winelib and Win32. * [memory/ldt.c] Make sure the ldt entry contents will be acceptable for the Linux kernel. * [memory/selector.c] Fixed SetSelectorLimit() when the limit is in pages. * [misc/port.c] Added memmove(). * [miscemu/dpmi.c] Clear the segment registers that contain the selector being freed in int31/ax=0001. Added missing break after SelectorAccessRights call. * [win32/struct32.c] Added conversions for MDICREATESTRUCT. * [windows/winproc.c] Added message conversions for WM_MDICREATE. Tue Jul 16 19:46:24 1996 Pavel Kankovsky <KAN@frode.dcit.cz> * [windows/class.c] Added GetExePtr() call in CLASS_FindClassByAtom(). Mon Jul 15 17:49:38 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [if1632/*.spec] Some more trivial specs added. * [if1632/gdi32.spec] [objects/font.c][windows/dialog.c] CreateFont32* added, changed to new naming std. * [include/windows.h] [include/mmsystem.h] [include/wintypes.h] Some defines/types added. * [win32/thread.c] TlsSetValue() returns boolean. * [win32/resource.c] [loader/pe_resource.c] [loader/resource.c] [controls/menu.c] [objects/bitmap.c] Cleanup of the resource functions, mostly changes to new naming standard and fixing of argument types so that they agree with the win16/win32 API. Thu Jul 11 15:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/winpos.c] ShowWindow() fixes. * [windows/mdi.c] Fix reversed LPARAM in WM_MDIACTIVATE. * [wine.ini] New option AllocSystemColors tells Wine how many colors to grab from the system colormap. * [objects/bitblt.c] [objects/dc.c] Fixed pink garbage over Word buttons in PseudoColor. Added optional DSTINVERT shortcut for faster text selection. * [misc/wsprintf.c] Skip bogus segmented pointers in wsvnprintf16(). * [objects/gdiobj.c] Added palette handling to UnrealizeObject(). * [objects/color.c] [objects/palette.c] [windows/dce.c] Wine gets palette manager with support for more than 20 colors. Only PseudoColor and TrueColor visuals tested so far. * [windows/winpos.c] [windows/win.c] Set X size hints for WS_EX_DLGMODALFRAME windows (no resize) and use XReconfigureWMWindows() instead of XConfigureWindow() in managed mode. * [memory/global.c] Do not allocate more than 640K of DOS memory. * [misc/main.c] Do not allow -desktop and -managed together.
1996-07-17 22:02:21 +02:00
0, 0, 0, 0, hWnd, 0, Globals.hInstance, win);
Release 960506 Mon May 6 12:56:26 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [DEVELOPERS-HINTS] Added paragraph on naming conventions for Win16/Win32/Winelib. * [controls/menu.c] Create a default system menu that is the same for all windows instead of making a copy every time. * [include/wintypes.h] Added WINELIB_NAME and DECL_WINELIB_TYPE macros. Added xx16 and xx32 definitions for most types. General clean-up. * [memory/global.c] [memory/local.c] [*/*] Renamed Global and Local heap functions to xxx16. Added all xxx32 versions of the same functions. * [memory/selector.c] Mask out lower bits of selector in FreeSelector(). * [misc/lstr.c] Fixed wvsprintf(). * [windows/class.c] Changed the class structure to make Win32 support easier. * [windows/defwnd.c] Added handling of WM_INITMENUPOPUP for system menu to gray out invalid options. * [windows/winpos.c] Bug fix: the WINDOSPOS structure pointer in WM_NCCALCSIZE must be a SEGPTR. Sun May 5 03:51:26 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Implementation of moveable and (rudimentary) support for discardable local memory, plus several bug fixes. Sat May 4 18:33:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [include/windows.h] [windows/win.c] [if1632/user.spec] FindWindowEx() implemented (someone reported it was missing for FrameMaker 4.1). * [if1632/kernel32.spec] [if1632/user32.spec] [win32/memory.c] [win32/resource.c] Misc small stubs/small functions which bring win95 binaries further down the road. (IsBadCodePtr, LocalReAlloc,GetCursorPos) Small fix in WIN32_LoadAcceleratorsA. Fri May 3 19:43:12 1996 Frans van Dorsselaer <dorssel@rulhm1.LeidenUniv.nl> * [controls/edit.c] [controls/EDIT.TODO] Changed / fixed some types and typecasts. Fixed the scrollbar reset after WM_SETHANDLE / WM_SETTEXT. Added heap initialization in WM_CREATE. Fri May 3 19:30:02 1996 Greg Kreider <kreider@natlab.research.philips.com> * [controls/combo.c] [controls/listbox.c] Pass WM_[HV]SCROLL to listbox, but not combo. Don't try to redraw non-existant scroll bars (changes dwStyle flags). Combo box gets border. Combo box includes button (otherwise button won't trigger dropdown). Proper border around RectButton. Check size consistancy of combo, listbox, and button after resizing or before painting. These routines still aren't completely correct. Localize size checks in separate routines. Listboxes are white. Thu May 2 19:21:23 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/combo.c][include/commdlg.h][include/commdlg.c] [resources/sysres_De.rc][resources/sysres_En.rc] Introduced ChooseFont dialog, but needed some patches in handling of comboboxes with edit controls. Tue Apr 30 00:33:27 1996 Ulrich Schmid <uschmid@mail.hh.provi.de> * [programs/winhelp/*] Added a help viewer and a simple `.hlp' to `.sgml' converter. Mon Apr 29 14:17:57 1996 Tristan Tarrant <tst@sthinc.demon.co.uk> * [resources/sysres_*.rc] [misc/shell.c] Modified size of "About" dialog boxes. Sat Apr 27 18:10:11 Martin von Loewis <loewis@informatik.hu-berlin.de> * [if1632/Makefile.in][loader/builtin.c] crtdll.spec, ntdll.spec, wsock32.spec: new files. * [loader/pe_image.c] Fix error message if import by ordinal failed.
1996-05-06 18:06:24 +02:00
/* Fall through */
case WM_USER:
case WM_WINDOWPOSCHANGED:
win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0);
GetClientRect(hWnd, &rect);
/* Update button box and text Window */
SetWindowPos(win->hButtonBoxWnd, HWND_TOP,
rect.left, rect.top,
rect.right - rect.left,
rect.bottom - rect.top, 0);
GetWindowRect(win->hButtonBoxWnd, &button_box_rect);
text_top = rect.top + button_box_rect.bottom - button_box_rect.top;
SetWindowPos(win->hTextWnd, HWND_TOP,
rect.left, text_top,
rect.right - rect.left,
rect.bottom - text_top, 0);
break;
case WM_COMMAND:
Globals.active_win = win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0);
switch (wParam)
{
/* Menu FILE */
case WH_OPEN: MACRO_FileOpen(); break;
case WH_PRINT: MACRO_Print(); break;
case WH_PRINTER_SETUP: MACRO_PrinterSetup(); break;
case WH_EXIT: MACRO_Exit(); break;
/* Menu EDIT */
case WH_COPY_DIALOG: MACRO_CopyDialog(); break;
case WH_ANNOTATE: MACRO_Annotate(); break;
/* Menu Bookmark */
case WH_BOOKMARK_DEFINE: MACRO_BookmarkDefine(); break;
/* Menu Help */
case WH_HELP_ON_HELP: MACRO_HelpOn(); break;
case WH_HELP_ON_TOP: MACRO_HelpOnTop(); break;
/* Menu Info */
case WH_ABOUT: MACRO_About(); break;
#ifdef WINELIB
case WH_ABOUT_WINE:
ShellAbout(hWnd, "WINE", people, 0);
break;
#endif
default:
/* Buttons */
for (button = win->first_button; button; button = button->next)
if (wParam == button->wParam) break;
if (button)
MACRO_ExecuteMacro(button->lpszMacro);
else
WINHELP_MessageBoxIDS(IDS_NOT_IMPLEMENTED, IDS_ERROR, MB_OK);
break;
}
break;
}
return DefWindowProc (hWnd, msg, wParam, lParam);
}
/***********************************************************************
*
* WINHELP_ButtonBoxWndProc
*/
static LRESULT WINHELP_ButtonBoxWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
WINDOWPOS *winpos;
WINHELP_WINDOW *win;
WINHELP_BUTTON *button;
SIZE button_size;
INT x, y;
WINHELP_CheckPopup(msg);
switch(msg)
{
case WM_NCCREATE:
win = (WINHELP_WINDOW*) ((LPCREATESTRUCT) lParam)->lpCreateParams;
SetWindowLong(hWnd, 0, (LONG) win);
win->hButtonBoxWnd = hWnd;
break;
case WM_WINDOWPOSCHANGING:
winpos = (WINDOWPOS*) lParam;
win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0);
/* Update buttons */
button_size.cx = 0;
button_size.cy = 0;
for (button = win->first_button; button; button = button->next)
{
HDC hDc;
SIZE textsize;
if (!button->hWnd)
button->hWnd = CreateWindow(STRING_BUTTON, (LPSTR) button->lpszName,
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
0, 0, 0, 0,
hWnd, (HMENU) button->wParam,
Globals.hInstance, 0);
hDc = GetDC(button->hWnd);
GetTextExtentPoint(hDc, button->lpszName,
lstrlen(button->lpszName), &textsize);
ReleaseDC(button->hWnd, hDc);
button_size.cx = MAX(button_size.cx, textsize.cx + BUTTON_CX);
button_size.cy = MAX(button_size.cy, textsize.cy + BUTTON_CY);
}
x = 0;
y = 0;
for (button = win->first_button; button; button = button->next)
{
SetWindowPos(button->hWnd, HWND_TOP, x, y, button_size.cx, button_size.cy, 0);
if (x + 2 * button_size.cx <= winpos->cx)
x += button_size.cx;
else
x = 0, y += button_size.cy;
}
winpos->cy = y + (x ? button_size.cy : 0);
break;
case WM_COMMAND:
SendMessage(GetParent(hWnd), msg, wParam, lParam);
break;
}
return(DefWindowProc(hWnd, msg, wParam, lParam));
}
/***********************************************************************
*
* WINHELP_TextWndProc
*/
static LRESULT WINHELP_TextWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
WINHELP_WINDOW *win;
WINHELP_LINE *line;
WINHELP_LINE_PART *part;
WINDOWPOS *winpos;
PAINTSTRUCT ps;
HDC hDc;
POINT mouse;
INT scroll_pos;
HWND hPopupWnd;
BOOL bExit;
if (msg != WM_LBUTTONDOWN)
WINHELP_CheckPopup(msg);
switch (msg)
{
case WM_NCCREATE:
win = (WINHELP_WINDOW*) ((LPCREATESTRUCT) lParam)->lpCreateParams;
SetWindowLong(hWnd, 0, (LONG) win);
win->hTextWnd = hWnd;
if (!win->lpszName) Globals.hPopupWnd = win->hMainWnd = hWnd;
WINHELP_InitFonts(hWnd);
break;
case WM_CREATE:
win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0);
/* Calculate vertical size and position of a popup window */
if (!win->lpszName)
{
POINT origin;
RECT old_window_rect;
RECT old_client_rect;
SIZE old_window_size;
SIZE old_client_size;
SIZE new_client_size;
SIZE new_window_size;
GetWindowRect(hWnd, &old_window_rect);
origin.x = old_window_rect.left;
origin.y = old_window_rect.top;
old_window_size.cx = old_window_rect.right - old_window_rect.left;
old_window_size.cy = old_window_rect.bottom - old_window_rect.top;
GetClientRect(hWnd, &old_client_rect);
old_client_size.cx = old_client_rect.right - old_client_rect.left;
old_client_size.cy = old_client_rect.bottom - old_client_rect.top;
new_client_size = old_client_size;
WINHELP_SplitLines(hWnd, &new_client_size);
if (origin.y + POPUP_YDISTANCE + new_client_size.cy <= GetSystemMetrics(SM_CYSCREEN))
origin.y += POPUP_YDISTANCE;
else
origin.y -= POPUP_YDISTANCE + new_client_size.cy;
new_window_size.cx = old_window_size.cx - old_client_size.cx + new_client_size.cx;
new_window_size.cy = old_window_size.cy - old_client_size.cy + new_client_size.cy;
win->hShadowWnd =
CreateWindow(SHADOW_WIN_CLASS_NAME, "", WS_POPUP | WS_VISIBLE,
origin.x + SHADOW_DX, origin.y + SHADOW_DY,
new_window_size.cx, new_window_size.cy,
0, 0, Globals.hInstance, 0);
SetWindowPos(hWnd, HWND_TOP, origin.x, origin.y,
new_window_size.cx, new_window_size.cy,
SWP_NOZORDER | SWP_NOACTIVATE);
ShowWindow(win->hShadowWnd, SW_NORMAL);
}
break;
case WM_WINDOWPOSCHANGED:
winpos = (WINDOWPOS*) lParam;
if (!(winpos->flags & SWP_NOSIZE)) WINHELP_SetupText(hWnd);
break;
case WM_VSCROLL:
{
Release 960521 Tue May 21 14:06:07 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] Made ButtonWndProc a 32-bit window procedure. * [controls/desktop.c] Made DesktopWndProc a 32-bit window procedure. Added handling of WM_SETCURSOR. * [controls/menu.c] Allocate menu items and strings on the 32-bit system heap. Implemented Win32 versions for ChangeMenu, InsertMenu, ModifyMenu, AppendMenu and LoadMenuIndirect. * [controls/widgets.c] Added possibility to have 32-bit built-in classes. * [files/drive.c] Implemented GetLogicalDrive() and GetLogicalDriveStrings(). * [misc/spy.c] [include/spy.h] Added support for spying Win32 messages. * [loader/builtin.c] Fixed bug in -dll option parsing. * [memory/local.c] Added back the change by Huw D. M. Davies to free the block in LocalRealloc() before allocating the new one. * [objects/bitmap.c] [objects/cursoricon.c] [objects/oembitmap.c] Fixed bug in bitmap size that caused memory corruption for 24bpp. * [windows/defwnd.c] Implemented Win32 version of DefWindowProc(). * [windows/dialog.c] Implemented Win32 version of SendDlgItemMessage, Get/SetDlgItemText and Get/SetDlgItemInt. * [windows/mdi.c] Implemented Win32 version of DefFrameProc() and DefMDIChildProc(). Don't make a copy of the OBM bitmaps for every MDI window. * [windows/message.c] Implemented Win32 version of SendMessage(). * [windows/winproc.c] [windows/class.c] [windows/win.c] New scheme for 32-bit window procedures to replace aliases. All 32-bit window procedure get a 16-bit address pointing to a WINDOWPROC structure. Implemented Ansi<->Unicode translation for CallWindowProc(). Added translation of WM_DRAWITEM between Win16 and Win32. * [windows/win.c] [include/callback.h] Added ugly hack to build CREATESTRUCT on the stack when sending WM_NCCREATE. Implemented Win32 version of Get/SetWindowWord/Long and Get/SetWindowText. Fri May 17 10:20:16 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/button.c] Avoid gray text on gray background in disabled push buttons using a b/w raster and some raster operations (PatBlt,BitBlt). * [objects/text.c] DrawText(): don't draw an underbar anymore if DT_CALCRECT is set.
1996-05-21 17:01:41 +02:00
BOOL update = TRUE;
RECT rect;
INT16 Min, Max;
INT CurPos = GetScrollPos(hWnd, SB_VERT);
Release 960506 Mon May 6 12:56:26 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [DEVELOPERS-HINTS] Added paragraph on naming conventions for Win16/Win32/Winelib. * [controls/menu.c] Create a default system menu that is the same for all windows instead of making a copy every time. * [include/wintypes.h] Added WINELIB_NAME and DECL_WINELIB_TYPE macros. Added xx16 and xx32 definitions for most types. General clean-up. * [memory/global.c] [memory/local.c] [*/*] Renamed Global and Local heap functions to xxx16. Added all xxx32 versions of the same functions. * [memory/selector.c] Mask out lower bits of selector in FreeSelector(). * [misc/lstr.c] Fixed wvsprintf(). * [windows/class.c] Changed the class structure to make Win32 support easier. * [windows/defwnd.c] Added handling of WM_INITMENUPOPUP for system menu to gray out invalid options. * [windows/winpos.c] Bug fix: the WINDOSPOS structure pointer in WM_NCCALCSIZE must be a SEGPTR. Sun May 5 03:51:26 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Implementation of moveable and (rudimentary) support for discardable local memory, plus several bug fixes. Sat May 4 18:33:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [include/windows.h] [windows/win.c] [if1632/user.spec] FindWindowEx() implemented (someone reported it was missing for FrameMaker 4.1). * [if1632/kernel32.spec] [if1632/user32.spec] [win32/memory.c] [win32/resource.c] Misc small stubs/small functions which bring win95 binaries further down the road. (IsBadCodePtr, LocalReAlloc,GetCursorPos) Small fix in WIN32_LoadAcceleratorsA. Fri May 3 19:43:12 1996 Frans van Dorsselaer <dorssel@rulhm1.LeidenUniv.nl> * [controls/edit.c] [controls/EDIT.TODO] Changed / fixed some types and typecasts. Fixed the scrollbar reset after WM_SETHANDLE / WM_SETTEXT. Added heap initialization in WM_CREATE. Fri May 3 19:30:02 1996 Greg Kreider <kreider@natlab.research.philips.com> * [controls/combo.c] [controls/listbox.c] Pass WM_[HV]SCROLL to listbox, but not combo. Don't try to redraw non-existant scroll bars (changes dwStyle flags). Combo box gets border. Combo box includes button (otherwise button won't trigger dropdown). Proper border around RectButton. Check size consistancy of combo, listbox, and button after resizing or before painting. These routines still aren't completely correct. Localize size checks in separate routines. Listboxes are white. Thu May 2 19:21:23 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/combo.c][include/commdlg.h][include/commdlg.c] [resources/sysres_De.rc][resources/sysres_En.rc] Introduced ChooseFont dialog, but needed some patches in handling of comboboxes with edit controls. Tue Apr 30 00:33:27 1996 Ulrich Schmid <uschmid@mail.hh.provi.de> * [programs/winhelp/*] Added a help viewer and a simple `.hlp' to `.sgml' converter. Mon Apr 29 14:17:57 1996 Tristan Tarrant <tst@sthinc.demon.co.uk> * [resources/sysres_*.rc] [misc/shell.c] Modified size of "About" dialog boxes. Sat Apr 27 18:10:11 Martin von Loewis <loewis@informatik.hu-berlin.de> * [if1632/Makefile.in][loader/builtin.c] crtdll.spec, ntdll.spec, wsock32.spec: new files. * [loader/pe_image.c] Fix error message if import by ordinal failed.
1996-05-06 18:06:24 +02:00
GetScrollRange(hWnd, SB_VERT, &Min, &Max);
GetClientRect(hWnd, &rect);
switch (wParam & 0xffff)
{
case SB_THUMBTRACK:
case SB_THUMBPOSITION: CurPos = wParam >> 16; break;
case SB_TOP: CurPos = Min; break;
case SB_BOTTOM: CurPos = Max; break;
case SB_PAGEUP: CurPos -= (rect.bottom - rect.top) / 2; break;
case SB_PAGEDOWN: CurPos += (rect.bottom - rect.top) / 2; break;
case SB_LINEUP: CurPos -= GetSystemMetrics(SM_CXVSCROLL); break;
case SB_LINEDOWN: CurPos += GetSystemMetrics(SM_CXVSCROLL); break;
default: update = FALSE;
}
if (update)
{
INT dy = GetScrollPos(hWnd, SB_VERT) - CurPos;
SetScrollPos(hWnd, SB_VERT, CurPos, TRUE);
ScrollWindow(hWnd, 0, dy, NULL, NULL);
UpdateWindow(hWnd);
}
}
break;
case WM_PAINT:
hDc = BeginPaint (hWnd, &ps);
win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0);
scroll_pos = GetScrollPos(hWnd, SB_VERT);
for (line = win->first_line; line; line = line->next)
for (part = &line->first_part; part; part = part->next)
{
SelectObject(hDc, part->hFont);
SetTextColor(hDc, part->color);
TextOut(hDc, part->rect.left, part->rect.top - scroll_pos,
(LPSTR) part->lpsText, part->wTextLen);
}
EndPaint (hWnd, &ps);
break;
case WM_LBUTTONDOWN:
win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0);
scroll_pos = GetScrollPos(hWnd, SB_VERT);
hPopupWnd = Globals.hPopupWnd;
Globals.hPopupWnd = 0;
mouse.x = LOWORD(lParam);
mouse.y = HIWORD(lParam);
for (line = win->first_line; line; line = line->next)
for (part = &line->first_part; part; part = part->next)
if (part->link.lpszPath &&
part->rect.left <= mouse.x &&
part->rect.right >= mouse.x &&
part->rect.top <= mouse.y + scroll_pos &&
part->rect.bottom >= mouse.y + scroll_pos)
WINHELP_CreateHelpWindow(part->link.lpszPath, part->link.lHash, NULL,
part->link.bPopup, hWnd, &mouse, SW_NORMAL);
if (hPopupWnd)
DestroyWindow(hPopupWnd);
break;
case WM_NCDESTROY:
win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0);
if (hWnd == Globals.hPopupWnd) Globals.hPopupWnd = 0;
bExit = (Globals.wVersion >= 4 && !lstrcmpi(win->lpszName, "main"));
WINHELP_DeleteWindow(win);
if (bExit) MACRO_Exit();
if (!Globals.win_list)
PostQuitMessage (0);
break;
}
return DefWindowProc (hWnd, msg, wParam, lParam);
}
/***********************************************************************
*
* SetupText
*/
static VOID WINHELP_SetupText(HWND hWnd)
{
HDC hDc = GetDC(hWnd);
RECT rect;
SIZE newsize;
ShowScrollBar(hWnd, SB_VERT, FALSE);
if (!WINHELP_SplitLines(hWnd, NULL))
{
ShowScrollBar(hWnd, SB_VERT, TRUE);
GetClientRect(hWnd, &rect);
WINHELP_SplitLines(hWnd, &newsize);
SetScrollRange(hWnd, SB_VERT, 0, rect.top + newsize.cy - rect.bottom, TRUE);
}
else SetScrollPos(hWnd, SB_VERT, 0, FALSE);
ReleaseDC(hWnd, hDc);
}
/***********************************************************************
*
* WINHELP_SplitLines
*/
static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize)
{
WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0);
HLPFILE_PARAGRAPH *p;
WINHELP_LINE **line = &win->first_line;
WINHELP_LINE_PART **part = 0;
INT line_ascent = 0;
SIZE space;
RECT rect;
HDC hDc;
if (newsize) newsize->cx = newsize->cy = 0;
if (!win->page) return TRUE;
WINHELP_DeleteLines(win);
GetClientRect(hWnd, &rect);
rect.top += INTERNAL_BORDER_WIDTH;
rect.left += INTERNAL_BORDER_WIDTH;
rect.right -= INTERNAL_BORDER_WIDTH;
rect.bottom -= INTERNAL_BORDER_WIDTH;
space.cy = rect.top;
space.cx = rect.left;
hDc = GetDC(hWnd);
for (p = win->page->first_paragraph; p; p = p->next)
{
TEXTMETRIC tm;
SIZE textsize = {0, 0};
LPCSTR text = p->lpszText;
UINT len = strlen(text);
UINT indent = 0;
UINT wFont = (p->wFont < win->fonts_len) ? p->wFont : 0;
BOOL bUnderline = p->link && !p->link->bPopup;
HFONT hFont = win->fonts[wFont][bUnderline ? 1 : 0];
COLORREF color = RGB(0, 0, 0);
if (p->link) color = RGB(0, 0x80, 0);
if (p->bDebug) color = RGB(0xff, 0, 0);
SelectObject(hDc, hFont);
GetTextMetrics (hDc, &tm);
if (p->wIndent)
{
indent = p->wIndent * 5 * tm.tmAveCharWidth;
if (!part)
space.cx = rect.left + indent - 2 * tm.tmAveCharWidth;
}
if (p->wVSpace)
{
part = 0;
space.cx = rect.left + indent;
space.cy += (p->wVSpace - 1) * tm.tmHeight;
}
if (p->wHSpace)
{
space.cx += p->wHSpace * 2 * tm.tmAveCharWidth;
}
while (len)
{
INT free_width = rect.right - (part ? (*line)->rect.right : rect.left) - space.cx;
Release 960521 Tue May 21 14:06:07 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] Made ButtonWndProc a 32-bit window procedure. * [controls/desktop.c] Made DesktopWndProc a 32-bit window procedure. Added handling of WM_SETCURSOR. * [controls/menu.c] Allocate menu items and strings on the 32-bit system heap. Implemented Win32 versions for ChangeMenu, InsertMenu, ModifyMenu, AppendMenu and LoadMenuIndirect. * [controls/widgets.c] Added possibility to have 32-bit built-in classes. * [files/drive.c] Implemented GetLogicalDrive() and GetLogicalDriveStrings(). * [misc/spy.c] [include/spy.h] Added support for spying Win32 messages. * [loader/builtin.c] Fixed bug in -dll option parsing. * [memory/local.c] Added back the change by Huw D. M. Davies to free the block in LocalRealloc() before allocating the new one. * [objects/bitmap.c] [objects/cursoricon.c] [objects/oembitmap.c] Fixed bug in bitmap size that caused memory corruption for 24bpp. * [windows/defwnd.c] Implemented Win32 version of DefWindowProc(). * [windows/dialog.c] Implemented Win32 version of SendDlgItemMessage, Get/SetDlgItemText and Get/SetDlgItemInt. * [windows/mdi.c] Implemented Win32 version of DefFrameProc() and DefMDIChildProc(). Don't make a copy of the OBM bitmaps for every MDI window. * [windows/message.c] Implemented Win32 version of SendMessage(). * [windows/winproc.c] [windows/class.c] [windows/win.c] New scheme for 32-bit window procedures to replace aliases. All 32-bit window procedure get a 16-bit address pointing to a WINDOWPROC structure. Implemented Ansi<->Unicode translation for CallWindowProc(). Added translation of WM_DRAWITEM between Win16 and Win32. * [windows/win.c] [include/callback.h] Added ugly hack to build CREATESTRUCT on the stack when sending WM_NCCREATE. Implemented Win32 version of Get/SetWindowWord/Long and Get/SetWindowText. Fri May 17 10:20:16 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/button.c] Avoid gray text on gray background in disabled push buttons using a b/w raster and some raster operations (PatBlt,BitBlt). * [objects/text.c] DrawText(): don't draw an underbar anymore if DT_CALCRECT is set.
1996-05-21 17:01:41 +02:00
UINT low = 0, curr = len, high = len, textlen = 0;
Release 960506 Mon May 6 12:56:26 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [DEVELOPERS-HINTS] Added paragraph on naming conventions for Win16/Win32/Winelib. * [controls/menu.c] Create a default system menu that is the same for all windows instead of making a copy every time. * [include/wintypes.h] Added WINELIB_NAME and DECL_WINELIB_TYPE macros. Added xx16 and xx32 definitions for most types. General clean-up. * [memory/global.c] [memory/local.c] [*/*] Renamed Global and Local heap functions to xxx16. Added all xxx32 versions of the same functions. * [memory/selector.c] Mask out lower bits of selector in FreeSelector(). * [misc/lstr.c] Fixed wvsprintf(). * [windows/class.c] Changed the class structure to make Win32 support easier. * [windows/defwnd.c] Added handling of WM_INITMENUPOPUP for system menu to gray out invalid options. * [windows/winpos.c] Bug fix: the WINDOSPOS structure pointer in WM_NCCALCSIZE must be a SEGPTR. Sun May 5 03:51:26 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Implementation of moveable and (rudimentary) support for discardable local memory, plus several bug fixes. Sat May 4 18:33:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [include/windows.h] [windows/win.c] [if1632/user.spec] FindWindowEx() implemented (someone reported it was missing for FrameMaker 4.1). * [if1632/kernel32.spec] [if1632/user32.spec] [win32/memory.c] [win32/resource.c] Misc small stubs/small functions which bring win95 binaries further down the road. (IsBadCodePtr, LocalReAlloc,GetCursorPos) Small fix in WIN32_LoadAcceleratorsA. Fri May 3 19:43:12 1996 Frans van Dorsselaer <dorssel@rulhm1.LeidenUniv.nl> * [controls/edit.c] [controls/EDIT.TODO] Changed / fixed some types and typecasts. Fixed the scrollbar reset after WM_SETHANDLE / WM_SETTEXT. Added heap initialization in WM_CREATE. Fri May 3 19:30:02 1996 Greg Kreider <kreider@natlab.research.philips.com> * [controls/combo.c] [controls/listbox.c] Pass WM_[HV]SCROLL to listbox, but not combo. Don't try to redraw non-existant scroll bars (changes dwStyle flags). Combo box gets border. Combo box includes button (otherwise button won't trigger dropdown). Proper border around RectButton. Check size consistancy of combo, listbox, and button after resizing or before painting. These routines still aren't completely correct. Localize size checks in separate routines. Listboxes are white. Thu May 2 19:21:23 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/combo.c][include/commdlg.h][include/commdlg.c] [resources/sysres_De.rc][resources/sysres_En.rc] Introduced ChooseFont dialog, but needed some patches in handling of comboboxes with edit controls. Tue Apr 30 00:33:27 1996 Ulrich Schmid <uschmid@mail.hh.provi.de> * [programs/winhelp/*] Added a help viewer and a simple `.hlp' to `.sgml' converter. Mon Apr 29 14:17:57 1996 Tristan Tarrant <tst@sthinc.demon.co.uk> * [resources/sysres_*.rc] [misc/shell.c] Modified size of "About" dialog boxes. Sat Apr 27 18:10:11 Martin von Loewis <loewis@informatik.hu-berlin.de> * [if1632/Makefile.in][loader/builtin.c] crtdll.spec, ntdll.spec, wsock32.spec: new files. * [loader/pe_image.c] Fix error message if import by ordinal failed.
1996-05-06 18:06:24 +02:00
if (free_width > 0)
{
while (1)
{
GetTextExtentPoint(hDc, text, curr, &textsize);
if (textsize.cx <= free_width) low = curr;
else high = curr;
if (high <= low + 1) break;
if (textsize.cx) curr = (curr * free_width) / textsize.cx;
Release 960521 Tue May 21 14:06:07 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] Made ButtonWndProc a 32-bit window procedure. * [controls/desktop.c] Made DesktopWndProc a 32-bit window procedure. Added handling of WM_SETCURSOR. * [controls/menu.c] Allocate menu items and strings on the 32-bit system heap. Implemented Win32 versions for ChangeMenu, InsertMenu, ModifyMenu, AppendMenu and LoadMenuIndirect. * [controls/widgets.c] Added possibility to have 32-bit built-in classes. * [files/drive.c] Implemented GetLogicalDrive() and GetLogicalDriveStrings(). * [misc/spy.c] [include/spy.h] Added support for spying Win32 messages. * [loader/builtin.c] Fixed bug in -dll option parsing. * [memory/local.c] Added back the change by Huw D. M. Davies to free the block in LocalRealloc() before allocating the new one. * [objects/bitmap.c] [objects/cursoricon.c] [objects/oembitmap.c] Fixed bug in bitmap size that caused memory corruption for 24bpp. * [windows/defwnd.c] Implemented Win32 version of DefWindowProc(). * [windows/dialog.c] Implemented Win32 version of SendDlgItemMessage, Get/SetDlgItemText and Get/SetDlgItemInt. * [windows/mdi.c] Implemented Win32 version of DefFrameProc() and DefMDIChildProc(). Don't make a copy of the OBM bitmaps for every MDI window. * [windows/message.c] Implemented Win32 version of SendMessage(). * [windows/winproc.c] [windows/class.c] [windows/win.c] New scheme for 32-bit window procedures to replace aliases. All 32-bit window procedure get a 16-bit address pointing to a WINDOWPROC structure. Implemented Ansi<->Unicode translation for CallWindowProc(). Added translation of WM_DRAWITEM between Win16 and Win32. * [windows/win.c] [include/callback.h] Added ugly hack to build CREATESTRUCT on the stack when sending WM_NCCREATE. Implemented Win32 version of Get/SetWindowWord/Long and Get/SetWindowText. Fri May 17 10:20:16 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/button.c] Avoid gray text on gray background in disabled push buttons using a b/w raster and some raster operations (PatBlt,BitBlt). * [objects/text.c] DrawText(): don't draw an underbar anymore if DT_CALCRECT is set.
1996-05-21 17:01:41 +02:00
if (curr <= low) curr = low + 1;
Release 960506 Mon May 6 12:56:26 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [DEVELOPERS-HINTS] Added paragraph on naming conventions for Win16/Win32/Winelib. * [controls/menu.c] Create a default system menu that is the same for all windows instead of making a copy every time. * [include/wintypes.h] Added WINELIB_NAME and DECL_WINELIB_TYPE macros. Added xx16 and xx32 definitions for most types. General clean-up. * [memory/global.c] [memory/local.c] [*/*] Renamed Global and Local heap functions to xxx16. Added all xxx32 versions of the same functions. * [memory/selector.c] Mask out lower bits of selector in FreeSelector(). * [misc/lstr.c] Fixed wvsprintf(). * [windows/class.c] Changed the class structure to make Win32 support easier. * [windows/defwnd.c] Added handling of WM_INITMENUPOPUP for system menu to gray out invalid options. * [windows/winpos.c] Bug fix: the WINDOSPOS structure pointer in WM_NCCALCSIZE must be a SEGPTR. Sun May 5 03:51:26 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Implementation of moveable and (rudimentary) support for discardable local memory, plus several bug fixes. Sat May 4 18:33:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [include/windows.h] [windows/win.c] [if1632/user.spec] FindWindowEx() implemented (someone reported it was missing for FrameMaker 4.1). * [if1632/kernel32.spec] [if1632/user32.spec] [win32/memory.c] [win32/resource.c] Misc small stubs/small functions which bring win95 binaries further down the road. (IsBadCodePtr, LocalReAlloc,GetCursorPos) Small fix in WIN32_LoadAcceleratorsA. Fri May 3 19:43:12 1996 Frans van Dorsselaer <dorssel@rulhm1.LeidenUniv.nl> * [controls/edit.c] [controls/EDIT.TODO] Changed / fixed some types and typecasts. Fixed the scrollbar reset after WM_SETHANDLE / WM_SETTEXT. Added heap initialization in WM_CREATE. Fri May 3 19:30:02 1996 Greg Kreider <kreider@natlab.research.philips.com> * [controls/combo.c] [controls/listbox.c] Pass WM_[HV]SCROLL to listbox, but not combo. Don't try to redraw non-existant scroll bars (changes dwStyle flags). Combo box gets border. Combo box includes button (otherwise button won't trigger dropdown). Proper border around RectButton. Check size consistancy of combo, listbox, and button after resizing or before painting. These routines still aren't completely correct. Localize size checks in separate routines. Listboxes are white. Thu May 2 19:21:23 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/combo.c][include/commdlg.h][include/commdlg.c] [resources/sysres_De.rc][resources/sysres_En.rc] Introduced ChooseFont dialog, but needed some patches in handling of comboboxes with edit controls. Tue Apr 30 00:33:27 1996 Ulrich Schmid <uschmid@mail.hh.provi.de> * [programs/winhelp/*] Added a help viewer and a simple `.hlp' to `.sgml' converter. Mon Apr 29 14:17:57 1996 Tristan Tarrant <tst@sthinc.demon.co.uk> * [resources/sysres_*.rc] [misc/shell.c] Modified size of "About" dialog boxes. Sat Apr 27 18:10:11 Martin von Loewis <loewis@informatik.hu-berlin.de> * [if1632/Makefile.in][loader/builtin.c] crtdll.spec, ntdll.spec, wsock32.spec: new files. * [loader/pe_image.c] Fix error message if import by ordinal failed.
1996-05-06 18:06:24 +02:00
else if (curr >= high) curr = high - 1;
}
textlen = low;
while (textlen && text[textlen] && text[textlen] != ' ') textlen--;
}
if (!part && !textlen) textlen = MAX(low, 1);
if (free_width <= 0 || !textlen)
{
part = 0;
space.cx = rect.left + indent;
space.cx = MIN(space.cx, rect.right - rect.left - 1);
continue;
}
if (!WINHELP_AppendText(&line, &part, &space, &textsize,
&line_ascent, tm.tmAscent,
text, textlen, hFont, color, p->link) ||
(!newsize && (*line)->rect.bottom > rect.bottom))
{
ReleaseDC(hWnd, hDc);
return FALSE;
}
if (newsize)
newsize->cx = MAX(newsize->cx, (*line)->rect.right + INTERNAL_BORDER_WIDTH);
len -= textlen;
text += textlen;
if (text[0] == ' ') text++, len--;
}
}
if (newsize)
newsize->cy = (*line)->rect.bottom + INTERNAL_BORDER_WIDTH;
ReleaseDC(hWnd, hDc);
return TRUE;
}
/***********************************************************************
*
* WINHELP_AppendText
*/
static BOOL WINHELP_AppendText(WINHELP_LINE ***linep, WINHELP_LINE_PART ***partp,
LPSIZE space, LPSIZE textsize,
INT *line_ascent, INT ascent,
LPCSTR text, UINT textlen,
HFONT font, COLORREF color, HLPFILE_LINK *link)
{
HGLOBAL handle;
WINHELP_LINE *line;
WINHELP_LINE_PART *part;
LPSTR ptr;
if (!*partp) /* New line */
{
*line_ascent = ascent;
handle = GlobalAlloc(GMEM_FIXED, sizeof(WINHELP_LINE) + textlen +
(link ? lstrlen(link->lpszPath) + 1 : 0));
if (!handle) return FALSE;
line = GlobalLock(handle);
line->next = 0;
part = &line->first_part;
ptr = GlobalLock(handle);
ptr += sizeof(WINHELP_LINE);
line->rect.top = (**linep ? (**linep)->rect.bottom : 0) + space->cy;
line->rect.bottom = line->rect.top;
line->rect.left = space->cx;
line->rect.right = space->cx;
if (**linep) *linep = &(**linep)->next;
**linep = line;
space->cy = 0;
}
else /* Same line */
{
line = **linep;
if (*line_ascent < ascent)
{
WINHELP_LINE_PART *p;
for (p = &line->first_part; p; p = p->next)
{
p->rect.top += ascent - *line_ascent;
p->rect.bottom += ascent - *line_ascent;
}
line->rect.bottom += ascent - *line_ascent;
*line_ascent = ascent;
}
handle = GlobalAlloc(GMEM_FIXED, sizeof(WINHELP_LINE_PART) + textlen +
(link ? lstrlen(link->lpszPath) + 1 : 0));
if (!handle) return FALSE;
part = GlobalLock(handle);
**partp = part;
ptr = GlobalLock(handle);
ptr += sizeof(WINHELP_LINE_PART);
}
hmemcpy(ptr, text, textlen);
part->rect.left = line->rect.right + (*partp ? space->cx : 0);
part->rect.right = part->rect.left + textsize->cx;
line->rect.right = part->rect.right;
part->rect.top =
((*partp) ? line->rect.top : line->rect.bottom) + *line_ascent - ascent;
part->rect.bottom = part->rect.top + textsize->cy;
line->rect.bottom = MAX(line->rect.bottom, part->rect.bottom);
part->hSelf = handle;
part->lpsText = ptr;
part->wTextLen = textlen;
part->hFont = font;
part->color = color;
if (link)
{
strcpy(ptr + textlen, link->lpszPath);
part->link.lpszPath = ptr + textlen;
part->link.lHash = link->lHash;
part->link.bPopup = link->bPopup;
}
else part->link.lpszPath = 0;
part->next = 0;
*partp = &part->next;
space->cx = 0;
return TRUE;
}
/***********************************************************************
*
* WINHELP_CheckPopup
*/
static VOID WINHELP_CheckPopup(UINT msg)
{
if (!Globals.hPopupWnd) return;
switch (msg)
{
case WM_COMMAND:
case WM_LBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN:
case WM_NCLBUTTONDOWN:
case WM_NCMBUTTONDOWN:
case WM_NCRBUTTONDOWN:
DestroyWindow(Globals.hPopupWnd);
Globals.hPopupWnd = 0;
}
}
/***********************************************************************
*
* WINHELP_DeleteLines
*/
static VOID WINHELP_DeleteLines(WINHELP_WINDOW *win)
{
WINHELP_LINE *line, *next_line;
WINHELP_LINE_PART *part, *next_part;
for(line = win->first_line; line; line = next_line)
{
next_line = line->next;
for(part = &line->first_part; part; part = next_part)
{
next_part = part->next;
GlobalFree(part->hSelf);
}
}
win->first_line = 0;
}
/***********************************************************************
*
* WINHELP_DeleteWindow
*/
static VOID WINHELP_DeleteWindow(WINHELP_WINDOW *win)
{
WINHELP_WINDOW **w;
for (w = &Globals.win_list; *w; w = &(*w)->next)
if (*w == win)
{
*w = win->next;
break;
}
if (win->hShadowWnd) DestroyWindow(win->hShadowWnd);
HLPFILE_FreeHlpFilePage(win->page);
WINHELP_DeleteLines(win);
GlobalFree(win->hSelf);
}
/***********************************************************************
*
* WINHELP_InitFonts
*/
static VOID WINHELP_InitFonts(HWND hWnd)
{
WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0);
LOGFONT logfontlist[] = {
{-10, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"},
{-12, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"},
{-12, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"},
{-12, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"},
{-12, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"},
{-10, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"},
{ -8, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}};
#define FONTS_LEN (sizeof(logfontlist)/sizeof(*logfontlist))
static HFONT fonts[FONTS_LEN][2];
static BOOL init = 0;
win->fonts_len = FONTS_LEN;
win->fonts = fonts;
if (!init)
{
INT i;
for(i = 0; i < FONTS_LEN; i++)
{
LOGFONT logfont = logfontlist[i];
fonts[i][0] = CreateFontIndirect(&logfont);
logfont.lfUnderline = 1;
fonts[i][1] = CreateFontIndirect(&logfont);
}
init = 1;
}
}
/***********************************************************************
*
* WINHELP_MessageBoxIDS
*/
INT WINHELP_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type)
{
CHAR text[MAX_STRING_LEN];
CHAR title[MAX_STRING_LEN];
LoadString(Globals.hInstance, ids_text, text, sizeof(text));
LoadString(Globals.hInstance, ids_title, title, sizeof(title));
return(MessageBox(0, text, title, type));
}
/***********************************************************************
*
* MAIN_MessageBoxIDS_s
*/
INT WINHELP_MessageBoxIDS_s(UINT ids_text, LPCSTR str, UINT ids_title, WORD type)
{
CHAR text[MAX_STRING_LEN];
CHAR title[MAX_STRING_LEN];
CHAR newtext[MAX_STRING_LEN + MAX_PATHNAME_LEN];
LoadString(Globals.hInstance, ids_text, text, sizeof(text));
LoadString(Globals.hInstance, ids_title, title, sizeof(title));
wsprintf(newtext, text, str);
return(MessageBox(0, newtext, title, type));
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */