X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c4e8f384d7c9a2e1f31e9602917f2d1318de01f..6f026b5b63fe7ccb025e84509886f74772b9df13:/src/cocoa/dialog.mm?ds=sidebyside diff --git a/src/cocoa/dialog.mm b/src/cocoa/dialog.mm index f8d3faeafb..8782dfab33 100644 --- a/src/cocoa/dialog.mm +++ b/src/cocoa/dialog.mm @@ -4,9 +4,8 @@ // Author: David Elliott // Modified by: // Created: 2002/12/15 -// RCS-ID: $Id$ // Copyright: 2002 David Elliott -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -19,6 +18,7 @@ #include "wx/settings.h" #endif //WX_PRECOMP +#include "wx/modalhook.h" #include "wx/cocoa/autorelease.h" #include "wx/cocoa/string.h" @@ -57,13 +57,9 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID winid, if (parent) parent->AddChild(this); - NSRect cocoaRect = NSMakeRect(300,300,200,200); + unsigned int cocoaStyle = NSWindowStyleForWxStyle(style); - unsigned int cocoaStyle = 0; - cocoaStyle |= NSTitledWindowMask; - cocoaStyle |= NSClosableWindowMask; - cocoaStyle |= NSMiniaturizableWindowMask; - cocoaStyle |= NSResizableWindowMask; + NSRect cocoaRect = MakeInitialNSWindowContentRect(pos,size,cocoaStyle); m_cocoaNSWindow = NULL; SetNSPanel([[NSPanel alloc] initWithContentRect:cocoaRect styleMask:cocoaStyle backing:NSBackingStoreBuffered defer:NO]); @@ -103,6 +99,10 @@ bool wxDialog::Show(bool show) if(show) { wxAutoNSAutoreleasePool pool; + + if (CanDoLayoutAdaptation()) + DoLayoutAdaptation(); + InitDialog(); if(IsModal()) { // ShowModal() will show the dialog @@ -127,6 +127,8 @@ bool wxDialog::Show(bool show) // is stopped (via EndModal()) it returns the exit code. int wxDialog::ShowModal() { + WX_HOOK_MODAL_DIALOG(); + wxCHECK_MSG(!IsModal(),GetReturnCode(),wxT("wxDialog::ShowModal called within its own modal loop")); // Show(true) will set m_isShown = true