Tue Jul 13 20:31:31 1993 Bob Amstadt (bob at pooh) * [global.c] Completed global memory pool API Sun Jul 11 16:59:52 1993 Alexandre Julliard * [message.c] [user.c] [user.spec] [windows.h] Added emulation of Windows message queue. Thu Jul 8 19:29:27 1993 Bob Amstadt (bob at pooh) * [build.c] Original by Bob Amstadt * [callback.c] Original by Bob Amstadt, updates by Alexandre Julliard * [dump.c] Original by Bob Amstadt * [global.c] Original by Bob Amstadt * [heap.c] Original by Bob Amstadt * [kernel.c] Original by Bob Amstadt * [ldt.c] Original by Bob Amstadt * [ldtlib.c] Original by Bob Amstadt * [relay.c] Original by Bob Amstadt * [resource.c] Original by Bob Amstadt, updates by Alexandre Juliard * [selector.c] Original by Bob Amstadt, updates by Eric Youngdale * [user.c] Original by Bob Amstadt * [wine.c] Original by Bob Amstadt, updates by Eric Youngdale and Alexandre Julliard * [wintcl.c] Original by Regents of the University of California, updates by Peter MacDonald and Alexandre Julliard * [callback.h] Original by Bob Amstadt * [dlls.h] Original by Bob Amstadt * [heap.h] Original by Bob Amstadt * [neexe.h] Original by Bob Amstadt * [prototypes.h] Original by Bob Amstadt, updates by Eric Youngdale * [segmem.h] Original by Bob Amstadt * [tkInt.h] Original by Regents of the University of California * [windows.h] Original by Peter MacDonald, updates by Alexandre Julliard and Bob Amstadt * [wine.h] Original by Eric Youngdale * [kernel.spec] Original by Bob Amstadt, updates by Alexandre Julliard * [gdi.spec] Original by Bob Amstadt, updates by Alexandre Julliard * [shell.spec] Original by Bob Amstadt * [unixlib.spec] Original by Bob Amstadt * [user.spec] Original by Bob Amstadt, updates by Alexandre Julliard * [win87em.spec] Original by Bob Amstadt * [Windows.tcl] Original by Peter MacDonald, updates by Alexandre Julliard * [build-spec.txt] Original by Bob Amstadt * [if1632.S] Original by Bob Amstadt, updates by Eric Youngdale
121 lines
2.7 KiB
C
121 lines
2.7 KiB
C
/*
|
|
* Windows widgets (built-in window classes)
|
|
*
|
|
* Copyright 1993 Alexandre Julliard
|
|
*/
|
|
|
|
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
|
|
|
|
#include "windows.h"
|
|
|
|
|
|
static LONG WIDGETS_ButtonWndProc( HWND hwnd, WORD message,
|
|
WORD wParam, LONG lParam );
|
|
static LONG WIDGETS_StaticWndProc( HWND hwnd, WORD message,
|
|
WORD wParam, LONG lParam );
|
|
|
|
#define NB_BUILTIN_CLASSES 2
|
|
|
|
static WNDCLASS WIDGETS_BuiltinClasses[NB_BUILTIN_CLASSES] =
|
|
{
|
|
{ 0, WIDGETS_ButtonWndProc, 0, 0, 0, 0, 0, 0, NULL, "BUTTON" },
|
|
{ 0, WIDGETS_StaticWndProc, 0, 0, 0, 0, 0, 0, NULL, "STATIC" }
|
|
};
|
|
|
|
static FARPROC WndProc32[NB_BUILTIN_CLASSES];
|
|
|
|
|
|
/***********************************************************************
|
|
* WIDGETS_Init
|
|
*
|
|
* Initialize the built-in window classes.
|
|
*/
|
|
BOOL WIDGETS_Init()
|
|
{
|
|
int i;
|
|
WNDCLASS * pClass = WIDGETS_BuiltinClasses;
|
|
|
|
for (i = 0; i < NB_BUILTIN_CLASSES; i++, pClass++)
|
|
{
|
|
WndProc32[i] = pClass->lpfnWndProc;
|
|
pClass->lpfnWndProc = (FARPROC) i+1;
|
|
if (!RegisterClass(pClass)) return FALSE;
|
|
}
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
/**********************************************************************
|
|
* WIDGETS_Call32WndProc
|
|
*
|
|
* Call the window procedure of a built-in class.
|
|
*/
|
|
LONG WIDGETS_Call32WndProc( FARPROC func, HWND hwnd, WORD message,
|
|
WORD wParam, LONG lParam )
|
|
{
|
|
unsigned int i = (unsigned int) func;
|
|
if (!i || (i > NB_BUILTIN_CLASSES)) return 0;
|
|
return (*WndProc32[i-1])( hwnd, message, wParam, lParam );
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* WIDGETS_ButtonWndProc
|
|
*/
|
|
static LONG WIDGETS_ButtonWndProc( HWND hwnd, WORD message,
|
|
WORD wParam, LONG lParam )
|
|
{
|
|
switch(message)
|
|
{
|
|
case WM_CREATE:
|
|
return 0;
|
|
|
|
case WM_PAINT:
|
|
{
|
|
HDC hdc;
|
|
PAINTSTRUCT ps;
|
|
RECT rect;
|
|
|
|
hdc = BeginPaint( hwnd, &ps );
|
|
GetClientRect( hwnd, &rect );
|
|
DrawText(hdc, "Button", -1, &rect,
|
|
DT_SINGLELINE | DT_CENTER | DT_VCENTER );
|
|
EndPaint( hwnd, &ps );
|
|
return 0;
|
|
}
|
|
|
|
default:
|
|
return DefWindowProc( hwnd, message, wParam, lParam );
|
|
}
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* WIDGETS_StaticWndProc
|
|
*/
|
|
static LONG WIDGETS_StaticWndProc( HWND hwnd, WORD message,
|
|
WORD wParam, LONG lParam )
|
|
{
|
|
switch(message)
|
|
{
|
|
case WM_CREATE:
|
|
return 0;
|
|
|
|
case WM_PAINT:
|
|
{
|
|
HDC hdc;
|
|
PAINTSTRUCT ps;
|
|
RECT rect;
|
|
|
|
hdc = BeginPaint( hwnd, &ps );
|
|
GetClientRect( hwnd, &rect );
|
|
DrawText(hdc, "Static", -1, &rect,
|
|
DT_SINGLELINE | DT_CENTER | DT_VCENTER );
|
|
EndPaint( hwnd, &ps );
|
|
return 0;
|
|
}
|
|
|
|
default:
|
|
return DefWindowProc( hwnd, message, wParam, lParam );
|
|
}
|
|
}
|