# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1299158270 0 # Node ID 014b02436c1f8425f90fd06dca4bd01920426e88 # Parent 7385011c3327aa93acaea87f0917818ad0200235 Added MDI simulation code... the MDI "window" will just be a box for coloring and placeholder purposes. The windows attached to it won't be constrained to the MDI area but will be floating and hide on deactivate. diff -r 7385011c3327 -r 014b02436c1f mac/dw.m --- a/mac/dw.m Wed Mar 02 18:03:34 2011 +0000 +++ b/mac/dw.m Thu Mar 03 13:17:50 2011 +0000 @@ -1043,6 +1043,16 @@ -(void)dealloc { UserData *root = userdata; _remove_userdata(&root, NULL, TRUE); [super dealloc]; } @end +/* Subclass for a MDI type + * This is just a box for display purposes... but it is a + * unique class so it can be identified when creating windows. + */ +@interface DWMDI : DWBox {} +@end + +@implementation DWMDI +@end + /* Subclass for a test object type */ @interface DWObject : NSObject {} -(void)uselessThread:(id)sender; @@ -4157,8 +4167,13 @@ */ HWND API dw_mdi_new(unsigned long id) { - NSLog(@"dw_mdi_new() unimplemented\n"); - return HWND_DESKTOP; + /* There isn't anything like quite like MDI on MacOS... + * However we will make floating windows that hide + * when the application is deactivated to simulate + * similar behavior. + */ + DWMDI *mdi = [[DWMDI alloc] init]; + return mdi; } /* @@ -4964,6 +4979,20 @@ [window setDelegate:view]; [window makeKeyAndOrderFront:nil]; [window setAllowsConcurrentViewDrawing:NO]; + + /* If it isn't a toplevel window... */ + if(hwndOwner) + { + id object = hwndOwner; + + /* Check to see if the parent is an MDI window */ + if([object isMemberOfClass:[DWMDI class]]) + { + /* Set the window level to be floating */ + [window setLevel:NSFloatingWindowLevel]; + [window setHidesOnDeactivate:YES]; + } + } return (HWND)window; }