comparison mac/dw.m @ 864:ca01c7d95b80

Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns. Added a second icon column to the test program to test image column optimization. The optization needs to be looked further into to see why calculated width of image columns is 0.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 03 Apr 2011 17:24:23 +0000
parents 93ac372941c4
children ba9d38b8d0bc
comparison
equal deleted inserted replaced
863:b405182033a0 864:ca01c7d95b80
1288 if(thiswidth > width) 1288 if(thiswidth > width)
1289 { 1289 {
1290 width = thiswidth; 1290 width = thiswidth;
1291 } 1291 }
1292 } 1292 }
1293 [column setWidth:width]; 1293 /* TODO: Figure out why calculating the cell width does not work for
1294 * image cell types. In the meantime default the optimized width to 16.
1295 */
1296 if(!width && [[types objectAtIndex:z] intValue] & DW_CFA_BITMAPORICON)
1297 {
1298 width = 16;
1299 }
1300 /* Sanity check... don't set the width to 0 */
1301 if(width)
1302 {
1303 [column setWidth:width];
1304 }
1294 } 1305 }
1295 else 1306 else
1296 { 1307 {
1297 [column sizeToFit]; 1308 [column sizeToFit];
1298 } 1309 }
6556 */ 6567 */
6557 void API dw_window_default(HWND handle, HWND defaultitem) 6568 void API dw_window_default(HWND handle, HWND defaultitem)
6558 { 6569 {
6559 NSWindow *window = handle; 6570 NSWindow *window = handle;
6560 6571
6561 [window setInitialFirstResponder:defaultitem]; 6572 if([window isKindOfClass:[NSWindow class]] && defaultitem)
6573 {
6574 [window setInitialFirstResponder:defaultitem];
6575 }
6562 } 6576 }
6563 6577
6564 /* 6578 /*
6565 * Sets window to click the default dialog item when an ENTER is pressed. 6579 * Sets window to click the default dialog item when an ENTER is pressed.
6566 * Parameters: 6580 * Parameters: