From 938493d4132e5aa52d777f76eeed195ff9b74678 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 27 Jul 2003 17:48:43 +0000 Subject: [PATCH] Added dialog class registration. Patch by Thomas Weidenmueller. svn path=/trunk/; revision=5290 --- reactos/lib/user32/controls/regcontrol.c | 7 +++-- reactos/lib/user32/user32.rc | 35 +++++++++++++++++++++++- reactos/lib/user32/windows/dialog.c | 22 ++++++++++++++- 3 files changed, 59 insertions(+), 5 deletions(-) diff --git a/reactos/lib/user32/controls/regcontrol.c b/reactos/lib/user32/controls/regcontrol.c index b88a3b1d261..2296172b413 100644 --- a/reactos/lib/user32/controls/regcontrol.c +++ b/reactos/lib/user32/controls/regcontrol.c @@ -1,4 +1,4 @@ -/* $Id: regcontrol.c,v 1.6 2003/07/11 18:00:14 sedwards Exp $ +/* $Id: regcontrol.c,v 1.7 2003/07/27 17:47:35 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS User32 @@ -13,7 +13,7 @@ #include "user32/regcontrol.h" static void RegisterBuiltinClass(const struct builtin_class_descr *Descr) - { +{ WNDCLASSA wca; wca.lpszClassName = Descr->name; @@ -28,7 +28,7 @@ static void RegisterBuiltinClass(const struct builtin_class_descr *Descr) wca.cbWndExtra = Descr->extra; RegisterClassA(&wca); - } +} /*********************************************************************** * ControlsInit @@ -37,6 +37,7 @@ static void RegisterBuiltinClass(const struct builtin_class_descr *Descr) */ void ControlsInit(void) { + RegisterBuiltinClass(&DIALOG_builtin_class); #if 0 RegisterBuiltinClass(&COMBO_builtin_class); RegisterBuiltinClass(&COMBOLBOX_builtin_class); diff --git a/reactos/lib/user32/user32.rc b/reactos/lib/user32/user32.rc index 0da78dfdf69..7d162f7d5d0 100644 --- a/reactos/lib/user32/user32.rc +++ b/reactos/lib/user32/user32.rc @@ -1,5 +1,6 @@ #include #include +#include LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US @@ -43,7 +44,7 @@ OBM_CLOSE BITMAP "resources/obm_close.bmp" // Dialog // -MSGBOX DIALOG DISCARDABLE 100, 80, 216, 168 +MSGBOX DIALOG DISCARDABLE 100, 80, 375, 168 STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU FONT 8, "MS Sans Serif" @@ -60,3 +61,35 @@ BEGIN END +/* Menus */ + +EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE +{ + POPUP "" + BEGIN + MENUITEM "&Undo", EM_UNDO + MENUITEM SEPARATOR + MENUITEM "Cu&t", WM_CUT + MENUITEM "&Copy", WM_COPY + MENUITEM "&Paste", WM_PASTE + MENUITEM "&Delete", WM_CLEAR + MENUITEM SEPARATOR + MENUITEM "Select &All", EM_SETSEL + END +} + + +SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE +{ + MENUITEM "&Restore", 61728 + MENUITEM "&Move", 61456 + MENUITEM "&Size", 61440 + MENUITEM "Mi&nimize", 61472 + MENUITEM "Ma&ximize", 61488 + MENUITEM SEPARATOR + MENUITEM "&Close\tAlt-F4", 61536 +// MENUITEM SEPARATOR +// MENUITEM "&Switch to ...\tCtrl-Esc", 61744 +// MENUITEM SEPARATOR +// MENUITEM "&About ReactOS ...", 61761 +} diff --git a/reactos/lib/user32/windows/dialog.c b/reactos/lib/user32/windows/dialog.c index b2df6c93506..bddcc8b5cdb 100644 --- a/reactos/lib/user32/windows/dialog.c +++ b/reactos/lib/user32/windows/dialog.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dialog.c,v 1.12 2003/07/26 23:12:08 royce Exp $ +/* $Id: dialog.c,v 1.13 2003/07/27 17:48:43 ekohl Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -38,6 +38,10 @@ #include #include +#include "user32/regcontrol.h" +#include "../controls/controls.h" + + /* MACROS/DEFINITIONS ********************************************************/ #define DF_END 0x0001 @@ -111,6 +115,22 @@ typedef struct HWND control; } GETDLGITEMINFO; + +/********************************************************************* + * dialog class descriptor + */ +const struct builtin_class_descr DIALOG_builtin_class = +{ + DIALOG_CLASS_ATOMA, /* name */ + CS_GLOBALCLASS | CS_SAVEBITS | CS_DBLCLKS, /* style */ + (WNDPROC) DefDlgProcA, /* procA */ + (WNDPROC) DefDlgProcW, /* procW */ + sizeof(DIALOGINFO *), /* extra */ + (LPCSTR) IDC_ARROW, /* cursor */ + 0 /* brush */ +}; + + /* INTERNAL FUNCTIONS ********************************************************/ /***********************************************************************