comparison mac/dw.m @ 800:e5a0a1a3ee03

dw_window_enable() and dw_window_disable() now function as expected on MLE controls.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 23 Mar 2011 19:43:04 +0000
parents 3aa5d0777af2
children 5d8e4ecb7820
comparison
equal deleted inserted replaced
799:3aa5d0777af2 800:e5a0a1a3ee03
6396 * Parameters: 6396 * Parameters:
6397 * handle: Handle to the window. 6397 * handle: Handle to the window.
6398 */ 6398 */
6399 void API dw_window_disable(HWND handle) 6399 void API dw_window_disable(HWND handle)
6400 { 6400 {
6401 NSObject *object = handle; 6401 id object = handle;
6402 if([ object isKindOfClass:[ NSControl class ] ]) 6402
6403 { 6403 if([object isMemberOfClass:[NSScrollView class]])
6404 NSControl *control = handle; 6404 {
6405 NSScrollView *sv = handle;
6406 object = [sv documentView];
6407 }
6408 if([object isKindOfClass:[NSControl class]])
6409 {
6410 NSControl *control = object;
6405 [control setEnabled:NO]; 6411 [control setEnabled:NO];
6406 } 6412 }
6413 if([object isKindOfClass:[NSTextView class]])
6414 {
6415 NSTextView *mle = object;
6416
6417 [mle setEditable:NO];
6418 }
6407 } 6419 }
6408 6420
6409 /* 6421 /*
6410 * Enables given window (widget). 6422 * Enables given window (widget).
6411 * Parameters: 6423 * Parameters:
6412 * handle: Handle to the window. 6424 * handle: Handle to the window.
6413 */ 6425 */
6414 void API dw_window_enable(HWND handle) 6426 void API dw_window_enable(HWND handle)
6415 { 6427 {
6416 NSObject *object = handle; 6428 id object = handle;
6417 if([ object isKindOfClass:[ NSControl class ] ]) 6429
6418 { 6430 if([object isMemberOfClass:[NSScrollView class]])
6419 NSControl *control = handle; 6431 {
6432 NSScrollView *sv = handle;
6433 object = [sv documentView];
6434 }
6435 if([object isKindOfClass:[NSControl class]])
6436 {
6437 NSControl *control = object;
6420 [control setEnabled:YES]; 6438 [control setEnabled:YES];
6439 }
6440 if([object isKindOfClass:[NSTextView class]])
6441 {
6442 NSTextView *mle = object;
6443
6444 [mle setEditable:YES];
6421 } 6445 }
6422 } 6446 }
6423 6447
6424 /* 6448 /*
6425 * Sets the bitmap used for a given static window. 6449 * Sets the bitmap used for a given static window.