From fcc9d131360d8fdd69d59f647a239d24bcb55f5a Mon Sep 17 00:00:00 2001 From: Dave Pickles Date: Sat, 10 Oct 1998 15:52:46 +0000 Subject: [PATCH] Implemented DS_CENTER dialog style. --- windows/dialog.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/windows/dialog.c b/windows/dialog.c index 49f42ce5cc4..d636937f324 100644 --- a/windows/dialog.c +++ b/windows/dialog.c @@ -622,8 +622,16 @@ HWND32 DIALOG_CreateIndirect( HINSTANCE32 hInst, LPCSTR dlgTemplate, } else { - rect.left += template.x * xUnit / 4; - rect.top += template.y * yUnit / 8; + if (template.style & DS_CENTER) + { + rect.left = (SYSMETRICS_CXSCREEN - rect.right) / 2; + rect.top = (SYSMETRICS_CYSCREEN - rect.bottom) / 2; + } + else + { + rect.left += template.x * xUnit / 4; + rect.top += template.y * yUnit / 8; + } if ( !(template.style & WS_CHILD) ) { INT16 dX, dY;