Mercurial > dwindows
comparison ios/dw.m @ 2388:d84cd4227b21
iOS: Switch to UITableViewDataSource method numberOfRowsInSection:
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 23 Mar 2021 22:35:37 +0000 |
parents | deb2345f4518 |
children | 7b06fc7c8130 |
comparison
equal
deleted
inserted
replaced
2387:deb2345f4518 | 2388:d84cd4227b21 |
---|---|
1752 #if 0 /* TODO: Figure out how to calculate the table size */ | 1752 #if 0 /* TODO: Figure out how to calculate the table size */ |
1753 if(tvcols) | 1753 if(tvcols) |
1754 { | 1754 { |
1755 int z; | 1755 int z; |
1756 int colcount = (int)[tvcols count]; | 1756 int colcount = (int)[tvcols count]; |
1757 int rowcount = (int)[self numberOfRowsInTableView:self]; | 1757 int rowcount = (int)[self numberOfRowsInSection:0]; |
1758 | 1758 |
1759 for(z=0;z<colcount;z++) | 1759 for(z=0;z<colcount;z++) |
1760 { | 1760 { |
1761 NSTableColumn *column = [tvcols objectAtIndex:z]; | 1761 NSTableColumn *column = [tvcols objectAtIndex:z]; |
1762 int width = [column width]; | 1762 int width = [column width]; |
3943 int result = 0; | 3943 int result = 0; |
3944 | 3944 |
3945 if([object isMemberOfClass:[DWContainer class]]) | 3945 if([object isMemberOfClass:[DWContainer class]]) |
3946 { | 3946 { |
3947 DWContainer *cont = handle; | 3947 DWContainer *cont = handle; |
3948 result = (int)[cont numberOfRowsInTableView:cont]; | 3948 result = (int)[cont numberOfRowsInSection:0]; |
3949 } | 3949 } |
3950 DW_FUNCTION_RETURN_THIS(result); | 3950 DW_FUNCTION_RETURN_THIS(result); |
3951 } | 3951 } |
3952 | 3952 |
3953 /* | 3953 /* |
3991 id object = handle; | 3991 id object = handle; |
3992 | 3992 |
3993 if([object isMemberOfClass:[DWContainer class]]) | 3993 if([object isMemberOfClass:[DWContainer class]]) |
3994 { | 3994 { |
3995 DWContainer *cont = handle; | 3995 DWContainer *cont = handle; |
3996 int count = (int)[cont numberOfRowsInTableView:cont]; | 3996 int count = (int)[cont numberOfRowsInSection:0]; |
3997 | 3997 |
3998 if(index > count) | 3998 if(index > count) |
3999 { | 3999 { |
4000 *buffer = '\0'; | 4000 *buffer = '\0'; |
4001 } | 4001 } |
4037 id object = handle; | 4037 id object = handle; |
4038 | 4038 |
4039 if([object isMemberOfClass:[DWContainer class]]) | 4039 if([object isMemberOfClass:[DWContainer class]]) |
4040 { | 4040 { |
4041 DWContainer *cont = handle; | 4041 DWContainer *cont = handle; |
4042 int count = (int)[cont numberOfRowsInTableView:cont]; | 4042 int count = (int)[cont numberOfRowsInSection:0]; |
4043 | 4043 |
4044 if(index <= count) | 4044 if(index <= count) |
4045 { | 4045 { |
4046 NSString *nstr = [NSString stringWithUTF8String:buffer]; | 4046 NSString *nstr = [NSString stringWithUTF8String:buffer]; |
4047 UITableViewCell *cell = [cont getRow:index and:0]; | 4047 UITableViewCell *cell = [cont getRow:index and:0]; |
5792 DW_FUNCTION_RESTORE_PARAM3(handle, HWND, direction, int, rows, long) | 5792 DW_FUNCTION_RESTORE_PARAM3(handle, HWND, direction, int, rows, long) |
5793 { | 5793 { |
5794 DW_FUNCTION_INIT; | 5794 DW_FUNCTION_INIT; |
5795 DWContainer *cont = handle; | 5795 DWContainer *cont = handle; |
5796 UIScrollView *sv = [cont scrollview]; | 5796 UIScrollView *sv = [cont scrollview]; |
5797 int rowcount = (int)[cont numberOfRowsInTableView:cont]; | 5797 int rowcount = (int)[cont numberOfRowsInSection:0]; |
5798 CGPoint offset = [sv contentOffset]; | 5798 CGPoint offset = [sv contentOffset]; |
5799 float change; | 5799 float change; |
5800 | 5800 |
5801 /* Safety check */ | 5801 /* Safety check */ |
5802 if(rowcount < 1) | 5802 if(rowcount < 1) |
5917 { | 5917 { |
5918 DW_FUNCTION_INIT; | 5918 DW_FUNCTION_INIT; |
5919 DW_LOCAL_POOL_IN; | 5919 DW_LOCAL_POOL_IN; |
5920 DWContainer *cont = handle; | 5920 DWContainer *cont = handle; |
5921 char *thistext; | 5921 char *thistext; |
5922 int x, count = (int)[cont numberOfRowsInTableView:cont]; | 5922 int x, count = (int)[cont numberOfRowsInSection:0]; |
5923 | 5923 |
5924 for(x=0;x<count;x++) | 5924 for(x=0;x<count;x++) |
5925 { | 5925 { |
5926 thistext = [cont getRowTitle:x]; | 5926 thistext = [cont getRowTitle:x]; |
5927 | 5927 |
5953 { | 5953 { |
5954 DW_FUNCTION_INIT; | 5954 DW_FUNCTION_INIT; |
5955 DW_LOCAL_POOL_IN; | 5955 DW_LOCAL_POOL_IN; |
5956 DWContainer *cont = handle; | 5956 DWContainer *cont = handle; |
5957 void *thisdata; | 5957 void *thisdata; |
5958 int x, count = (int)[cont numberOfRowsInTableView:cont]; | 5958 int x, count = (int)[cont numberOfRowsInSection:0]; |
5959 | 5959 |
5960 for(x=0;x<count;x++) | 5960 for(x=0;x<count;x++) |
5961 { | 5961 { |
5962 thisdata = [cont getRowData:x]; | 5962 thisdata = [cont getRowData:x]; |
5963 | 5963 |
5988 DW_FUNCTION_RESTORE_PARAM2(handle, HWND, text, char *) | 5988 DW_FUNCTION_RESTORE_PARAM2(handle, HWND, text, char *) |
5989 { | 5989 { |
5990 DW_FUNCTION_INIT; | 5990 DW_FUNCTION_INIT; |
5991 DWContainer *cont = handle; | 5991 DWContainer *cont = handle; |
5992 char *thistext; | 5992 char *thistext; |
5993 int x, count = (int)[cont numberOfRowsInTableView:cont]; | 5993 int x, count = (int)[cont numberOfRowsInSection:0]; |
5994 | 5994 |
5995 for(x=0;x<count;x++) | 5995 for(x=0;x<count;x++) |
5996 { | 5996 { |
5997 thistext = [cont getRowTitle:x]; | 5997 thistext = [cont getRowTitle:x]; |
5998 | 5998 |
6019 DW_FUNCTION_RESTORE_PARAM2(handle, HWND, data, void *) | 6019 DW_FUNCTION_RESTORE_PARAM2(handle, HWND, data, void *) |
6020 { | 6020 { |
6021 DW_FUNCTION_INIT; | 6021 DW_FUNCTION_INIT; |
6022 DWContainer *cont = handle; | 6022 DWContainer *cont = handle; |
6023 void *thisdata; | 6023 void *thisdata; |
6024 int x, count = (int)[cont numberOfRowsInTableView:cont]; | 6024 int x, count = (int)[cont numberOfRowsInSection:0]; |
6025 | 6025 |
6026 for(x=0;x<count;x++) | 6026 for(x=0;x<count;x++) |
6027 { | 6027 { |
6028 thisdata = [cont getRowData:x]; | 6028 thisdata = [cont getRowData:x]; |
6029 | 6029 |