You need to be logged in to view a user's profile.
  1. Ricardo Colarina
  2. PowerBuilder
  3. Tuesday, 29 August 2017 06:24 AM UTC

Hi All,

Do you have a recommendation on how to determine the width of the value of a char column?  At the moment, I use GetTextExtentPoint32A, but this slows down the retrieval, as I set a computed column in the datawindow as a flag in the retrieverow event, which is then used by the enabled property of the tooltip.  Is there a way instead to determine if the ellipsis is showing where it is enabled in the column format?  I need to determine the width of the value as I'm using tooltips, but I only want to display the tooltip if the column value doesn't fit the column width.  I also tried using a hidden multilineedit control, and just determine the LineCount.

Thanks.

Best Regards,

Ricardo

 

René Ullrich Accepted Answer Pending Moderation
  1. Tuesday, 29 August 2017 08:57 AM UTC
  2. PowerBuilder
  3. # 1

Hi Ricardo,

good idea to make tooltip only available if ellipsis is showing. I had the same idea but found no solution.

BTW: You should use GetTextExtentPoint32W instead of GetTextExtentPoint32A.

Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Tuesday, 29 August 2017 08:59 AM UTC
  2. PowerBuilder
  3. # 2

One more thing: Coding in retrieverow event is bad for performance. You should calculate the text size after retrieve.

Comment
There are no comments made yet.
Eduardo G. Accepted Answer Pending Moderation
  1. Tuesday, 29 August 2017 10:01 AM UTC
  2. PowerBuilder
  3. # 3

I hope to help you. In the following URL look for the function: of_resizewidth, that's how I use it.

http://pbminer.dwox.com/Sources/TopWiz/dwgridxp/PB8/n_svc_dw_gridstyle.sru

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 29 August 2017 19:00 PM UTC
  2. PowerBuilder
  3. # 4

To get the latest version of the full example app Eduardo posted, go here:

http://www.topwizprogramming.com/freecode_dwgridxp.html

Basically it calls the function in a loop after retrieve is done rather than as each row comes in.

 

Comment
There are no comments made yet.
Shenn Sellers Accepted Answer Pending Moderation
  1. Tuesday, 29 August 2017 21:42 PM UTC
  2. PowerBuilder
  3. # 5

Here is an example of displaying Tooltips only when data goes beyond the length of the column.

https://drive.google.com/open?id=0B6J5FirdQZquYXI0QnFWdWJabjQ

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.