comparison ios/dw.m @ 2417:ccfc4ee9c4a7

iOS: Missed a few other DWContainer fixes in that last commit.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 03 Apr 2021 00:24:49 +0000
parents 353581ebf4a5
children 65ff339e9cd2
comparison
equal deleted inserted replaced
2416:353581ebf4a5 2417:ccfc4ee9c4a7
4236 *buffer = '\0'; 4236 *buffer = '\0';
4237 } 4237 }
4238 else 4238 else
4239 { 4239 {
4240 UITableViewCell *cell = [cont getRow:index and:0]; 4240 UITableViewCell *cell = [cont getRow:index and:0];
4241 NSString *nstr; 4241 NSString *nstr = [[cell textLabel] text];
4242
4243 if(@available(iOS 14.0, *))
4244 {
4245 UIListContentConfiguration *content = [cell defaultContentConfiguration];
4246
4247 nstr = [content text];
4248 }
4249 else
4250 {
4251 nstr = [cell text];
4252 }
4253 4242
4254 strncpy(buffer, [nstr UTF8String], length - 1); 4243 strncpy(buffer, [nstr UTF8String], length - 1);
4255 } 4244 }
4256 } 4245 }
4257 DW_FUNCTION_RETURN_NOTHING; 4246 DW_FUNCTION_RETURN_NOTHING;
4279 4268
4280 if(index <= count) 4269 if(index <= count)
4281 { 4270 {
4282 NSString *nstr = [NSString stringWithUTF8String:buffer]; 4271 NSString *nstr = [NSString stringWithUTF8String:buffer];
4283 UITableViewCell *cell = [cont getRow:index and:0]; 4272 UITableViewCell *cell = [cont getRow:index and:0];
4284 4273
4285 if(@available(iOS 14.0, *)) 4274 [[cell textLabel] setText:nstr];
4286 {
4287 UIListContentConfiguration *content = [cell defaultContentConfiguration];
4288
4289 [content setText:nstr];
4290 }
4291 else
4292 {
4293 [cell setText:nstr];
4294 }
4295 [cont reloadData]; 4275 [cont reloadData];
4296 [cont setNeedsDisplay]; 4276 [cont setNeedsDisplay];
4297 } 4277 }
4298 } 4278 }
4299 DW_FUNCTION_RETURN_NOTHING; 4279 DW_FUNCTION_RETURN_NOTHING;
5628 if([object isMemberOfClass:[UITableViewCell class]]) 5608 if([object isMemberOfClass:[UITableViewCell class]])
5629 { 5609 {
5630 UITableViewCell *cell = object; 5610 UITableViewCell *cell = object;
5631 5611
5632 if(icon) 5612 if(icon)
5633 { 5613 [[cell imageView] setImage:icon];
5634 if(@available(iOS 14.0, *))
5635 {
5636 UIListContentConfiguration *content = [cell defaultContentConfiguration];
5637
5638 [content setImage:icon];
5639 }
5640 else
5641 {
5642 [cell setImage:icon];
5643 }
5644 }
5645 else 5614 else
5646 { 5615 [[cell textLabel] setText:text];
5647 if(@available(iOS 14.0, *))
5648 {
5649 UIListContentConfiguration *content = [cell defaultContentConfiguration];
5650
5651 [content setText:text];
5652 }
5653 else
5654 {
5655 [cell setText:text];
5656 }
5657 }
5658 } 5616 }
5659 else /* Otherwise replace it with a new cell */ 5617 else /* Otherwise replace it with a new cell */
5660 [cont editCell:_dw_table_cell_view_new(icon, text) at:(row+lastadd) and:column]; 5618 [cont editCell:_dw_table_cell_view_new(icon, text) at:(row+lastadd) and:column];
5661 [cont setNeedsDisplay]; 5619 [cont setNeedsDisplay];
5662 DW_FUNCTION_RETURN_NOTHING; 5620 DW_FUNCTION_RETURN_NOTHING;
5731 if([object isMemberOfClass:[UITableViewCell class]]) 5689 if([object isMemberOfClass:[UITableViewCell class]])
5732 { 5690 {
5733 UITableViewCell *cell = object; 5691 UITableViewCell *cell = object;
5734 5692
5735 if(icon) 5693 if(icon)
5736 { 5694 [[cell imageView] setImage:icon];
5737 if(@available(iOS 14.0, *))
5738 {
5739 UIListContentConfiguration *content = [cell defaultContentConfiguration];
5740
5741 [content setImage:icon];
5742 }
5743 else
5744 {
5745 [cell setImage:icon];
5746 }
5747 }
5748 if(text) 5695 if(text)
5749 { 5696 [[cell textLabel] setText:text];
5750 if(@available(iOS 14.0, *))
5751 {
5752 UIListContentConfiguration *content = [cell defaultContentConfiguration];
5753
5754 [content setText:text];
5755 }
5756 else
5757 {
5758 [cell setText:text];
5759 }
5760 }
5761 } 5697 }
5762 else /* Otherwise replace it with a new cell */ 5698 else /* Otherwise replace it with a new cell */
5763 [cont editCell:_dw_table_cell_view_new(icon, text) at:(row+lastadd) and:0]; 5699 [cont editCell:_dw_table_cell_view_new(icon, text) at:(row+lastadd) and:0];
5764 [cont setNeedsDisplay]; 5700 [cont setNeedsDisplay];
5765 DW_FUNCTION_RETURN_NOTHING; 5701 DW_FUNCTION_RETURN_NOTHING;