comparison mac/dw.m @ 684:014b02436c1f

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.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 03 Mar 2011 13:17:50 +0000
parents 7385011c3327
children 314a12dccd20
comparison
equal deleted inserted replaced
683:7385011c3327 684:014b02436c1f
1041 [stepper takeIntValueFrom:textfield]; 1041 [stepper takeIntValueFrom:textfield];
1042 } 1042 }
1043 -(void)dealloc { UserData *root = userdata; _remove_userdata(&root, NULL, TRUE); [super dealloc]; } 1043 -(void)dealloc { UserData *root = userdata; _remove_userdata(&root, NULL, TRUE); [super dealloc]; }
1044 @end 1044 @end
1045 1045
1046 /* Subclass for a MDI type
1047 * This is just a box for display purposes... but it is a
1048 * unique class so it can be identified when creating windows.
1049 */
1050 @interface DWMDI : DWBox {}
1051 @end
1052
1053 @implementation DWMDI
1054 @end
1055
1046 /* Subclass for a test object type */ 1056 /* Subclass for a test object type */
1047 @interface DWObject : NSObject {} 1057 @interface DWObject : NSObject {}
1048 -(void)uselessThread:(id)sender; 1058 -(void)uselessThread:(id)sender;
1049 @end 1059 @end
1050 1060
4155 * Parameters: 4165 * Parameters:
4156 * id: An ID to be used with dw_window_from_id or 0L. 4166 * id: An ID to be used with dw_window_from_id or 0L.
4157 */ 4167 */
4158 HWND API dw_mdi_new(unsigned long id) 4168 HWND API dw_mdi_new(unsigned long id)
4159 { 4169 {
4160 NSLog(@"dw_mdi_new() unimplemented\n"); 4170 /* There isn't anything like quite like MDI on MacOS...
4161 return HWND_DESKTOP; 4171 * However we will make floating windows that hide
4172 * when the application is deactivated to simulate
4173 * similar behavior.
4174 */
4175 DWMDI *mdi = [[DWMDI alloc] init];
4176 return mdi;
4162 } 4177 }
4163 4178
4164 /* 4179 /*
4165 * Creates a splitbar window (widget) with given parameters. 4180 * Creates a splitbar window (widget) with given parameters.
4166 * Parameters: 4181 * Parameters:
4962 4977
4963 [window setContentView:view]; 4978 [window setContentView:view];
4964 [window setDelegate:view]; 4979 [window setDelegate:view];
4965 [window makeKeyAndOrderFront:nil]; 4980 [window makeKeyAndOrderFront:nil];
4966 [window setAllowsConcurrentViewDrawing:NO]; 4981 [window setAllowsConcurrentViewDrawing:NO];
4982
4983 /* If it isn't a toplevel window... */
4984 if(hwndOwner)
4985 {
4986 id object = hwndOwner;
4987
4988 /* Check to see if the parent is an MDI window */
4989 if([object isMemberOfClass:[DWMDI class]])
4990 {
4991 /* Set the window level to be floating */
4992 [window setLevel:NSFloatingWindowLevel];
4993 [window setHidesOnDeactivate:YES];
4994 }
4995 }
4967 4996
4968 return (HWND)window; 4997 return (HWND)window;
4969 } 4998 }
4970 4999
4971 /* 5000 /*