comparison mac/dw.m @ 2183:c7713d96e5a9

Mac: Copy text alignment from the table column to the cell's text field.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 14 Oct 2020 01:06:21 +0000
parents 3bb5a74b4231
children 8f9a44279ff0
comparison
equal deleted inserted replaced
2182:3bb5a74b4231 2183:c7713d96e5a9
2639 2639
2640 /* The data is already a NSTableCellView so just return that */ 2640 /* The data is already a NSTableCellView so just return that */
2641 if([celldata isMemberOfClass:[NSTableCellView class]]) 2641 if([celldata isMemberOfClass:[NSTableCellView class]])
2642 { 2642 {
2643 NSTableCellView *result = celldata; 2643 NSTableCellView *result = celldata;
2644 2644 NSTextAlignment align = [[tableColumn headerCell] alignment];
2645
2645 _dw_table_cell_view_layout(result); 2646 _dw_table_cell_view_layout(result);
2646 2647
2648 /* Copy the alignment setting from the column */
2649 if([result textField])
2650 [[result textField] setAlignment:align];
2651
2647 /* Return the result */ 2652 /* Return the result */
2648 return result; 2653 return result;
2649 } 2654 }
2650 return nil; 2655 return nil;
2651 } 2656 }
7549 } 7554 }
7550 #endif 7555 #endif
7551 /* Defaults to left justified so just handle right and center */ 7556 /* Defaults to left justified so just handle right and center */
7552 if(flags[z] & DW_CFA_RIGHT) 7557 if(flags[z] & DW_CFA_RIGHT)
7553 { 7558 {
7559 #ifndef BUILDING_FOR_YOSEMITE
7554 [(NSCell *)[column dataCell] setAlignment:DWTextAlignmentRight]; 7560 [(NSCell *)[column dataCell] setAlignment:DWTextAlignmentRight];
7561 #endif
7555 [(NSCell *)[column headerCell] setAlignment:DWTextAlignmentRight]; 7562 [(NSCell *)[column headerCell] setAlignment:DWTextAlignmentRight];
7556 } 7563 }
7557 else if(flags[z] & DW_CFA_CENTER) 7564 else if(flags[z] & DW_CFA_CENTER)
7558 { 7565 {
7566 #ifndef BUILDING_FOR_YOSEMITE
7559 [(NSCell *)[column dataCell] setAlignment:DWTextAlignmentCenter]; 7567 [(NSCell *)[column dataCell] setAlignment:DWTextAlignmentCenter];
7568 #endif
7560 [(NSCell *)[column headerCell] setAlignment:DWTextAlignmentCenter]; 7569 [(NSCell *)[column headerCell] setAlignment:DWTextAlignmentCenter];
7561 } 7570 }
7562 [column setEditable:NO]; 7571 [column setEditable:NO];
7563 [cont addTableColumn:column]; 7572 [cont addTableColumn:column];
7564 [cont addColumn:column andType:(int)flags[z]]; 7573 [cont addColumn:column andType:(int)flags[z]];