Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 19 JUL 2010 10:22:22PM Colin Rule wrote:

The online help indicates usage of DT_WORDBREAK (enumerates to 16).

I have tried calling this but I do not get any returned word breaks in the text.

Is this function supposed to return the modified text with CRLF, or is there some other trick.

Code is below:

DECLARE FUNCTION UTILITY
equ DT_WORDBREAK$ to 16
FONT=GET_PROPERTY("ICEPAC_MENU.BQ_TABLE","FONT")
WRAP_WIDTH=20
TEXTINFO="
TEXTINFO=Cost of completing duties of Project Supervisor (Construction Stage) in accordance with the Safety, Health & Welfare at Work (Construction) Regulations, 2001 and Clause 3.1.14 of this Specification."
TEXTINFO=DT_WORDBREAK$
TEXTINFO=WRAP_WIDTH
TEXTINFO=FONT
RESULT=Utility("TEXTRECT","",TEXTINFO)
SWAP CHAR(13):CHAR(10) WITH @VM IN TEXTINFO

DEBUG

return 1


At 20 JUL 2010 04:22AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Colin,

TEXTRECT only returns the size of the rectangle needed to draw the text - it does not alter the text in any way. It is basically a thin wrapper around the Windows API DrawText() function so you can calculate the size of the area needed to render the text into.

The Sprezzatura Group

The Sprezzatura Blog

World leaders in all things RevSoft


At 20 JUL 2010 08:12PM Colin Rule wrote:

Please can you then advise what fields and are for in the TEXTRECT service, the documentationstates:

Refer to SDK DrawText() (Format parameter)

Width of rectangle for DT_WORDBREAK flag set (only if object doesn't exist)

Thanks

Colin


At 20 JUL 2010 08:15PM Colin Rule wrote:

Oh, I have also tried setting up DrawText as a DLL declaration in User32.DLL.

The RECT parameter seems to be a problem.

Any suggestions as what the declarations might be.

MSDN states:

int DrawText(

__in     HDC hDC,
__inout  LPCTSTR lpchText,
__in     int nCount,
__inout  LPRECT lpRect,
__in     UINT uFormat

);

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/f51a5dc4d798475b85257766000d090b.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1