For Programmers: Free Programming Magazines  


Home > Archive > PowerBuilder > October 2006 > Dynamic font changing in a Datawindow









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Dynamic font changing in a Datawindow
Peter_reed@hotmail.com

2006-09-27, 7:04 pm

Righto, I have looked all the way back to 1996 for help on changing the
font but the answers haven't helped.

I am using ver 7 of PB and my datawindow is invoked from a DDDW. Within
the datawindow is a SQL select to retrieve the data that will appear in
the window.

What I need to do is change the font dependant on the value of another
field.
I have tried using the escapement expression under the font for the
field in question using the following if stmt:
if (Mid (account_number,1,4) = '1234',
this.object.vendor_name.font.face = 'AR PL KaitiM Big5',
this.object.vendor_name.font.face = 'Tahloma')

But I get "Invalid argument to function" when I verify the stmt.

I have considered using the Modify method - by exporting the datawindow
but and not sure how/where to put the stmt - adding to the end of the
code or on the line that builds the column seems to get a syntax error.
If Mid(account_number,1,4) = '1234' Then
dw_cust.Modify("vendor_name.font.face = 'AR PL KaitiM Big5'")

Can anyone offer any suggestions?

Thanks,
Pete

Philip & Elena Salgannik

2006-09-27, 10:00 pm

See inline
<Peter_reed@hotmail.com> wrote in message
news:1159373283.599218.79350@m7g2000cwm.googlegroups.com...
> my datawindow is invoked from a DDDW.

What does the above mean?

> What I need to do is change the font dependant on the value of another
> field.

Where, in DDDW or in primary on which the above mentioned DDDW sits?


Peter_reed@hotmail.com

2006-09-28, 4:01 am


Philip & Elena Salgannik wrote:
> See inline
> <Peter_reed@hotmail.com> wrote in message
> news:1159373283.599218.79350@m7g2000cwm.googlegroups.com...
> What does the above mean?
>
> Where, in DDDW or in primary on which the above mentioned DDDW sits?

--------------------------------------------------------------------------------------------------------------
That's short for Drop Down Data Window - basically a menu. When the
application is run a window appears and the user selects a report from
the drop down list, which invokes the appropriate Datawindow, which
then executes the sql to retrieve the data.

Peter_reed@hotmail.com

2006-10-12, 7:10 pm

Well, I ended up asking the guru guy at work who found some spare time
to assist me - it turns out the datawindow was accessed by an ordinary
window but the way it got called was rather obscure and via several
other windows! So in the end it was just a matter of referring to the
object and changing the font.face thus
dw_preview.Object.name_1.Font.Face = 'AR PL KaitiM Big5' as well as the
codeset.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com