ListBox.ColumnWidths string format

Hi,

I wanted to use the column width of a ListBox as the Column Left Position in a Printing routine and falled into a question. Watch the screen shot below:

The image above shows the ListBox.ColumnWidths string format (Under Yosemite, Language: French if this is important).

A simple search does not returns anything in the format: ListBox1.ColumnWidth(i) where i is the number of the column I want to get the width.

So, Xojo compute and build the ColumnWidths Property to return it using the string format shown above, but if you want to use (psuedo and not working code below)

g. DrawString LB.Cell(Loop_Idx,Col_Idx), Col_Pos,Line_Pos

I have to compute ColPos using NthField (the delimiter is ‘,’) and remove the eventual leading string…

Is it a good idea to add a Property… ListBox.ColumnWidth(Number-of-the-column-as-integer) and get the value as double ?

Your ideas are welcome (if I understand correctly the rebuild of Xojo Framework).

While I was writing this conversation text a crazy idea comes to me:

In NthField, we can read:

separator 	String 	The string that separates columns of data.

Does that means that separator is not a single character, but can be a string of characters (1 to n characters) ?
If so, the code to do what I want is lighter. This does not change the eventual “feature request”, question I ask your feeling.

I was to fast; some lines below I found:

The separator may be a string of any length.

I think you’re looking for Listbox.ColumnWidthActual.

Hi Tim,

this looks good, but I do not found it in the docs ListBox:

ListBox.ColumnWidthActual
Jump to: navigation, search

There is currently no text in this page. You can search for this page title in other pages, or search the related logs, but you do not have permission to create this page.

ColumnWidthActual is found in my hard disk in a file called recovery.js that disappears when I started to write this line (2 files with that name, in a FireFox folder: session store backup…).

a google request returned:

Listbox Column Resize - Mailinglists www.monkeybreadsoftware.eu/.../2009-06-23-5.shtm... Traduire cette page 23 juin 2009 - 10 messages - ?6 auteurs column width actual in cellbackground paint. You can then create a custom ColumnResized event which you call on mismatch... Checking for

How do I use it and from where does it comes ?

Actually it’s Listbox.Column(index).WidthActual.

See: Page Not Found — Xojo documentation

Ah, yes. Sorry for the faulty memory.

Thanks all.

As I stated before, once I realized that NthField’ delimiter can be more than one character long, the sky all of a sudden started to be of a light cyan ! With a nice sun (like today in Strasbourg, France).

It seems to me that this is the first time I ever saw that entry !

It was already there in 2005r2 as I saw a fix for linux in that release note. I’m late for more than 10 years on this one !

By The Way !

I totally forgot to talk about the other ColumnWidths formats.

It is because I do not use them: I set the column widths in the service data part of the loaded text file (with the Heading string and background colors definition).

That is why I can compute easily the ListBox Column Widths !

Now, I have to investigate the shared advice: Listbox.Column(index).WidthActual.

One more couple of THANK YOU to Greg and Tim.