comparison mac/dw.m @ 2189:a5d58393f7d0

Mac: Missed updating dw_filesystem_set_file() in that last commit.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 15 Oct 2020 04:39:18 +0000
parents a02ff8927927
children 4cb258fb6729
comparison
equal deleted inserted replaced
2188:a02ff8927927 2189:a5d58393f7d0
7675 int type = [cont cellType:column]; 7675 int type = [cont cellType:column];
7676 int lastadd = 0; 7676 int lastadd = 0;
7677 7677
7678 /* If pointer is NULL we are getting a change request instead of set */ 7678 /* If pointer is NULL we are getting a change request instead of set */
7679 if(pointer) 7679 if(pointer)
7680 {
7681 lastadd = [cont lastAddPoint]; 7680 lastadd = [cont lastAddPoint];
7682 }
7683 7681
7684 if(data) 7682 if(data)
7685 { 7683 {
7686 if(type & DW_CFA_BITMAPORICON) 7684 if(type & DW_CFA_BITMAPORICON)
7687 { 7685 {
7735 id object = [cont getRow:(row+lastadd) and:column]; 7733 id object = [cont getRow:(row+lastadd) and:column];
7736 7734
7737 /* If it is a cell, change the content of the cell */ 7735 /* If it is a cell, change the content of the cell */
7738 if([object isMemberOfClass:[NSTableCellView class]]) 7736 if([object isMemberOfClass:[NSTableCellView class]])
7739 { 7737 {
7740 NSTableCellView *cell = [cont getRow:(row+lastadd) and:column]; 7738 NSTableCellView *cell = object;
7741 if(icon) 7739 if(icon)
7742 [[cell imageView] setImage:icon]; 7740 [[cell imageView] setImage:icon];
7743 else 7741 else
7744 [[cell textField] setStringValue:text]; 7742 [[cell textField] setStringValue:text];
7745 } 7743 }
7806 DW_FUNCTION_NO_RETURN(dw_filesystem_set_file) 7804 DW_FUNCTION_NO_RETURN(dw_filesystem_set_file)
7807 DW_FUNCTION_RESTORE_PARAM5(handle, HWND, pointer, void *, row, int, filename, char *, icon, HICN) 7805 DW_FUNCTION_RESTORE_PARAM5(handle, HWND, pointer, void *, row, int, filename, char *, icon, HICN)
7808 { 7806 {
7809 DW_FUNCTION_INIT; 7807 DW_FUNCTION_INIT;
7810 DWContainer *cont = handle; 7808 DWContainer *cont = handle;
7811 #ifdef DW_USE_NSVIEW 7809 NSString *text = filename ? [NSString stringWithUTF8String:filename] : nil;
7812 NSTableCellView *browsercell;
7813 #else
7814 DWImageAndTextCell *browsercell;
7815 #endif
7816 int lastadd = 0; 7810 int lastadd = 0;
7817 7811
7818 /* If pointer is NULL we are getting a change request instead of set */ 7812 /* If pointer is NULL we are getting a change request instead of set */
7819 if(pointer) 7813 if(pointer)
7820 {
7821 lastadd = [cont lastAddPoint]; 7814 lastadd = [cont lastAddPoint];
7822 }
7823 7815
7824 #ifdef DW_USE_NSVIEW 7816 #ifdef DW_USE_NSVIEW
7825 browsercell = _dw_table_cell_view_new(icon, [NSString stringWithUTF8String:filename]); 7817 id object = [cont getRow:(row+lastadd) and:0];
7818
7819 /* If it is a cell, change the content of the cell */
7820 if([object isMemberOfClass:[NSTableCellView class]])
7821 {
7822 NSTableCellView *cell = object;
7823
7824 if(icon)
7825 [[cell imageView] setImage:icon];
7826 if(text)
7827 [[cell textField] setStringValue:text];
7828 }
7829 else /* Otherwise replace it with a new cell */
7830 [cont editCell:_dw_table_cell_view_new(icon, text) at:(row+lastadd) and:0];
7826 #else 7831 #else
7827 browsercell = [[[DWImageAndTextCell alloc] init] autorelease]; 7832 DWImageAndTextCell *browsercell = [[[DWImageAndTextCell alloc] init] autorelease];
7828 [browsercell setImage:icon]; 7833 [browsercell setImage:icon];
7829 [browsercell setStringValue:[ NSString stringWithUTF8String:filename ]]; 7834 [browsercell setStringValue:[NSString stringWithUTF8String:filename]];
7835 [cont editCell:browsercell at:(row+lastadd) and:0];
7830 #endif 7836 #endif
7831 [cont editCell:browsercell at:(row+lastadd) and:0];
7832 [cont setNeedsDisplay:YES]; 7837 [cont setNeedsDisplay:YES];
7833 DW_FUNCTION_RETURN_NOTHING; 7838 DW_FUNCTION_RETURN_NOTHING;
7834 } 7839 }
7835 7840
7836 /* 7841 /*