comparison mac/dw.m @ 1848:68f923e57542

Attempt at resetting default colors with DW_CLR_DEFAULT on Mac... Not sure I used the correct ones for the correct controls or not.... will need to do some testing to see.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 29 Dec 2012 05:34:04 +0000
parents 2fe7fca61236
children b5e1ccc76e58
comparison
equal deleted inserted replaced
1847:ff80ad40a5d6 1848:68f923e57542
744 else 744 else
745 { 745 {
746 bgcolor = [[NSColor colorWithDeviceRed: DW_RED_VALUE(input)/255.0 green: DW_GREEN_VALUE(input)/255.0 blue: DW_BLUE_VALUE(input)/255.0 alpha: 1] retain]; 746 bgcolor = [[NSColor colorWithDeviceRed: DW_RED_VALUE(input)/255.0 green: DW_GREEN_VALUE(input)/255.0 blue: DW_BLUE_VALUE(input)/255.0 alpha: 1] retain];
747 [bgcolor set]; 747 [bgcolor set];
748 NSRectFill([self bounds]); 748 NSRectFill([self bounds]);
749 [self setNeedsDisplay:YES]; 749 }
750 } 750 [self setNeedsDisplay:YES];
751 [orig release]; 751 [orig release];
752 } 752 }
753 @end 753 @end
754 754
755 /* Subclass for a group box type */ 755 /* Subclass for a group box type */
8465 /* Get the cell on classes using NSCell */ 8465 /* Get the cell on classes using NSCell */
8466 if([object isKindOfClass:[NSTextField class]]) 8466 if([object isKindOfClass:[NSTextField class]])
8467 { 8467 {
8468 id cell = [object cell]; 8468 id cell = [object cell];
8469 8469
8470 if(fg) 8470 [cell setTextColor:(fg ? fg : [NSColor controlTextColor])];
8471 {
8472 [cell setTextColor:fg];
8473 }
8474 } 8471 }
8475 if([object isKindOfClass:[NSTextField class]] || [object isKindOfClass:[NSButton class]]) 8472 if([object isKindOfClass:[NSTextField class]] || [object isKindOfClass:[NSButton class]])
8476 { 8473 {
8477 id cell = [object cell]; 8474 id cell = [object cell];
8478 8475
8479 if(bg) 8476 [cell setBackgroundColor:(bg ? bg : [NSColor controlColor])];
8480 {
8481 [cell setBackgroundColor:bg];
8482 }
8483 } 8477 }
8484 else if([object isMemberOfClass:[DWBox class]]) 8478 else if([object isMemberOfClass:[DWBox class]])
8485 { 8479 {
8486 DWBox *box = object; 8480 DWBox *box = object;
8487 8481
8488 if(bg) 8482 [box setColor:_back];
8489 {
8490 [box setColor:_back];
8491 }
8492 } 8483 }
8493 else if([object isKindOfClass:[NSTableView class]]) 8484 else if([object isKindOfClass:[NSTableView class]])
8494 { 8485 {
8495 DWContainer *cont = handle; 8486 DWContainer *cont = handle;
8496 8487
8497 if(bg) 8488 [cont setBackgroundColor:(bg ? bg : [NSColor controlBackgroundColor])];
8498 { 8489 [cont setForegroundColor:(fg ? fg : [NSColor controlTextColor])];
8499 [cont setBackgroundColor:bg];
8500 }
8501 if(fg)
8502 {
8503 [cont setForegroundColor:fg];
8504 }
8505 } 8490 }
8506 else if([object isMemberOfClass:[DWMLE class]]) 8491 else if([object isMemberOfClass:[DWMLE class]])
8507 { 8492 {
8508 DWMLE *mle = handle; 8493 DWMLE *mle = handle;
8509 if(bg) 8494 [mle setBackgroundColor:(bg ? bg : [NSColor controlBackgroundColor])];
8510 { 8495 NSTextStorage *ts = [mle textStorage];
8511 [mle setBackgroundColor:bg]; 8496 [ts setForegroundColor:(fg ? fg : [NSColor controlTextColor])];
8512 }
8513 if(fg)
8514 {
8515 NSTextStorage *ts = [mle textStorage];
8516 [ts setForegroundColor:fg];
8517 }
8518 } 8497 }
8519 return 0; 8498 return 0;
8520 } 8499 }
8521 8500
8522 /* 8501 /*