Moved most builtin controls structures into their respective C file.
Created new controls.h file private to user32.dll and moved remaining
builtin controls definitions there.
diff --git a/controls/Makefile.in b/controls/Makefile.in
index 03e57e1..8015432 100644
--- a/controls/Makefile.in
+++ b/controls/Makefile.in
@@ -4,6 +4,7 @@
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = controls
+EXTRAINCL = -I$(TOPSRCDIR)/dlls/user
C_SRCS = \
button.c \
@@ -15,8 +16,7 @@
menu.c \
scroll.c \
static.c \
- uitools.c \
- widgets.c
+ uitools.c
GLUE = edit.c
diff --git a/controls/button.c b/controls/button.c
index 1250bdf..d75004d 100644
--- a/controls/button.c
+++ b/controls/button.c
@@ -8,13 +8,36 @@
#include <string.h>
#include <stdlib.h> /* for abs() */
#include "win.h"
-#include "button.h"
#include "winbase.h"
#include "windef.h"
#include "wingdi.h"
#include "wine/winuser16.h"
+#include "controls.h"
#include "tweak.h"
+/* Note: under MS-Windows, state is a BYTE and this structure is
+ * only 3 bytes long. I don't think there are programs out there
+ * broken enough to rely on this :-)
+ */
+typedef struct
+{
+ WORD state; /* Current state */
+ HFONT16 hFont; /* Button font (or 0 for system font) */
+ HANDLE hImage; /* Handle to the image or the icon */
+} BUTTONINFO;
+
+ /* Button state values */
+#define BUTTON_UNCHECKED 0x00
+#define BUTTON_CHECKED 0x01
+#define BUTTON_3STATE 0x02
+#define BUTTON_HIGHLIGHTED 0x04
+#define BUTTON_HASFOCUS 0x08
+#define BUTTON_NSTATES 0x0F
+ /* undocumented flags */
+#define BUTTON_BTNPRESSED 0x40
+#define BUTTON_UNKNOWN2 0x20
+#define BUTTON_UNKNOWN3 0x10
+
static void PB_Paint( WND *wndPtr, HDC hDC, WORD action );
static void CB_Paint( WND *wndPtr, HDC hDC, WORD action );
static void GB_Paint( WND *wndPtr, HDC hDC, WORD action );
@@ -22,6 +45,8 @@
static void OB_Paint( WND *wndPtr, HDC hDC, WORD action );
static void BUTTON_CheckAutoRadioButton( WND *wndPtr );
static void BUTTON_DrawPushButton( WND *wndPtr, HDC hDC, WORD action, BOOL pushedState);
+static LRESULT WINAPI ButtonWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
+static LRESULT WINAPI ButtonWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
#define MAX_BTN_TYPE 12
@@ -73,6 +98,21 @@
static WORD checkBoxWidth = 0, checkBoxHeight = 0;
+/*********************************************************************
+ * button class descriptor
+ */
+const struct builtin_class_descr BUTTON_builtin_class =
+{
+ "Button", /* name */
+ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC, /* style */
+ ButtonWndProcA, /* procA */
+ ButtonWndProcW, /* procW */
+ sizeof(BUTTONINFO), /* extra */
+ IDC_ARROWA, /* cursor */
+ 0 /* brush */
+};
+
+
/***********************************************************************
* ButtonWndProc_locked
*
@@ -365,7 +405,7 @@
* the passed HWND and calls the real window procedure (with a WND*
* pointer pointing to the locked windowstructure).
*/
-LRESULT WINAPI ButtonWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
+static LRESULT WINAPI ButtonWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
LRESULT res;
WND *wndPtr = WIN_FindWndPtr(hWnd);
@@ -380,7 +420,7 @@
/***********************************************************************
* ButtonWndProcA
*/
-LRESULT WINAPI ButtonWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
+static LRESULT WINAPI ButtonWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
LRESULT res;
WND *wndPtr = WIN_FindWndPtr(hWnd);
diff --git a/controls/combo.c b/controls/combo.c
index 3d09d52..b8860fe 100644
--- a/controls/combo.c
+++ b/controls/combo.c
@@ -17,7 +17,7 @@
#include "spy.h"
#include "user.h"
#include "heap.h"
-#include "combo.h"
+#include "controls.h"
#include "drive.h"
#include "debugtools.h"
#include "tweak.h"
@@ -57,6 +57,24 @@
#define COMBO_EDITBUTTONSPACE() ( (TWEAK_WineLook == WIN31_LOOK) ? 8 : 0 )
#define EDIT_CONTROL_PADDING() ( (TWEAK_WineLook == WIN31_LOOK) ? 0 : 1 )
+static LRESULT WINAPI ComboWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+
+
+/*********************************************************************
+ * combo class descriptor
+ */
+const struct builtin_class_descr COMBO_builtin_class =
+{
+ "ComboBox", /* name */
+ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, /* style */
+ ComboWndProcA, /* procA */
+ NULL, /* procW (FIXME) */
+ sizeof(HEADCOMBO *), /* extra */
+ IDC_ARROWA, /* cursor */
+ 0 /* brush */
+};
+
+
/***********************************************************************
* COMBO_Init
*
@@ -2147,18 +2165,16 @@
}
/***********************************************************************
- * ComboWndProc
+ * ComboWndProcA
*
* This is just a wrapper for the real ComboWndProc which locks/unlocks
* window structs.
*/
-LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
- WPARAM wParam, LPARAM lParam )
+static LRESULT WINAPI ComboWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
{
WND* pWnd = WIN_FindWndPtr(hwnd);
LRESULT retvalue = ComboWndProc_locked(pWnd,message,wParam,lParam);
-
WIN_ReleaseWndPtr(pWnd);
return retvalue;
}
diff --git a/controls/desktop.c b/controls/desktop.c
index a1b70c1..ca91c8b 100644
--- a/controls/desktop.c
+++ b/controls/desktop.c
@@ -8,14 +8,39 @@
#include <string.h>
#include <unistd.h>
-#include "desktop.h"
#include "windef.h"
#include "wingdi.h"
#include "heap.h"
#include "user.h"
#include "win.h"
+#include "controls.h"
#include "wine/winuser16.h"
+typedef struct
+{
+ HBRUSH hbrushPattern;
+ HBITMAP hbitmapWallPaper;
+ SIZE bitmapSize;
+ BOOL fTileWallPaper;
+} DESKTOP;
+
+static LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
+
+
+/*********************************************************************
+ * desktop class descriptor
+ */
+const struct builtin_class_descr DESKTOP_builtin_class =
+{
+ DESKTOP_CLASS_ATOM, /* name */
+ CS_GLOBALCLASS, /* style */
+ NULL, /* procA (winproc is Unicode only) */
+ DesktopWndProc, /* procW */
+ sizeof(DESKTOP), /* extra */
+ IDC_ARROWA, /* cursor */
+ COLOR_BACKGROUND+1 /* brush */
+};
+
/***********************************************************************
* DESKTOP_LoadBitmap
@@ -183,8 +208,7 @@
* This is just a wrapper for the DesktopWndProc which does windows
* locking and unlocking.
*/
-LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message,
- WPARAM wParam, LPARAM lParam )
+static LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
{
WND *wndPtr = WIN_FindWndPtr( hwnd );
LRESULT retvalue = DesktopWndProc_locked(wndPtr,message,wParam,lParam);
diff --git a/controls/edit.c b/controls/edit.c
index f4482a2..51f0191 100644
--- a/controls/edit.c
+++ b/controls/edit.c
@@ -21,7 +21,7 @@
#include "win.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
-#include "combo.h"
+#include "controls.h"
#include "local.h"
#include "selectors.h"
#include "debugtools.h"
@@ -253,6 +253,24 @@
static LRESULT EDIT_WM_VScroll(WND *wnd, EDITSTATE *es, INT action, INT pos);
static void EDIT_UpdateText(WND *wnd, LPRECT rc, BOOL bErase);
+LRESULT WINAPI EditWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+
+
+
+/*********************************************************************
+ * edit class descriptor
+ */
+const struct builtin_class_descr EDIT_builtin_class =
+{
+ "Edit", /* name */
+ CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/, /* style */
+ EditWndProc, /* procA */
+ NULL, /* procW (FIXME) */
+ sizeof(EDITSTATE *), /* extra */
+ IDC_IBEAMA, /* cursor */
+ 0 /* brush */
+};
+
/*********************************************************************
*
@@ -342,7 +360,7 @@
/*********************************************************************
*
- * EditWndProc()
+ * EditWndProc (USER32.@)
*
* The messages are in the order of the actual integer values
* (which can be found in include/windows.h)
@@ -353,8 +371,7 @@
* names).
*
*/
-LRESULT WINAPI EditWndProc( HWND hwnd, UINT msg,
- WPARAM wParam, LPARAM lParam )
+LRESULT WINAPI EditWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
WND *wnd = WIN_FindWndPtr(hwnd);
EDITSTATE *es = *(EDITSTATE **)((wnd)->wExtra);
diff --git a/controls/icontitle.c b/controls/icontitle.c
index edee6fb..85f9c5b 100644
--- a/controls/icontitle.c
+++ b/controls/icontitle.c
@@ -12,24 +12,30 @@
#include "winuser.h"
#include "wine/winuser16.h"
#include "wine/unicode.h"
+#include "controls.h"
#include "win.h"
#include "heap.h"
static BOOL bMultiLineTitle;
static HFONT hIconTitleFont;
-/***********************************************************************
- * ICONTITLE_Init
- */
-BOOL ICONTITLE_Init(void)
-{
- LOGFONTA logFont;
+static LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
- SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0, &logFont, 0 );
- SystemParametersInfoA( SPI_GETICONTITLEWRAP, 0, &bMultiLineTitle, 0 );
- hIconTitleFont = CreateFontIndirectA( &logFont );
- return (hIconTitleFont) ? TRUE : FALSE;
-}
+/*********************************************************************
+ * icon title class descriptor
+ */
+const struct builtin_class_descr ICONTITLE_builtin_class =
+{
+ ICONTITLE_CLASS_ATOM, /* name */
+ CS_GLOBALCLASS, /* style */
+ NULL, /* procA (winproc is Unicode only) */
+ IconTitleWndProc, /* procW */
+ 0, /* extra */
+ IDC_ARROWA, /* cursor */
+ 0 /* brush */
+};
+
+
/***********************************************************************
* ICONTITLE_Create
@@ -194,6 +200,16 @@
switch( msg )
{
+ case WM_CREATE:
+ if (!hIconTitleFont)
+ {
+ LOGFONTA logFont;
+ SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0, &logFont, 0 );
+ SystemParametersInfoA( SPI_GETICONTITLEWRAP, 0, &bMultiLineTitle, 0 );
+ hIconTitleFont = CreateFontIndirectA( &logFont );
+ }
+ retvalue = (hIconTitleFont) ? 0 : -1;
+ goto END;
case WM_NCHITTEST:
retvalue = HTCAPTION;
goto END;
@@ -243,7 +259,7 @@
}
}
- retvalue = DefWindowProcA( hWnd, msg, wParam, lParam );
+ retvalue = DefWindowProcW( hWnd, msg, wParam, lParam );
END:
WIN_ReleaseWndPtr(wnd);
return retvalue;
diff --git a/controls/listbox.c b/controls/listbox.c
index 0959e2a..e4e69c9 100644
--- a/controls/listbox.c
+++ b/controls/listbox.c
@@ -18,7 +18,7 @@
#include "spy.h"
#include "selectors.h"
#include "win.h"
-#include "combo.h"
+#include "controls.h"
#include "debugtools.h"
#include "tweak.h"
@@ -111,6 +111,39 @@
static TIMER_DIRECTION LISTBOX_Timer = LB_TIMER_NONE;
+static LRESULT WINAPI ComboLBWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+static LRESULT WINAPI ListBoxWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+
+
+/*********************************************************************
+ * listbox class descriptor
+ */
+const struct builtin_class_descr LISTBOX_builtin_class =
+{
+ "ListBox", /* name */
+ CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/, /* style */
+ ListBoxWndProcA, /* procA */
+ NULL, /* procW (FIXME) */
+ sizeof(LB_DESCR *), /* extra */
+ IDC_ARROWA, /* cursor */
+ 0 /* brush */
+};
+
+
+/*********************************************************************
+ * combolbox class descriptor
+ */
+const struct builtin_class_descr COMBOLBOX_builtin_class =
+{
+ "ComboLBox", /* name */
+ CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS, /* style */
+ ComboLBWndProcA, /* procA */
+ NULL, /* procW (FIXME) */
+ sizeof(LB_DESCR *), /* extra */
+ IDC_ARROWA, /* cursor */
+ 0 /* brush */
+};
+
/***********************************************************************
* LISTBOX_Dump
@@ -2855,13 +2888,12 @@
}
/***********************************************************************
- * ListBoxWndProc
+ * ListBoxWndProcA
*
* This is just a wrapper for the real wndproc, it only does window locking
* and unlocking.
*/
-LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
- WPARAM wParam, LPARAM lParam )
+static LRESULT WINAPI ListBoxWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
WND* wndPtr = WIN_FindWndPtr( hwnd );
LRESULT res = ListBoxWndProc_locked(wndPtr,msg,wParam,lParam);
@@ -2968,7 +3000,7 @@
/*
* If we are in Win3.1 look, go with the default behavior.
*/
- return ListBoxWndProc( hwnd, msg, wParam, lParam );
+ return ListBoxWndProcA( hwnd, msg, wParam, lParam );
}
case WM_LBUTTONUP:
if (TWEAK_WineLook > WIN31_LOOK)
@@ -3029,7 +3061,7 @@
case LB_SETCURSEL16:
case LB_SETCURSEL:
- lRet = ListBoxWndProc( hwnd, msg, wParam, lParam );
+ lRet = ListBoxWndProcA( hwnd, msg, wParam, lParam );
lRet =(lRet == LB_ERR) ? lRet : descr->selected_item;
return lRet;
case WM_NCDESTROY:
@@ -3038,7 +3070,7 @@
/* fall through */
default:
- return ListBoxWndProc( hwnd, msg, wParam, lParam );
+ return ListBoxWndProcA( hwnd, msg, wParam, lParam );
}
}
lRet = DefWindowProcA( hwnd, msg, wParam, lParam );
@@ -3057,7 +3089,7 @@
* This is just a wrapper for the real wndproc, it only does window locking
* and unlocking.
*/
-LRESULT WINAPI ComboLBWndProc( HWND hwnd, UINT msg,
+LRESULT WINAPI ComboLBWndProcA( HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam )
{
WND *wnd = WIN_FindWndPtr( hwnd );
diff --git a/controls/menu.c b/controls/menu.c
index 0b10c9a..f825a38 100644
--- a/controls/menu.c
+++ b/controls/menu.c
@@ -26,7 +26,7 @@
#include "win.h"
#include "task.h"
#include "heap.h"
-#include "menu.h"
+#include "controls.h"
#include "nonclient.h"
#include "user.h"
#include "message.h"
@@ -176,6 +176,23 @@
/* Flag set by EndMenu() to force an exit from menu tracking */
static BOOL fEndMenu = FALSE;
+static LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
+
+
+/*********************************************************************
+ * menu class descriptor
+ */
+const struct builtin_class_descr MENU_builtin_class =
+{
+ POPUPMENU_CLASS_ATOM, /* name */
+ CS_GLOBALCLASS | CS_SAVEBITS, /* style */
+ NULL, /* procA (winproc is Unicode only) */
+ PopupMenuWndProc, /* procW */
+ sizeof(HMENU), /* extra */
+ IDC_ARROWA, /* cursor */
+ COLOR_MENU+1 /* brush */
+};
+
/***********************************************************************
* debug_print_menuitem
@@ -3163,12 +3180,8 @@
*
* NOTE: Windows has totally different (and undocumented) popup wndproc.
*/
-LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam,
- LPARAM lParam )
-{
- WND* wndPtr = WIN_FindWndPtr(hwnd);
- LRESULT retvalue;
-
+static LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
+{
TRACE("hwnd=0x%04x msg=0x%04x wp=0x%04x lp=0x%08lx\n",
hwnd, message, wParam, lParam);
@@ -3176,15 +3189,13 @@
{
case WM_CREATE:
{
- CREATESTRUCTA *cs = (CREATESTRUCTA*)lParam;
- SetWindowLongA( hwnd, 0, (LONG)cs->lpCreateParams );
- retvalue = 0;
- goto END;
+ CREATESTRUCTW *cs = (CREATESTRUCTW*)lParam;
+ SetWindowLongW( hwnd, 0, (LONG)cs->lpCreateParams );
+ return 0;
}
case WM_MOUSEACTIVATE: /* We don't want to be activated */
- retvalue = MA_NOACTIVATE;
- goto END;
+ return MA_NOACTIVATE;
case WM_PAINT:
{
@@ -3193,12 +3204,10 @@
MENU_DrawPopupMenu( hwnd, ps.hdc,
(HMENU)GetWindowLongA( hwnd, 0 ) );
EndPaint( hwnd, &ps );
- retvalue = 0;
- goto END;
+ return 0;
}
case WM_ERASEBKGND:
- retvalue = 1;
- goto END;
+ return 1;
case WM_DESTROY:
@@ -3224,31 +3233,23 @@
if( wParam )
{
- if( !(*(HMENU*)wndPtr->wExtra) )
- ERR("no menu to display\n");
+ if (!GetWindowLongW( hwnd, 0 )) ERR("no menu to display\n");
}
else
- *(HMENU*)wndPtr->wExtra = 0;
+ SetWindowLongW( hwnd, 0, 0 );
break;
case MM_SETMENUHANDLE:
-
- *(HMENU*)wndPtr->wExtra = (HMENU)wParam;
+ SetWindowLongW( hwnd, 0, wParam );
break;
case MM_GETMENUHANDLE:
-
- retvalue = *(HMENU*)wndPtr->wExtra;
- goto END;
+ return GetWindowLongW( hwnd, 0 );
default:
- retvalue = DefWindowProcA( hwnd, message, wParam, lParam );
- goto END;
+ return DefWindowProcW( hwnd, message, wParam, lParam );
}
- retvalue = 0;
-END:
- WIN_ReleaseWndPtr(wndPtr);
- return retvalue;
+ return 0;
}
diff --git a/controls/scroll.c b/controls/scroll.c
index 102ccfd..ec7049f 100644
--- a/controls/scroll.c
+++ b/controls/scroll.c
@@ -8,7 +8,7 @@
#include "windef.h"
#include "wingdi.h"
#include "wine/winuser16.h"
-#include "scroll.h"
+#include "controls.h"
#include "heap.h"
#include "win.h"
#include "debugtools.h"
@@ -17,19 +17,28 @@
DEFAULT_DEBUG_CHANNEL(scroll);
+typedef struct
+{
+ INT CurVal; /* Current scroll-bar value */
+ INT MinVal; /* Minimum scroll-bar value */
+ INT MaxVal; /* Maximum scroll-bar value */
+ INT Page; /* Page size of scroll bar (Win32) */
+ UINT flags; /* EnableScrollBar flags */
+} SCROLLBAR_INFO;
-static HBITMAP hUpArrow = 0;
-static HBITMAP hDnArrow = 0;
-static HBITMAP hLfArrow = 0;
-static HBITMAP hRgArrow = 0;
-static HBITMAP hUpArrowD = 0;
-static HBITMAP hDnArrowD = 0;
-static HBITMAP hLfArrowD = 0;
-static HBITMAP hRgArrowD = 0;
-static HBITMAP hUpArrowI = 0;
-static HBITMAP hDnArrowI = 0;
-static HBITMAP hLfArrowI = 0;
-static HBITMAP hRgArrowI = 0;
+
+static HBITMAP hUpArrow;
+static HBITMAP hDnArrow;
+static HBITMAP hLfArrow;
+static HBITMAP hRgArrow;
+static HBITMAP hUpArrowD;
+static HBITMAP hDnArrowD;
+static HBITMAP hLfArrowD;
+static HBITMAP hRgArrowD;
+static HBITMAP hUpArrowI;
+static HBITMAP hDnArrowI;
+static HBITMAP hLfArrowI;
+static HBITMAP hRgArrowI;
#define TOP_ARROW(flags,pressed) \
(((flags)&ESB_DISABLE_UP) ? hUpArrowI : ((pressed) ? hUpArrowD:hUpArrow))
@@ -98,6 +107,22 @@
INT thumbSize, INT thumbPos,
UINT flags, BOOL vertical,
BOOL top_selected, BOOL bottom_selected );
+static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
+
+
+/*********************************************************************
+ * scrollbar class descriptor
+ */
+const struct builtin_class_descr SCROLL_builtin_class =
+{
+ "ScrollBar", /* name */
+ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC, /* style */
+ NULL, /* procA (winproc is Unicode only) */
+ ScrollBarWndProc, /* procW */
+ sizeof(SCROLLBAR_INFO), /* extra */
+ IDC_ARROWA, /* cursor */
+ 0 /* brush */
+};
/***********************************************************************
@@ -878,7 +903,7 @@
WIN_ReleaseWndPtr(wndPtr);
return;
}
- SendMessageA( GetParent(hwnd),
+ SendMessageW( GetParent(hwnd),
(wndPtr->dwStyle & SBS_VERT) ? WM_VSCROLL : WM_HSCROLL,
msg, hwnd );
WIN_ReleaseWndPtr(wndPtr);
@@ -1109,20 +1134,18 @@
/***********************************************************************
* ScrollBarWndProc
*/
-LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
- LPARAM lParam )
+static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
{
switch(message)
{
case WM_CREATE:
{
- CREATESTRUCTA *lpCreat = (CREATESTRUCTA *)lParam;
+ CREATESTRUCTW *lpCreat = (CREATESTRUCTW *)lParam;
if (lpCreat->style & SBS_SIZEBOX)
{
FIXME("Unimplemented style SBS_SIZEBOX.\n" );
return 0;
}
-
if (lpCreat->style & SBS_VERT)
{
if (lpCreat->style & SBS_LEFTALIGN)
@@ -1285,7 +1308,7 @@
if (message >= WM_USER)
WARN("unknown msg %04x wp=%04x lp=%08lx\n",
message, wParam, lParam );
- return DefWindowProcA( hwnd, message, wParam, lParam );
+ return DefWindowProcW( hwnd, message, wParam, lParam );
}
return 0;
}
diff --git a/controls/static.c b/controls/static.c
index f27b30b..951e4ad 100644
--- a/controls/static.c
+++ b/controls/static.c
@@ -10,7 +10,7 @@
#include "wine/winuser16.h"
#include "win.h"
#include "cursoricon.h"
-#include "static.h"
+#include "controls.h"
#include "heap.h"
#include "debugtools.h"
#include "tweak.h"
@@ -23,9 +23,16 @@
static void STATIC_PaintIconfn( WND *wndPtr, HDC hdc );
static void STATIC_PaintBitmapfn( WND *wndPtr, HDC hdc );
static void STATIC_PaintEtchedfn( WND *wndPtr, HDC hdc );
+static LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
static COLORREF color_windowframe, color_background, color_window;
+typedef struct
+{
+ HFONT16 hFont; /* Control font (or 0 for system font) */
+ WORD dummy; /* Don't know what MS-Windows puts in there */
+ HICON16 hIcon; /* Icon handle for SS_ICON controls */
+} STATICINFO;
typedef void (*pfPaint)( WND *, HDC );
@@ -53,6 +60,21 @@
};
+/*********************************************************************
+ * static class descriptor
+ */
+const struct builtin_class_descr STATIC_builtin_class =
+{
+ "Static", /* name */
+ CS_GLOBALCLASS | CS_DBLCLKS | CS_PARENTDC, /* style */
+ StaticWndProcA, /* procA */
+ NULL, /* procW (FIXME) */
+ sizeof(STATICINFO), /* extra */
+ IDC_ARROWA, /* cursor */
+ 0 /* brush */
+};
+
+
/***********************************************************************
* STATIC_SetIcon
*
@@ -135,10 +157,9 @@
/***********************************************************************
- * StaticWndProc
+ * StaticWndProcA
*/
-LRESULT WINAPI StaticWndProc( HWND hWnd, UINT uMsg, WPARAM wParam,
- LPARAM lParam )
+static LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
LRESULT lResult = 0;
WND *wndPtr = WIN_FindWndPtr(hWnd);
diff --git a/controls/widgets.c b/controls/widgets.c
deleted file mode 100644
index bc7ab1d..0000000
--- a/controls/widgets.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Windows widgets (built-in window classes)
- *
- * Copyright 1993 Alexandre Julliard
- */
-
-#include <assert.h>
-#include <string.h>
-
-#include "win.h"
-#include "button.h"
-#include "combo.h"
-#include "desktop.h"
-#include "gdi.h"
-#include "heap.h"
-#include "mdi.h"
-#include "menu.h"
-#include "scroll.h"
-#include "static.h"
-#include "wine/unicode.h"
-
-struct builtin_class
-{
- LPCSTR name;
- UINT style;
- WNDPROC procA;
- WNDPROC procW;
- INT extra;
- LPCSTR cursor;
- HBRUSH brush;
-};
-
-/* Under NT all builtin classes have both ASCII and Unicode window
- * procedures except ScrollBar, PopupMenu, Desktop, WinSwitch and
- * IconTitle which are Unicode-only.
- */
-static const struct builtin_class classes[] =
-{
- { "Button", CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
- ButtonWndProcA, ButtonWndProcW, sizeof(BUTTONINFO), IDC_ARROWA, 0 },
- { "Edit", CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/,
- EditWndProc, NULL, sizeof(void *), IDC_IBEAMA, 0 },
- { "ListBox", CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/,
- ListBoxWndProc, NULL, sizeof(void *), IDC_ARROWA, 0 },
- { "ComboBox", CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
- ComboWndProc, NULL, sizeof(void *), IDC_ARROWA, 0 },
- { "ComboLBox", CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS,
- ComboLBWndProc, NULL, sizeof(void *), IDC_ARROWA, 0 },
- { "Static", CS_GLOBALCLASS | CS_DBLCLKS | CS_PARENTDC,
- StaticWndProc, NULL, sizeof(STATICINFO), IDC_ARROWA, 0 },
- { "ScrollBar", CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
- ScrollBarWndProc, NULL, sizeof(SCROLLBAR_INFO), IDC_ARROWA, 0 },
- { "MDIClient", CS_GLOBALCLASS,
- MDIClientWndProc, NULL, sizeof(MDICLIENTINFO), IDC_ARROWA, STOCK_LTGRAY_BRUSH },
- { POPUPMENU_CLASS_NAME, CS_GLOBALCLASS | CS_SAVEBITS,
- PopupMenuWndProc, NULL, sizeof(HMENU), IDC_ARROWA, COLOR_MENU+1 },
- { DESKTOP_CLASS_NAME, CS_GLOBALCLASS,
- DesktopWndProc, NULL, sizeof(DESKTOP), IDC_ARROWA, COLOR_BACKGROUND+1 },
- { DIALOG_CLASS_NAME, CS_GLOBALCLASS | CS_SAVEBITS,
- DefDlgProcA, DefDlgProcW, DLGWINDOWEXTRA, IDC_ARROWA, 0 },
- { ICONTITLE_CLASS_NAME, CS_GLOBALCLASS,
- IconTitleWndProc, NULL, 0, IDC_ARROWA, 0 }
-};
-
-
-/***********************************************************************
- * WIDGETS_Init
- *
- * Initialize the built-in window classes.
- */
-BOOL WIDGETS_Init(void)
-{
- const struct builtin_class *cls = classes;
- int i;
-
- for (i = 0; i < sizeof(classes)/sizeof(classes[0]); i++, cls++)
- {
- if (!CLASS_RegisterBuiltinClass( cls->name, cls->style, cls->extra, cls->cursor,
- cls->brush, cls->procA, cls->procW ))
- return FALSE;
- }
- return TRUE;
-}