comparison ios/dw.m @ 2804:deefe6f5d716

iOS: Implement dw_listbox_select() for comboboxes. Not sure how I missed that this wasn't implemented, but it became very obvious when using Interface builder.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 19 Jul 2022 15:56:11 +0000
parents 7ce51a7e8009
children 975df4680ff7
comparison
equal deleted inserted replaced
2803:708bcef0ce6b 2804:deefe6f5d716
3376 -(void)setToolbarStyle:(UIBarStyle)style { toolbarStyle = style; } 3376 -(void)setToolbarStyle:(UIBarStyle)style { toolbarStyle = style; }
3377 -(void)append:(NSString *)item { if(item) [dataArray addObject:item]; } 3377 -(void)append:(NSString *)item { if(item) [dataArray addObject:item]; }
3378 -(void)insert:(NSString *)item atIndex:(int)index { if(item) [dataArray insertObject:item atIndex:index]; } 3378 -(void)insert:(NSString *)item atIndex:(int)index { if(item) [dataArray insertObject:item atIndex:index]; }
3379 -(void)clear { [dataArray removeAllObjects]; } 3379 -(void)clear { [dataArray removeAllObjects]; }
3380 -(int)count { return (int)[dataArray count]; } 3380 -(int)count { return (int)[dataArray count]; }
3381 -(void)selectIndex:(int)index
3382 {
3383 if(index > -1 && index < (int)[dataArray count])
3384 {
3385 selectedIndex = index;
3386 [self setText:[dataArray objectAtIndex:index]];
3387 }
3388 }
3381 -(NSString *)getTextAtIndex:(int)index 3389 -(NSString *)getTextAtIndex:(int)index
3382 { 3390 {
3383 if(index > -1 && index < [dataArray count]) 3391 if(index > -1 && index < [dataArray count])
3384 return [dataArray objectAtIndex:index]; 3392 return [dataArray objectAtIndex:index];
3385 return nil; 3393 return nil;
5777 5785
5778 [cont selectRowAtIndexPath:ip 5786 [cont selectRowAtIndexPath:ip
5779 animated:NO 5787 animated:NO
5780 scrollPosition:UITableViewScrollPositionNone]; 5788 scrollPosition:UITableViewScrollPositionNone];
5781 } 5789 }
5790 else if([object isMemberOfClass:[DWComboBox class]])
5791 {
5792 DWComboBox *combo = handle;
5793 [combo selectIndex:index];
5794 }
5782 DW_FUNCTION_RETURN_NOTHING; 5795 DW_FUNCTION_RETURN_NOTHING;
5783 } 5796 }
5784 5797
5785 /* 5798 /*
5786 * Deletes the item with given index from the list. 5799 * Deletes the item with given index from the list.