Thu Jan 13 11:45:13 1994 John Richardson <jrichard@cs.uml.edu> * [window/win.c] Added functions EnableWindow, IsWindowEnabled, and helper WIN_SetSensitive. * [window/event.c] Added checks for WS_DISABLED windows in EVENT_key, EVENT_MotionNotify, EVENT_ButtonPress, EVENT_ButtonRelease, EVENT_ConfigureNotify, EVENT_FocusIn, EVENT_FocusOut, and EVENT_EnterNotify. Key and button presses beep for a disabled window. If anyone finds better places for these checks, please tell me. Jan 17, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte) * [misc/message.c] Cleanup on buttons answer value returned. * [control/combo.c] Now use OBM_COMBO bitmap dropdown button. Mon Jan 17 21:56:45 1994 Erik Bos (erik@trashcan.hacktic.nl) * [misc/comm/c] A few bugfixes. Tue Jan 18 06:36:48 1994 julliard@di.epfl.ch (Alexandre Julliard) * [loader/cursor.c] Added X cursor for IDC_SIZENS and IDC_SIZEWE. * [include/options.h] [misc/main.c] (New files) Rewrote main() function to get rid of Xt application context, and added command-line option parsing. * [objects/color.c] Use of a private map now configurable with command-line option. * [windows/defwnd.c] Added WM_SYSCOMMAND handling, and better WM_SETCURSOR handling. * [windows/event.c] Removed ConfigureNotify event handler (no longer needed). * [windows/message.c] Send WM_SETCURSOR message on mouse events. * [windows/nonclient.c] Use OEM bitmaps for the drawing of the non-client area. Added caption bar buttons handling, and moving and resizing of the window via the window frame (bypassing the window manager). * [windows/painting.c] Bug fix in BeginPaint(). * [windows/win.c] Set the override_redirect flag for windows (to bypass window manager). * [windows/winpos.c] Implemented WindowFromPoint(), ChildWindowFromPoint(), BringWindowToTop(), Get/SetInternalWindowPos(), Get/SetWindowPlacement(). Mon Jan 17 20:48:24 1994 Bob Amstadt (bob@pooh) * [memory/heap.c] Added support for multiple local heaps.
85 lines
2.1 KiB
C
85 lines
2.1 KiB
C
/*
|
|
* Window painting functions
|
|
*
|
|
* Copyright 1993 Alexandre Julliard
|
|
*/
|
|
|
|
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
|
|
|
|
#include <math.h>
|
|
#include <X11/Xlib.h>
|
|
|
|
#include "win.h"
|
|
#include "message.h"
|
|
|
|
/* Last CTLCOLOR id */
|
|
#define CTLCOLOR_MAX CTLCOLOR_STATIC
|
|
|
|
|
|
/***********************************************************************
|
|
* BeginPaint (USER.39)
|
|
*/
|
|
HDC BeginPaint( HWND hwnd, LPPAINTSTRUCT lps )
|
|
{
|
|
HRGN hrgnUpdate;
|
|
WND * wndPtr = WIN_FindWndPtr( hwnd );
|
|
if (!wndPtr) return 0;
|
|
|
|
hrgnUpdate = wndPtr->hrgnUpdate; /* Save update region */
|
|
|
|
if (!(lps->hdc = GetDCEx( hwnd, wndPtr->hrgnUpdate,
|
|
DCX_INTERSECTRGN | DCX_USESTYLE ))) return 0;
|
|
GetRgnBox( InquireVisRgn(lps->hdc), &lps->rcPaint );
|
|
|
|
if (wndPtr->hrgnUpdate)
|
|
{
|
|
wndPtr->hrgnUpdate = 0;
|
|
MSG_DecPaintCount( wndPtr->hmemTaskQ );
|
|
}
|
|
wndPtr->flags &= ~WIN_NEEDS_BEGINPAINT;
|
|
|
|
SendMessage( hwnd, WM_NCPAINT, hrgnUpdate, 0 );
|
|
if (hrgnUpdate) DeleteObject( hrgnUpdate );
|
|
|
|
if (!(wndPtr->flags & WIN_ERASE_UPDATERGN)) lps->fErase = TRUE;
|
|
else lps->fErase = !SendMessage( hwnd, WM_ERASEBKGND, lps->hdc, 0 );
|
|
|
|
return lps->hdc;
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* EndPaint (USER.40)
|
|
*/
|
|
void EndPaint( HWND hwnd, LPPAINTSTRUCT lps )
|
|
{
|
|
ReleaseDC( hwnd, lps->hdc );
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* FillWindow (USER.324)
|
|
*/
|
|
void FillWindow( HWND hwndParent, HWND hwnd, HDC hdc, HBRUSH hbrush )
|
|
{
|
|
RECT rect;
|
|
GetClientRect( hwnd, &rect );
|
|
PaintRect( hwndParent, hwnd, hdc, hbrush, &rect );
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* PaintRect (USER.325)
|
|
*/
|
|
void PaintRect(HWND hwndParent, HWND hwnd, HDC hdc, HBRUSH hbrush, LPRECT rect)
|
|
{
|
|
/* Send WM_CTLCOLOR message if needed */
|
|
|
|
if (hbrush <= CTLCOLOR_MAX)
|
|
{
|
|
if (!hwndParent) return;
|
|
hbrush = (HBRUSH)SendMessage( hwndParent, WM_CTLCOLOR,
|
|
hdc, hwnd | (hbrush << 16) );
|
|
}
|
|
if (hbrush) FillRect( hdc, rect, hbrush );
|
|
}
|