Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

How to determine if edit field has hidden text

2 posts in DataWindow Last posting was on 2008-11-07 17:12:58.0Z
GW Posted on 2008-10-28 18:52:22.0Z
From: "GW" <gw@gw>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: How to determine if edit field has hidden text
Lines: 11
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49075f66$1@forums-1-dub>
Date: 28 Oct 2008 10:52:22 -0800
X-Trace: forums-1-dub 1225219942 10.22.241.152 (28 Oct 2008 10:52:22 -0800)
X-Original-Trace: 28 Oct 2008 10:52:22 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88060
Article PK: 417315

Hi all

I need to print the client form wysiwyg but would like to determine if text
extends beyond the fixed border size in order to print an overflow page? I
would prefer to automate this process if possible

Using 10.5

TIA


scionyx Posted on 2008-11-07 17:12:58.0Z
From: scionyx <sfield@scionyx.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: How to determine if edit field has hidden text
Date: Fri, 7 Nov 2008 09:12:58 -0800 (PST)
Organization: http://groups.google.com
Lines: 40
Message-ID: <0d106d88-c2ad-4871-afe8-7cf69c5e8b47@n33g2000pri.googlegroups.com>
References: <49075f66$1@forums-1-dub>
NNTP-Posting-Host: 170.104.61.146
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1226077979 11039 127.0.0.1 (7 Nov 2008 17:12:59 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 7 Nov 2008 17:12:59 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: n33g2000pri.googlegroups.com; posting-host=170.104.61.146; posting-account=-kzySgkAAAAqb7jiNSJ1XKXlAz27meBa
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!n33g2000pri.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88134
Article PK: 417390

Taking a stab at it... In the simplest case, an edit with single line
of text has some width, E.WIDTH. You should be able to get the font
and calculate:
if len(data) * font.width > E.WDITH then Overflow.

You may have to create your own table of widths for fonts by family
and size, and convert to common UNITS. (PBUnits, Inches, etc)

I don't remember offhand, but I believe there is a kernal call to get
the length, in screen units, of a string in a particular font, having
used something like that years ago to determine where to wrap text in
a drawn control, yadda yadda.

If you HAVE a multi-line control, then there is added complexity to
determine where it's wrapping and if it overflows the bottom line, and
so on.

As to automation, between the retrieve() and the print(), you will
want to walk the control list looking for edits, OR if it's certain
ones, use the control's TAG property to flag it as one to be checked,
and go from there.

HTH

Steve

On Oct 28, 10:52 am, "GW" <gw@gw> wrote:
> Hi all
>
> I need to print the client form wysiwyg but would like to determine if text
> extends beyond the fixed border size in order to print an overflow page? I
> would prefer to automate this process if possible
>
> Using 10.5
>
> TIA