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.

Autowidth text field

3 posts in DataWindow Last posting was on 2009-03-17 18:51:38.0Z
ChrissDeGrece Posted on 2009-03-17 18:26:43.0Z
From: ChrissDeGrece <chriss_degrece_NOSPAM_@yahoo.com>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Autowidth text field
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49bfeb63@forums-1-dub>
Date: 17 Mar 2009 10:26:43 -0800
X-Trace: forums-1-dub 1237314403 10.22.241.152 (17 Mar 2009 10:26:43 -0800)
X-Original-Trace: 17 Mar 2009 10:26:43 -0800, vip152.sybase.com
Lines: 13
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88985
Article PK: 418238

Are you guys aware of any method to calculate the width of a "dynamic"
text field?

For example,we have a string : "Hello"

then using Modify(create....) we create a text field in a dw.
Then the user changes the string to "Hello_World!" and we create another
text field in the DW but this time it's not wide enough to fit the whole
string.

Any ideas?

thanks


ChrissDeGrece Posted on 2009-03-17 18:50:20.0Z
From: ChrissDeGrece <chriss_degrece_NOSPAM_@yahoo.com>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Autowidth text field
References: <49bfeb63@forums-1-dub>
In-Reply-To: <49bfeb63@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49bff0ec$1@forums-1-dub>
Date: 17 Mar 2009 10:50:20 -0800
X-Trace: forums-1-dub 1237315820 10.22.241.152 (17 Mar 2009 10:50:20 -0800)
X-Original-Trace: 17 Mar 2009 10:50:20 -0800, vip152.sybase.com
Lines: 18
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88988
Article PK: 418237

Don't bother, here it is:

http://downloads.sybase.com/codexchange/powerbuilder/249/columnwidthchecker.zip

ChrissDeGrece wrote:
> Are you guys aware of any method to calculate the width of a "dynamic"
> text field?
>
> For example,we have a string : "Hello"
>
> then using Modify(create....) we create a text field in a dw.
> Then the user changes the string to "Hello_World!" and we create another
> text field in the DW but this time it's not wide enough to fit the whole
> string.
>
> Any ideas?
>
> thanks


Brad Wery[TeamSybase] Posted on 2009-03-17 18:51:38.0Z
From: "Brad Wery[TeamSybase]" <bradweryatgmail.com>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Autowidth text field
References: <49bfeb63@forums-1-dub>
In-Reply-To: <49bfeb63@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49bff13a@forums-1-dub>
Date: 17 Mar 2009 10:51:38 -0800
X-Trace: forums-1-dub 1237315898 10.22.241.152 (17 Mar 2009 10:51:38 -0800)
X-Original-Trace: 17 Mar 2009 10:51:38 -0800, vip152.sybase.com
Lines: 40
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88989
Article PK: 418241

You may have to use the GetTextExtentPoint32 Windows API function. take
a look at Roland's XP Grid control for an example on how to use it:

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

He has column auto-sizing built into it.

Brad

ChrissDeGrece wrote:
> Are you guys aware of any method to calculate the width of a "dynamic"
> text field?
>
> For example,we have a string : "Hello"
>
> then using Modify(create....) we create a text field in a dw.
> Then the user changes the string to "Hello_World!" and we create another
> text field in the DW but this time it's not wide enough to fit the whole
> string.
>
> Any ideas?
>
> thanks

--

*********************************************************************************************************
www.PowerToTheBuilder.com
- Take control of your GUI with a free PB user control library
- Get updates from my blog - blog.PowerToTheBuilder.com
- Get support from - forum.PowerToTheBuilder.com

*********************************************************************************************************
www.Werysoft.com
- Full featured database development tool for ASE, SQL Server, SQL
Anywhere and Oracle

Get productive today!

*********************************************************************************************************