mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 05:00:30 +00:00
767e6f6f9d
Sat Aug 8 19:11:46 1998 Marcus Meissner <marcus@jet.franken.de> * [*/*] Added some missing WINAPI and some missing prototypes for functions. * [controls/static.c] Got rid of the MODULE32_LookupHMODULE error showing up for every message box. * [windows/winproc.c] WM_NOTIFY 16->32 mapping (AOL Instant Messenger or however it is called). * [misc/winsock.c] hostent/servent/protoent should not use the same static buffers. (has broken nt3.15 finger.exe which does hp=gethostbyname(), then getservbyname("finger","tcp") and the references hp->h_addr_list[0]). Sat Aug 8 13:21:24 1998 Alexandre Julliard <julliard@lrc.epfl.ch> * [include/server.h] [tools/make_requests] [server/request.c] [server/trace.c] Automated part of the client/server request code generation. Added tracing of client/server communication. * [scheduler/*.c] [server/process.c] Added support for server-side handles. * [scheduler/thread.c] Added DLL_THREAD_ATTACH/DETACH notifications. * [configure.in] Added check for -lsocket. * [windows/winproc.c] Return the thunk address in WINPROC_GetProc if the function types don't match. Sat Aug 8 02:44:04 1998 Douglas Ridgway <ridgway@winehq.com> * [windows/winproc.c][windows/win.c][windows/message.c] Documentation for CallWindowProc, SetWindowLong, DispatchMessage, WaitMessage, GetMessage, and PeekMessage. Sat Aug 8 01:00:00 1998 Juergen Schmied <juergen.schmied@metronet.de> * [controls/commctrl.c][controls/widgets.c][include/builtin32.h] [include/commctrl.h][relay32/builtin32.c][relay32/comctl32.spec] [tools/build.c] [relay32/shell32.spec] Added the functionality of the LibMain function. The common controls are properly initialized now. * [controls/treeview.c][memory/atom.c][scheduler/thread.c][windows/class.c] [windows/msgbox.c][windows/win.c] Put TRACE in, put SetLastError() in. * [include/interfaces.h] Added IClassFactory::LockServer. * [include/ole2.h] Added struct for LPOLEMENUGROUPWIDTHS32, HOLEMENU32. * [include/shell.h][include/shlobj.h][misc/shell.c][ole/folders.c] Reorganized and many structs and classes (IShellBrowser,IShellView) added. shell32.dll should work in many cases now. Started SHGetFileInfoA implementeation, rewrote SHGetPathFromIDList32A. New Shell32LibMain started ShellIconCache Implementation. * [misc/shellord.c] Rewrote ILCombine, ILGetSize New stubs SHFind_InitMenuPopup, FileMenu_Create, ShellExecuteEx, SHSetInstanceExplorer, SHGetInstanceExplorer, SHFreeUnusedLibraries. * [include/winerror.h] Class and window related error codes added. * [memory/heap.c] Changed lstrlen32A to strlen to get rid of milions of TRACE lines. * [misc/ddeml.c] First lines for DdeCreateStringHandle32A / DdeFreeStringHandle32. * [misc/network.c][relay32/mpr.spec] Fixed some bugs, changed ordinals. * [windows/class.c] Workarounds for incorrect hInstance handling. Fixes parts of MSWord95/Excel95 and Money95. Thu Aug 6 21:05:35 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de> * [windows/nonclient.c][misc/tweak.c][include/tweak.h] [documentation/win95look] Removed some tweak variables. They are no longer needed. * [files/dos_fs.c] Added check for null pointer in DOSFS_GetDevice(). * [controls/tooltips.c][include/commctrl.h] Improved tooltips. * [controls/status.c][include/commctrl.h] Cleaned up code and added tooltip support. * [controls/toolbar.c][include/commctrl.h] Added tooltip support. * [documentation/common_controls] Updated. Thu Aug 6 00:05:22 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> * [include/ver.h] [misc/ver.c] Write VIF_BUFFTOOSMALL, not VIF_BUFTOSMALL. * [debugger/hash.c] [debugger/stabs.c] Make debug output more friendly for posting. * [files/file.c] Partial implementation of OF_SHARE_EXCLUSIVE. Needed for Quicklogic/QuickChip (InstallShield). * [files/profile.c] When a cached-only entry is found, return it. * [graphics/x11drv/xfont.c] Accept a space as delimiter for a fontname and inhibit overrun (Make xplasim.ex from the Phillips Coolrunner CPLD suite proceed). * [miscemu/main.c] Delay setting IF1632_CallLargeStack after loading the executables. Stops fpgaexp.exe from the Viewlogic FPGA suite from crashing when showing the Blinker error Message Box. * [misc/network.c] Make WNetGetConnection16 recognise a CDROM as a local drive. * [multimedia/mmsystem.c] Preliminary check for MCI_ALL_DEVICE_ID in MCI_Close by a FIXME. Tue Aug 4 21:15:23 1998 James Juran <jrj120@psu.edu> * [ole/ole2nls.c] Fixed bug in CompareString32A. strcmp() doesn't necessarily return -1, 0, or 1, which the previous code depended on. Changed name of is_punctuation to OLE2NLS_isPunctuation. Made NORM_IGNOREWIDTH not print a FIXME message in LCMapString32A. Other debugging messages, documentation, and code cleanups. * [objects/font.c] [relay32/gdi32.spec] [include/winerror.h] Added stub for GetFontData32, and added GDI_ERROR constant to winerror.h. Tue Aug 4 07:44:43 1998 Ove Kaaven <ovek@arcticnet.no> * [multimedia/mmio.c] Implemented mmioSetBuffer, mmioAdvance, mmioAscend, and mmioCreateChunk to the best of my knowledge. But watch out, there's bound to be bugs in there... * [include/mmsystem.h] [multimedia/mmsystem.c] Hacked in support for 32-bit multimedia function callbacks. * [AUTHORS] [misc/shell.c] Selfishly credited my authorship. Hopefully I'm excused. * [include/dosexe.h] [include/module.h] [loader/dos/*] [loader/module.c] [loader/task.c] [Makefile.in] [configure.in] [Makefile.in] Added DOS EXE (MZ) loader and virtual machine. Task structure integration thanks to Ulrich Weigand. * [files/dos_fs.c] Work around a null pointer dereference if ioctlGetDeviceInfo-ing a FILE_DupUnixHandle'd file (i.e. GetStdHandle'd). * [include/miscemu.h] [include/winnt.h] [loader/main.c] [memory/global.c] [msdos/dpmi.c] [msdos/dosmem.c] Added support for DOS memory images, and added DOSMEM_ResizeBlock() and DOSMEM_Available(). * [msdos/int21.c] Added support for the DOS virtual machine, tweaked handle assignment to avoid stdio clashes, forced INT21_FindNext to exit wildcardless searches after finding one entry, added AH=7, 8, 9, C, 48, 49, 4A, and 7160 CL=1 (Get Short Filename), and made the long filename calls only respond if running with with -winver win95. * [objects/cursoricon.c] DestroyCursor32 and DestroyIcon32 should now free the objects (hopefully) correctly. Sun Aug 2 21:42:09 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk> * [graphics/psdrv/*] [include/psdrv.h] Added PPD file parsing - at the moment it reads a file called default.ppd from the directory in which you start Wine. Page sizes other than A4 should now work (landscape may not). All fonts that are present on your printer (according to the PPD) should be available, providing you have the AFM files. Fonts should now be the correct size. Graphics is still basically lines only. See graphics/psdrv/README . * [misc/printdrv.c] Yet more Drv[Get/Set]PrinterData fixes. Fri Jul 31 21:33:22 1998 Per Lindström <pelinstr@algonet.se> * [relay32/crtdll.spec] [misc/crtdll.c] Added stub for freopen, _findfirst, _findnext, _fstat and _read. * [files/directory.c] Modified warning message. Wed Jul 29 11:25:28 1998 Luiz Otavio L. Zorzella <zorzella@nr.conexware.com> * [objects/font.c] Added stub for GetFontData. * [multimedia/msvideo.c] Created this file to hold the msvideo.dll calls (and maybe also msvfw32.dll). * [objects/cursoricon.c] Added search in Global Heap for cursor when trying to destroy it with DestroyCursor16. This test should be done in many (all?) other functions that use FreeResource. * [controls/treeview.c] [include/commctrl.h] Minor correction in name and addition of many placeholders for TVM messages in TREEVIEW_WindowProc. * [msdos/dpmi.c] Fixed a bug in DPMI_xrealloc where in a copy of a memory region "A" of size "a" to a region "B" of size "b", "b" bytes were being copied, instead of "a", as the new version does. This both increases speed, as well as avoids segfaults.
472 lines
14 KiB
C
472 lines
14 KiB
C
/*
|
|
* Static control
|
|
*
|
|
* Copyright David W. Metcalfe, 1993
|
|
*
|
|
*/
|
|
|
|
#include "windows.h"
|
|
#include "win.h"
|
|
#include "bitmap.h"
|
|
#include "cursoricon.h"
|
|
#include "static.h"
|
|
#include "heap.h"
|
|
#include "debug.h"
|
|
#include "tweak.h"
|
|
|
|
static void STATIC_PaintTextfn( WND *wndPtr, HDC32 hdc );
|
|
static void STATIC_PaintRectfn( WND *wndPtr, HDC32 hdc );
|
|
static void STATIC_PaintIconfn( WND *wndPtr, HDC32 hdc );
|
|
static void STATIC_PaintBitmapfn( WND *wndPtr, HDC32 hdc );
|
|
static void STATIC_PaintEtchedfn( WND *wndPtr, HDC32 hdc );
|
|
|
|
static COLORREF color_windowframe, color_background, color_window;
|
|
|
|
|
|
typedef void (*pfPaint)( WND *, HDC32 );
|
|
|
|
static pfPaint staticPaintFunc[SS_TYPEMASK+1] =
|
|
{
|
|
STATIC_PaintTextfn, /* SS_LEFT */
|
|
STATIC_PaintTextfn, /* SS_CENTER */
|
|
STATIC_PaintTextfn, /* SS_RIGHT */
|
|
STATIC_PaintIconfn, /* SS_ICON */
|
|
STATIC_PaintRectfn, /* SS_BLACKRECT */
|
|
STATIC_PaintRectfn, /* SS_GRAYRECT */
|
|
STATIC_PaintRectfn, /* SS_WHITERECT */
|
|
STATIC_PaintRectfn, /* SS_BLACKFRAME */
|
|
STATIC_PaintRectfn, /* SS_GRAYFRAME */
|
|
STATIC_PaintRectfn, /* SS_WHITEFRAME */
|
|
NULL, /* Not defined */
|
|
STATIC_PaintTextfn, /* SS_SIMPLE */
|
|
STATIC_PaintTextfn, /* SS_LEFTNOWORDWRAP */
|
|
NULL, /* SS_OWNERDRAW */
|
|
STATIC_PaintBitmapfn, /* SS_BITMAP */
|
|
NULL, /* SS_ENHMETAFILE */
|
|
STATIC_PaintEtchedfn, /* SS_ETCHEDHORIZ */
|
|
STATIC_PaintEtchedfn, /* SS_ETCHEDVERT */
|
|
STATIC_PaintEtchedfn, /* SS_ETCHEDFRAME */
|
|
};
|
|
|
|
|
|
/***********************************************************************
|
|
* STATIC_SetIcon
|
|
*
|
|
* Set the icon for an SS_ICON control.
|
|
*/
|
|
static HICON16 STATIC_SetIcon( WND *wndPtr, HICON16 hicon )
|
|
{
|
|
HICON16 prevIcon;
|
|
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
|
|
CURSORICONINFO *info = hicon?(CURSORICONINFO *) GlobalLock16( hicon ):NULL;
|
|
|
|
if ((wndPtr->dwStyle & SS_TYPEMASK) != SS_ICON) return 0;
|
|
if (hicon && !info) {
|
|
ERR(static, "huh? hicon!=0, but info=0???\n");
|
|
return 0;
|
|
}
|
|
prevIcon = infoPtr->hIcon;
|
|
infoPtr->hIcon = hicon;
|
|
if (hicon)
|
|
{
|
|
SetWindowPos32( wndPtr->hwndSelf, 0, 0, 0, info->nWidth, info->nHeight,
|
|
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
|
|
GlobalUnlock16( hicon );
|
|
}
|
|
return prevIcon;
|
|
}
|
|
|
|
/***********************************************************************
|
|
* STATIC_SetBitmap
|
|
*
|
|
* Set the bitmap for an SS_BITMAP control.
|
|
*/
|
|
static HICON16 STATIC_SetBitmap( WND *wndPtr, HICON16 hicon )
|
|
{
|
|
HICON16 prevIcon;
|
|
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
|
|
BITMAPOBJ *info = (BITMAPOBJ *)GDI_HEAP_LOCK(hicon);
|
|
|
|
if ((wndPtr->dwStyle & SS_TYPEMASK) != SS_BITMAP) return 0;
|
|
if (hicon && !info) {
|
|
ERR(static, "huh? hicon!=0, but info=0???\n");
|
|
return 0;
|
|
}
|
|
prevIcon = infoPtr->hIcon;
|
|
infoPtr->hIcon = hicon;
|
|
if (hicon)
|
|
{
|
|
SetWindowPos32( wndPtr->hwndSelf, 0, 0, 0, info->bitmap.bmWidth, info->bitmap.bmHeight,
|
|
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
|
|
}
|
|
GDI_HEAP_UNLOCK( hicon );
|
|
return prevIcon;
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* STATIC_LoadIcon
|
|
*
|
|
* Load the icon for an SS_ICON control.
|
|
*/
|
|
static HICON16 STATIC_LoadIcon( WND *wndPtr, LPCSTR name )
|
|
{
|
|
HICON16 hicon;
|
|
|
|
if (wndPtr->flags & WIN_ISWIN32)
|
|
{
|
|
if (!HIWORD(wndPtr->hInstance)) {
|
|
LPSTR segname = SEGPTR_STRDUP(name);
|
|
hicon = LoadIcon16( wndPtr->hInstance, SEGPTR_GET(segname) );
|
|
SEGPTR_FREE(segname);
|
|
} else
|
|
hicon = LoadIcon32A( wndPtr->hInstance, name );
|
|
} else {
|
|
LPSTR segname = SEGPTR_STRDUP(name);
|
|
|
|
if (HIWORD(wndPtr->hInstance))
|
|
FIXME(static,"win16 window class, but win32 hinstance??\n");
|
|
hicon = LoadIcon16( wndPtr->hInstance, SEGPTR_GET(segname) );
|
|
SEGPTR_FREE(segname);
|
|
}
|
|
if (!hicon)
|
|
hicon = LoadIcon32A( 0, name );
|
|
return hicon;
|
|
}
|
|
|
|
/***********************************************************************
|
|
* STATIC_LoadBitmap
|
|
*
|
|
* Load the bitmap for an SS_BITMAP control.
|
|
*/
|
|
static HBITMAP16 STATIC_LoadBitmap( WND *wndPtr, LPCSTR name )
|
|
{
|
|
HBITMAP16 hbitmap;
|
|
|
|
if (wndPtr->flags & WIN_ISWIN32)
|
|
{
|
|
hbitmap = LoadBitmap32A( wndPtr->hInstance, name );
|
|
if (!hbitmap) /* Try OEM icon (FIXME: is this right?) */
|
|
hbitmap = LoadBitmap32A( 0, name );
|
|
}
|
|
else
|
|
{
|
|
LPSTR segname = SEGPTR_STRDUP(name);
|
|
hbitmap = LoadBitmap16( wndPtr->hInstance, SEGPTR_GET(segname) );
|
|
if (!hbitmap) /* Try OEM icon (FIXME: is this right?) */
|
|
hbitmap = LoadBitmap32A( 0, segname );
|
|
SEGPTR_FREE(segname);
|
|
}
|
|
return hbitmap;
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* StaticWndProc
|
|
*/
|
|
LRESULT WINAPI StaticWndProc( HWND32 hWnd, UINT32 uMsg, WPARAM32 wParam,
|
|
LPARAM lParam )
|
|
{
|
|
LRESULT lResult = 0;
|
|
WND *wndPtr = WIN_FindWndPtr(hWnd);
|
|
LONG style = wndPtr->dwStyle & SS_TYPEMASK;
|
|
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
|
|
|
|
switch (uMsg)
|
|
{
|
|
case WM_NCCREATE:
|
|
if (TWEAK_Win95Look && (wndPtr->dwStyle & SS_SUNKEN))
|
|
wndPtr->dwExStyle |= WS_EX_STATICEDGE;
|
|
|
|
if (style == SS_ICON)
|
|
{
|
|
CREATESTRUCT32A *cs = (CREATESTRUCT32A *)lParam;
|
|
if (cs->lpszName)
|
|
STATIC_SetIcon( wndPtr,
|
|
STATIC_LoadIcon( wndPtr, cs->lpszName ));
|
|
return 1;
|
|
}
|
|
if (style == SS_BITMAP)
|
|
{
|
|
CREATESTRUCT32A *cs = (CREATESTRUCT32A *)lParam;
|
|
if (cs->lpszName)
|
|
STATIC_SetBitmap( wndPtr,
|
|
STATIC_LoadBitmap( wndPtr, cs->lpszName ));
|
|
WARN(static, "style SS_BITMAP, dwStyle is 0x%08lx\n",
|
|
wndPtr->dwStyle);
|
|
return 1;
|
|
}
|
|
return DefWindowProc32A( hWnd, uMsg, wParam, lParam );
|
|
|
|
case WM_CREATE:
|
|
if (style < 0L || style > SS_TYPEMASK)
|
|
{
|
|
ERR(static, "Unknown style 0x%02lx\n", style );
|
|
lResult = -1L;
|
|
break;
|
|
}
|
|
/* initialise colours */
|
|
color_windowframe = GetSysColor32(COLOR_WINDOWFRAME);
|
|
color_background = GetSysColor32(COLOR_BACKGROUND);
|
|
color_window = GetSysColor32(COLOR_WINDOW);
|
|
break;
|
|
|
|
case WM_NCDESTROY:
|
|
if (style == SS_ICON)
|
|
DestroyIcon32( STATIC_SetIcon( wndPtr, 0 ) );
|
|
else
|
|
lResult = DefWindowProc32A( hWnd, uMsg, wParam, lParam );
|
|
break;
|
|
|
|
case WM_PAINT:
|
|
{
|
|
PAINTSTRUCT32 ps;
|
|
BeginPaint32( hWnd, &ps );
|
|
if (staticPaintFunc[style])
|
|
(staticPaintFunc[style])( wndPtr, ps.hdc );
|
|
EndPaint32( hWnd, &ps );
|
|
}
|
|
break;
|
|
|
|
case WM_ENABLE:
|
|
InvalidateRect32( hWnd, NULL, FALSE );
|
|
break;
|
|
|
|
case WM_SYSCOLORCHANGE:
|
|
color_windowframe = GetSysColor32(COLOR_WINDOWFRAME);
|
|
color_background = GetSysColor32(COLOR_BACKGROUND);
|
|
color_window = GetSysColor32(COLOR_WINDOW);
|
|
InvalidateRect32( hWnd, NULL, TRUE );
|
|
break;
|
|
|
|
case WM_SETTEXT:
|
|
if (style == SS_ICON)
|
|
/* FIXME : should we also return the previous hIcon here ??? */
|
|
STATIC_SetIcon( wndPtr, STATIC_LoadIcon( wndPtr, (LPCSTR)lParam ));
|
|
else if (style == SS_BITMAP)
|
|
STATIC_SetBitmap(wndPtr,STATIC_LoadBitmap(wndPtr,(LPCSTR)lParam ));
|
|
else
|
|
DEFWND_SetText( wndPtr, (LPCSTR)lParam );
|
|
InvalidateRect32( hWnd, NULL, FALSE );
|
|
UpdateWindow32( hWnd );
|
|
break;
|
|
|
|
case WM_SETFONT:
|
|
if (style == SS_ICON) return 0;
|
|
if (style == SS_BITMAP) return 0;
|
|
infoPtr->hFont = (HFONT16)wParam;
|
|
if (LOWORD(lParam))
|
|
{
|
|
InvalidateRect32( hWnd, NULL, FALSE );
|
|
UpdateWindow32( hWnd );
|
|
}
|
|
break;
|
|
|
|
case WM_GETFONT:
|
|
return infoPtr->hFont;
|
|
|
|
case WM_NCHITTEST:
|
|
return HTTRANSPARENT;
|
|
|
|
case WM_GETDLGCODE:
|
|
return DLGC_STATIC;
|
|
|
|
return infoPtr->hIcon;
|
|
case STM_GETIMAGE:
|
|
case STM_GETICON16:
|
|
case STM_GETICON32:
|
|
return infoPtr->hIcon;
|
|
|
|
case STM_SETIMAGE:
|
|
/* FIXME: handle wParam */
|
|
lResult = STATIC_SetBitmap( wndPtr, (HBITMAP32)lParam );
|
|
InvalidateRect32( hWnd, NULL, FALSE );
|
|
UpdateWindow32( hWnd );
|
|
break;
|
|
case STM_SETICON16:
|
|
case STM_SETICON32:
|
|
lResult = STATIC_SetIcon( wndPtr, (HICON16)wParam );
|
|
InvalidateRect32( hWnd, NULL, FALSE );
|
|
UpdateWindow32( hWnd );
|
|
break;
|
|
|
|
default:
|
|
lResult = DefWindowProc32A(hWnd, uMsg, wParam, lParam);
|
|
break;
|
|
}
|
|
|
|
return lResult;
|
|
}
|
|
|
|
|
|
static void STATIC_PaintTextfn( WND *wndPtr, HDC32 hdc )
|
|
{
|
|
RECT32 rc;
|
|
HBRUSH32 hBrush;
|
|
WORD wFormat;
|
|
|
|
LONG style = wndPtr->dwStyle;
|
|
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
|
|
|
|
GetClientRect32( wndPtr->hwndSelf, &rc);
|
|
|
|
switch (style & SS_TYPEMASK)
|
|
{
|
|
case SS_LEFT:
|
|
wFormat = DT_LEFT | DT_EXPANDTABS | DT_WORDBREAK | DT_NOCLIP;
|
|
break;
|
|
|
|
case SS_CENTER:
|
|
wFormat = DT_CENTER | DT_EXPANDTABS | DT_WORDBREAK | DT_NOCLIP;
|
|
break;
|
|
|
|
case SS_RIGHT:
|
|
wFormat = DT_RIGHT | DT_EXPANDTABS | DT_WORDBREAK | DT_NOCLIP;
|
|
break;
|
|
|
|
case SS_SIMPLE:
|
|
wFormat = DT_LEFT | DT_SINGLELINE | DT_VCENTER | DT_NOCLIP;
|
|
break;
|
|
|
|
case SS_LEFTNOWORDWRAP:
|
|
wFormat = DT_LEFT | DT_SINGLELINE | DT_EXPANDTABS | DT_VCENTER | DT_NOCLIP;
|
|
break;
|
|
|
|
default:
|
|
return;
|
|
}
|
|
|
|
if (style & SS_NOPREFIX)
|
|
wFormat |= DT_NOPREFIX;
|
|
|
|
if (infoPtr->hFont) SelectObject32( hdc, infoPtr->hFont );
|
|
hBrush = SendMessage32A( GetParent32(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
|
|
hdc, wndPtr->hwndSelf );
|
|
if (!hBrush) hBrush = GetStockObject32(WHITE_BRUSH);
|
|
FillRect32( hdc, &rc, hBrush );
|
|
if (wndPtr->text) DrawText32A( hdc, wndPtr->text, -1, &rc, wFormat );
|
|
}
|
|
|
|
static void STATIC_PaintRectfn( WND *wndPtr, HDC32 hdc )
|
|
{
|
|
RECT32 rc;
|
|
HBRUSH32 hBrush;
|
|
|
|
GetClientRect32( wndPtr->hwndSelf, &rc);
|
|
|
|
switch (wndPtr->dwStyle & SS_TYPEMASK)
|
|
{
|
|
case SS_BLACKRECT:
|
|
hBrush = CreateSolidBrush32(color_windowframe);
|
|
FillRect32( hdc, &rc, hBrush );
|
|
break;
|
|
case SS_GRAYRECT:
|
|
hBrush = CreateSolidBrush32(color_background);
|
|
FillRect32( hdc, &rc, hBrush );
|
|
break;
|
|
case SS_WHITERECT:
|
|
hBrush = CreateSolidBrush32(color_window);
|
|
FillRect32( hdc, &rc, hBrush );
|
|
break;
|
|
case SS_BLACKFRAME:
|
|
hBrush = CreateSolidBrush32(color_windowframe);
|
|
FrameRect32( hdc, &rc, hBrush );
|
|
break;
|
|
case SS_GRAYFRAME:
|
|
hBrush = CreateSolidBrush32(color_background);
|
|
FrameRect32( hdc, &rc, hBrush );
|
|
break;
|
|
case SS_WHITEFRAME:
|
|
hBrush = CreateSolidBrush32(color_window);
|
|
FrameRect32( hdc, &rc, hBrush );
|
|
break;
|
|
default:
|
|
return;
|
|
}
|
|
DeleteObject32( hBrush );
|
|
}
|
|
|
|
|
|
static void STATIC_PaintIconfn( WND *wndPtr, HDC32 hdc )
|
|
{
|
|
RECT32 rc;
|
|
HBRUSH32 hbrush;
|
|
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
|
|
|
|
GetClientRect32( wndPtr->hwndSelf, &rc );
|
|
hbrush = SendMessage32A( GetParent32(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
|
|
hdc, wndPtr->hwndSelf );
|
|
FillRect32( hdc, &rc, hbrush );
|
|
if (infoPtr->hIcon) DrawIcon32( hdc, rc.left, rc.top, infoPtr->hIcon );
|
|
}
|
|
|
|
static void STATIC_PaintBitmapfn(WND *wndPtr, HDC32 hdc )
|
|
{
|
|
RECT32 rc;
|
|
HBRUSH32 hbrush;
|
|
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
|
|
HDC32 hMemDC;
|
|
HBITMAP32 oldbitmap;
|
|
|
|
GetClientRect32( wndPtr->hwndSelf, &rc );
|
|
hbrush = SendMessage32A( GetParent32(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
|
|
hdc, wndPtr->hwndSelf );
|
|
FillRect32( hdc, &rc, hbrush );
|
|
if (infoPtr->hIcon) {
|
|
BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_HEAP_LOCK( infoPtr->hIcon );
|
|
|
|
if (!bmp) return;
|
|
if (!(hMemDC = CreateCompatibleDC32( hdc ))) return;
|
|
|
|
oldbitmap = SelectObject32(hMemDC,infoPtr->hIcon);
|
|
BitBlt32(hdc,bmp->size.cx,bmp->size.cy,bmp->bitmap.bmWidth,bmp->bitmap.bmHeight,hMemDC,0,0,SRCCOPY);
|
|
DeleteDC32(hMemDC);
|
|
GDI_HEAP_UNLOCK(infoPtr->hIcon);
|
|
}
|
|
}
|
|
|
|
|
|
static void STATIC_PaintEtchedfn( WND *wndPtr, HDC32 hdc )
|
|
{
|
|
RECT32 rc;
|
|
HBRUSH32 hbrush;
|
|
HPEN32 hpen;
|
|
|
|
if (!TWEAK_Win95Look) return;
|
|
|
|
GetClientRect32( wndPtr->hwndSelf, &rc );
|
|
hbrush = SendMessage32A( GetParent32(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
|
|
hdc, wndPtr->hwndSelf );
|
|
FillRect32( hdc, &rc, hbrush );
|
|
|
|
switch (wndPtr->dwStyle & SS_TYPEMASK)
|
|
{
|
|
case SS_ETCHEDHORZ:
|
|
hpen = SelectObject32 (hdc, GetSysColorPen32 (COLOR_3DSHADOW));
|
|
MoveToEx32 (hdc, rc.left, rc.bottom / 2 - 1, NULL);
|
|
LineTo32 (hdc, rc.right - 1, rc.bottom / 2 - 1);
|
|
SelectObject32 (hdc, GetSysColorPen32 (COLOR_3DHIGHLIGHT));
|
|
MoveToEx32 (hdc, rc.left, rc.bottom / 2, NULL);
|
|
LineTo32 (hdc, rc.right, rc.bottom / 2);
|
|
LineTo32 (hdc, rc.right, rc.bottom / 2 - 1);
|
|
SelectObject32 (hdc, hpen);
|
|
break;
|
|
|
|
case SS_ETCHEDVERT:
|
|
hpen = SelectObject32 (hdc, GetSysColorPen32 (COLOR_3DSHADOW));
|
|
MoveToEx32 (hdc, rc.right / 2 - 1, rc.top, NULL);
|
|
LineTo32 (hdc, rc.right / 2 - 1, rc.bottom - 1);
|
|
SelectObject32 (hdc, GetSysColorPen32 (COLOR_3DHIGHLIGHT));
|
|
MoveToEx32 (hdc, rc.right / 2, rc.top, NULL);
|
|
LineTo32 (hdc, rc.right / 2, rc.bottom);
|
|
LineTo32 (hdc, rc.right / 2 -1 , rc.bottom);
|
|
SelectObject32 (hdc, hpen);
|
|
break;
|
|
|
|
case SS_ETCHEDFRAME:
|
|
DrawEdge32 (hdc, &rc, EDGE_ETCHED, BF_RECT);
|
|
break;
|
|
}
|
|
}
|
|
|