Have to display Multi Column Results in table

I saw on another Post there is no multicolumn tables, but a work around was mentioned.

I need to display a result of multiple columns, does anybody have an example of doing this.

The app I need to do is a Plumbing Calculations where the user inputs some value and calculations are done showing different options like:

Nominal Size Inside Diameter Full Flow (ft/s) Full Flow (gpm)
1.5 1.5 1.3 6.9
2 1.96 1.5 14.1
3 2.96 2 42.3
etc…

See Image: https://www.dropbox.com/s/4fl1af1homs1z28/ASPE_Digital_Tables_Book.jpg?dl=0

What would be the best way to display this?

This app was originally done with Adobe Flex and that system is a complete kludge is you ask me. And now it won’t run on iOS 8 so I need to redo it.

Thanks

Rich

[quote=177475:@Richard Albrecht]I saw on another Post there is no multicolumn tables, but a work around was mentioned.

I need to display a result of multiple columns, does anybody have an example of doing this.

The app I need to do is a Plumbing Calculations where the user inputs some value and calculations are done showing different options like:

Nominal Size Inside Diameter Full Flow (ft/s) Full Flow (gpm)
1.5 1.5 1.3 6.9
2 1.96 1.5 14.1
3 2.96 2 42.3
etc…

See Image: https://www.dropbox.com/s/4fl1af1homs1z28/ASPE_Digital_Tables_Book.jpg?dl=0

What would be the best way to display this?

This app was originally done with Adobe Flex and that system is a complete kludge is you ask me. And now it won’t run on iOS 8 so I need to redo it.[/quote]

Until there is some implementation of UITableView, we do not have the equivalent of ListBox in iOS. One of my popular app requires such a control, though, so I have started some preliminary work on iOSTable. You can draw the text into iOSTableCellData Image, so it is possible to draw columns the way you want simply using DrawString.

Left justify is fairly simple since all you have to do is to set x at the proper position. Right justify for decimals, for instance, requires to calculate where to drawstring based on the right minus stringwidth.

In the example you show, I would use a multidimensions array to store the data, then display it graphically onto each row’s iOSTableCellData.Image.

I am going to experiment a little further with this. With some luck, I should be able to post a small proof of concept soon.

Here is a quick proof of concept that draws the data you described onto an iOSTable in an iPad project. Table data is in the string view property TableData(), and all the code is in the iOSTable Open event.

I kept the text left justified, but it should be easy to right justify it.

columns.xojo_binary_project

Looking at the project I posted, I noticed the characters are kind of blurry. Which makes sense, since graphics are limited to 72 dpi, while all iOS devices are at least twice that today with Retina. So I posted a feature request. See https://forum.xojo.com/21258-ios-graphics-need-more-than-72-dpi

If you think the lower resolution is not acceptable, there is still another possibility : use a monospaced font such as Courier where all characters having the same width, it is very easy to make columns by mixing spaces and numbers, like we used to do on the 80 columns Apple IIe screen in prehistoric ages. For numbers, it is quite fine, since numbers are monospaced in all fonts. For text, it may look a bit strange.

The alternative is to stack labels, but then scrolling seems daunting, as well as position with Auto layout constraints.

Michel,

Wow thanks for the quick response. I will look at the sample you provided.

Are you going to be in Austin for the Xojo Conference? If so I’ll look you up.

Thanks

Rich

[quote=177654:@Richard Albrecht]Michel,

Wow thanks for the quick response. I will look at the sample you provided.

Are you going to be in Austin for the Xojo Conference? If so I’ll look you up.[/quote]

I have updated the sample with a scale of 2 for the graphics. Now the rendition of text is closer to regular fonts.

And, no, I will not be in Austin. Sorry.