Author: cwittich Date: Sat Oct 17 22:00:54 2009 New Revision: 43541
URL: http://svn.reactos.org/svn/reactos?rev=43541&view=rev Log: sync dialog to wine 1.1.31 (fixes one dialog winetest)
Modified: trunk/reactos/dll/win32/user32/windows/dialog.c
Modified: trunk/reactos/dll/win32/user32/windows/dialog.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/di... ============================================================================== --- trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] Sat Oct 17 22:00:54 2009 @@ -181,10 +181,11 @@ if (hOwner) hOwner = GetAncestor( hOwner, GA_ROOT ); if (!hOwner) return; - EnableWindow( hOwner, TRUE ); -} - - /*********************************************************************** + EnableWindow( hOwner, TRUE ); +} + + +/*********************************************************************** * DIALOG_DisableOwner * * Helper function for modal dialogs to disable the @@ -205,7 +206,7 @@ return FALSE; }
- /*********************************************************************** +/*********************************************************************** * DIALOG_GetControl32 * * Return the class and text of the control pointed to by ptr, @@ -303,10 +304,11 @@ p++;
/* Next control is on dword boundary */ - return (const WORD *)((((int)p) + 3) & ~3); -} - - /*********************************************************************** + return (const WORD *)(((UINT_PTR)p + 3) & ~3); +} + + +/*********************************************************************** * DIALOG_CreateControls32 * * Create the control windows for a dialog. @@ -645,9 +647,9 @@ /* Get the font name */
result->pointSize = 0; + result->faceName = NULL; result->weight = FW_DONTCARE; result->italic = FALSE; - result->faceName = NULL;
if (result->style & DS_SETFONT) { @@ -660,18 +662,18 @@ */ if (result->pointSize == 0x7fff) { - /* We could call SystemParametersInfo here, but then we'd have - * to convert from pixel size to point size (which can be - * imprecise). - */ + /* We could call SystemParametersInfo here, but then we'd have + * to convert from pixel size to point size (which can be + * imprecise). + */ TRACE(" FONT: Using message box font\n"); } else { if (result->dialogEx) { - result->weight = GET_WORD(p); p++; - result->italic = LOBYTE(GET_WORD(p)); p++; + result->weight = GET_WORD(p); p++; + result->italic = LOBYTE(GET_WORD(p)); p++; } result->faceName = (LPCWSTR)p; p += wcslen( result->faceName ) + 1; @@ -726,7 +728,7 @@ /* If no saved focus control exists, set focus to the first visible, non-disabled, WS_TABSTOP control in the dialog */ infoPtr->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE ); - if (!IsWindow( infoPtr->hwndFocus )) return; + if (!IsWindow( infoPtr->hwndFocus )) return; } DEFDLG_SetFocus( hwnd, infoPtr->hwndFocus );
@@ -783,20 +785,19 @@ ncMetrics.cbSize = sizeof(NONCLIENTMETRICSW); if (SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSW), &ncMetrics, 0)) - { - hUserFont = CreateFontIndirectW( &ncMetrics.lfMessageFont ); - } - } - else - { - /* We convert the size to pixels and then make it -ve. This works - * for both +ve and -ve template.pointSize */ - int pixels; - pixels = MulDiv(template.pointSize, GetDeviceCaps(dc , LOGPIXELSY), 72); - hUserFont = CreateFontW( -pixels, 0, 0, 0, template.weight, - template.italic, FALSE, FALSE, DEFAULT_CHARSET, 0, 0, - PROOF_QUALITY, FF_DONTCARE, - template.faceName ); + { + hUserFont = CreateFontIndirectW( &ncMetrics.lfMessageFont ); + } + } + else + { + /* We convert the size to pixels and then make it -ve. This works + * for both +ve and -ve template.pointSize */ + int pixels = MulDiv(template.pointSize, GetDeviceCaps(dc , LOGPIXELSY), 72); + hUserFont = CreateFontW( -pixels, 0, 0, 0, template.weight, + template.italic, FALSE, FALSE, DEFAULT_CHARSET, 0, 0, + PROOF_QUALITY, FF_DONTCARE, + template.faceName ); }
if (hUserFont) @@ -840,7 +841,7 @@ { HMONITOR monitor = 0; MONITORINFO mon_info; - + mon_info.cbSize = sizeof(mon_info); if (template.style & DS_CENTER) { @@ -947,7 +948,7 @@ dlgInfo->hMenu = hMenu; dlgInfo->xBaseUnit = xBaseUnit; dlgInfo->yBaseUnit = yBaseUnit; - dlgInfo->idResult = 0; + dlgInfo->idResult = IDOK; dlgInfo->flags = flags; /* dlgInfo->hDialogHeap = 0; */
@@ -993,6 +994,7 @@ if( IsWindow(hwnd) ) DestroyWindow( hwnd ); return 0; } +
/*********************************************************************** * DEFDLG_FindDefButton