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

This commit is contained in:
sfraser%netscape.com 2000-08-24 01:36:46 +00:00
Родитель 7fab06d51e
Коммит 1d82f13005
1 изменённых файлов: 42 добавлений и 12 удалений

Просмотреть файл

@ -364,18 +364,48 @@ nsresult nsMacWindow::StandardCreate(nsIWidget *aParent,
case eWindowType_dialog: case eWindowType_dialog:
#if !TARGET_CARBON #if !TARGET_CARBON
if (aInitData && if (aInitData)
aInitData->mBorderStyle != eBorderStyle_all && {
aInitData->mBorderStyle != eBorderStyle_default && switch (aInitData->mBorderStyle)
(aInitData->mBorderStyle == eBorderStyle_none || {
!(aInitData->mBorderStyle & eBorderStyle_title))) 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; wDefProcID = kWindowModalDialogProc;
goAwayFlag = false;
} else {
wDefProcID = kWindowMovableModalDialogProc;
goAwayFlag = true; // revisit this below goAwayFlag = true; // revisit this below
} }
hOffset = kDialogMarginWidth; hOffset = kDialogMarginWidth;
vOffset = kDialogTitleBarHeight; vOffset = kDialogTitleBarHeight;
break; break;