Page 1 of 1

partialTextIndication

Posted: Fri Aug 07, 2009 12:20 pm
by ConvertFromOldNGs
by encos_dev >> Tue, 4 Feb 2003 20:28:26 GMT

Hi,

Does anyone know of a way to programmatically detect whether a table
cell has partial text in it or not?

Some detail: where a cell in a table is not wide enough to display all the text in it, I'm using the partialTextIndication property of the
table to make those cells show '...' to indicate this to the user.

To display the full text of the cell, when the mouse moves over the cell I'm getting it to display the full text in a yellow bubble help box. My problem is that the yellow bubble help box is displayed for all the
cells not just the ones that have partial text.

Any ideas appreciated.

Cheers,


Glen Richards
Encos Global Systems Limited

Re: partialTextIndication

Posted: Fri Aug 07, 2009 12:21 pm
by ConvertFromOldNGs
by JensRichnow >> Tue, 4 Feb 2003 20:46:20 GMT

As the ::partialTextIndication property is read and write at run time I would have assumed that you can query table cells about this property, such as in:

if table.accessCell(4, 2).partialTextIndication then
// display bubble help
endif;

I didn't test it though ;-)

Re: partialTextIndication

Posted: Fri Aug 07, 2009 12:21 pm
by ConvertFromOldNGs
by encos_dev >> Tue, 4 Feb 2003 21:11:33 GMT

Yeah I tried that - I also tried setting the accessMode to AccessMode_Cell. It always returns true because all the cells had partialTextIndication set to true - whether they display the '...' or not.

It looks like the only solution is to calculate whether the text will fit in a cell for myself. This is a tad frustrating as Jade is obviously already doing this - I just can't access it. Perhaps this could be a new feature for Jade 6.1?

Cheers,

Glen

Re: partialTextIndication

Posted: Fri Aug 07, 2009 12:21 pm
by ConvertFromOldNGs
by JensRichnow >> Tue, 4 Feb 2003 21:22:12 GMT

Yup looks like you have to do it the manual way although it will be tedious as you have to take the current font into consideration, get the text width compare it with the table row width etc. I think there has to be a compromise between what you allow the user to do (i.e., resize the column width to look at the full cell text), or which columns actually need the partial text indication, etc.
Perhaps this could be a new feature for Jade 6.1?

Maybe something like that is already in the upcoming Jade 6.0 ;-) Although that again depends on whether somebody had a new feature request re this problem.

Re: partialTextIndication

Posted: Fri Aug 07, 2009 12:21 pm
by ConvertFromOldNGs
by encos_dev >> Tue, 4 Feb 2003 21:30:55 GMT

Good point. At the moment, my best solution seems to be to just leave it so that the bubble help appears whether it needs to or not (which covers the problem). I've also made the form resizeable which in turn resizes the table displaying all but the longest strings.

I've made the feature request to Jade :)

Cheers Jens.

Re: partialTextIndication

Posted: Fri Aug 07, 2009 12:21 pm
by ConvertFromOldNGs
by torrie >> Wed, 5 Feb 2003 9:15:23 GMT

Hi

In the mean time you could use the getTextExtent method on the Window class to calculate the width of the text. We also use the getTextHeightForWidth method to resize the table cell to the correct height. The Jade help does say that the table grids lines are not taken into account.

Torrie

Re: partialTextIndication

Posted: Fri Aug 07, 2009 12:21 pm
by ConvertFromOldNGs
by encos_dev >> Tue, 11 Feb 2003 1:50:13 GMT

Hi Torrie,

Thanks for the tip, it works excellently.


Cheers,

Glen