From 1d82f1300512794ab210aec8075e2b135fdf557d Mon Sep 17 00:00:00 2001 From: "sfraser%netscape.com" Date: Thu, 24 Aug 2000 01:36:46 +0000 Subject: [PATCH] Fix for 41741, allow resizable dialogs on Mac. Note that we now have a stricter matching between XUL dialog attributes, and the window type. This means that some dialogs that used to have a titlebar now won't have one on Mac, so you should add "titlebar" where appropriate. r=danm --- widget/src/mac/nsMacWindow.cpp | 54 ++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/widget/src/mac/nsMacWindow.cpp b/widget/src/mac/nsMacWindow.cpp index a7723e39120a..b99901b95aa0 100644 --- a/widget/src/mac/nsMacWindow.cpp +++ b/widget/src/mac/nsMacWindow.cpp @@ -364,20 +364,50 @@ nsresult nsMacWindow::StandardCreate(nsIWidget *aParent, case eWindowType_dialog: #if !TARGET_CARBON - if (aInitData && - aInitData->mBorderStyle != eBorderStyle_all && - aInitData->mBorderStyle != eBorderStyle_default && - (aInitData->mBorderStyle == eBorderStyle_none || - !(aInitData->mBorderStyle & eBorderStyle_title))) - { + if (aInitData) + { + switch (aInitData->mBorderStyle) + { + case eBorderStyle_none: + wDefProcID = kWindowModalDialogProc; + break; + + case eBorderStyle_all: + wDefProcID = kWindowMovableModalGrowProc; // should we add a close box (kWindowGrowDocumentProc) ? + break; + + case eBorderStyle_default: + wDefProcID = kWindowModalDialogProc; + break; + + default: + // we ignore the clase flag here, since mac dialogs should never have a close box. + switch(aInitData->mBorderStyle & (eBorderStyle_resizeh | eBorderStyle_title)) + { + // combinations of individual options. + case eBorderStyle_title: + wDefProcID = kWindowMovableModalDialogProc; + break; + + case eBorderStyle_resizeh: + case (eBorderStyle_title | eBorderStyle_resizeh): + wDefProcID = kWindowMovableModalGrowProc; // this is the only kind of resizable dialog. + break; + + default: + NS_WARNING("Unhandled combination of window flags"); + break; + } + } + } + else + { wDefProcID = kWindowModalDialogProc; - goAwayFlag = false; - } else { - wDefProcID = kWindowMovableModalDialogProc; goAwayFlag = true; // revisit this below - } - hOffset = kDialogMarginWidth; - vOffset = kDialogTitleBarHeight; + } + + hOffset = kDialogMarginWidth; + vOffset = kDialogTitleBarHeight; break; #endif