{{tag>category:"OpenInsight 32-Bit" author:"Colin Rule" author:"[url=http://www.sprezzatura.com]The Sprezzatura Group[/url]"}}
[[https://www.revelation.com/the-works|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]]
==== Utility TEXTRECT (OpenInsight 32-Bit) ====
=== 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.
[url=http://www.sprezzatura.com]The Sprezzatura Group[/url]
[url=http://www.sprezzatura.com/blog]The Sprezzatura Blog[/url]
[i]World leaders in all things RevSoft[/i]
[img]http://www.sprezzatura.com/zz.gif[/img]
----
=== 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
);
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&SUMMARY=1&KEY=F51A5DC4D798475B85257766000D090B|View this thread on the Works forum...]]