Tooltip wordwrap in MTable

Info and discussion on MICSTO's M!Table and M!Image.
chelonet
Argentina
Posts: 79
Joined: 19 Apr 2017, 15:28
Location: Argentina

Tooltip wordwrap in MTable

Post by chelonet » 11 Aug 2022, 15:57

I want to see a tooltip with the value of a cell when it exceeds the size of the cell.
I use:
Call MTblEnableTipType( tbl1, MTBL_TIP_CELL_COMPLETETEXT, TRUE )
(the same thing happens if I always show it with TBL_TIP_CELL_TEXT)
The column is configured as Word Wrap.
Important: The tables are configured with one line per row.

The problem is that the tooltip is displayed on a single very long line, with the full length of text.

If I use MTblSetTipSize, the text is cut off, it doesn't continue down.

I would like the tooltip to be displayed with a certain width on several lines and with wordwrap.
This happens if the table is configured with two or more lines per row, but not one.

I notice that MTable takes the wordwrap setting of the table to display the tooltip, but the wordwrap on the table is only activated if there is more than one line per row.

Is there any way to achieve it (with one line per row table)?

I leave some example prints.

Thank you !!!
PS: Tank Michael Stoll by MTable, it's very very helpful!!!
You do not have the required permissions to view the files attached to this post.

User avatar
Steve Leighton
Site Admin
Site Admin
New Zealand
Posts: 430
Joined: 05 Mar 2017, 20:57
Location: Stroud, England <--> Tauranga, New Zealand

Re: Tooltip wordwrap in MTable

Post by Steve Leighton » 17 Aug 2022, 04:23

.
Use a mixture of M!Tbl and Dave's WinAPI Tooltip functions to get your long cell text into a word wrapped tooltip:

This TD6.2 example works by:
1) trapping the MTM_ShowCellTip message
2) converting the cell text to an array with a pre-set number of whole words of your choosing ( e.g. 5 words on each line of the Tip) , appended with a carriage return at the end of each.
3) untokenising the array back into a string for use in the tooltip.

Result:
Sample Tooltip on long cell.JPG

Go here to see use of Dave's WinAPI Tooltip functions: https://wiki.tdcommunity.net/index.php/ ... s#Tooltips.
If you dont use them - you should.
And don't forget to donate via Dave's Wiki page for all this extracurricular work and web-site support :)
.
Tooltips for extra long table cells.zip
.
You do not have the required permissions to view the files attached to this post.
Greetings from New Zealand
Steve Leighton

Bankside Systems Ltd.
UK ♦ Australia ♦ New Zealand

www.banksidesystems.co.uk

Image

chelonet
Argentina
Posts: 79
Joined: 19 Apr 2017, 15:28
Location: Argentina

Re: Tooltip wordwrap in MTable

Post by chelonet » 18 Aug 2022, 20:20

Thank you !!! I'm going to try it.

Return to “M!Table & M!Image”

Who is online

Users browsing this forum: [Ccbot] and 0 guests