Page 1 of 1

FONT clauses as codeblocks

Posted: Thu Oct 11, 2012 1:26 am
by reganc
Roger

We noticed yesterday that the FONT clause of DCSAY when using a codeblock to return a font name does not seem to be working.

The documentation says that it should be possible.

Is it just a problem with Express++ build 255 that we are using?

Thanks

Re: FONT clauses as codeblocks

Posted: Thu Oct 11, 2012 4:14 am
by Tom
This seems to be true also for build 258. Fonts don't change:

Code: Select all

lTest := .T.
@ 1,1 DCSAY 'TEST' FONT {||IF(lTest,"10.Tahoma","12.Arial")} SIZE 10,1 OBJECT oTest
@ 2,1 DCPUSHBUTTON CAPTION 'Test' SIZE 10,1 ACTION {||lTest := !lTest,DC_GetRefresh(oTest)}
DCREAD GUI FIT

Re: FONT clauses as codeblocks

Posted: Thu Oct 11, 2012 7:14 am
by rdonnay
It appears that I never implemented that feature.
It was an easy fix.
Copy the attached _DCCLASS.PRG to \exp19\source\dclipx and run build19_sl1.bat to rebuild DCLIPX.DLL.

This fix will be in build 258.

Here's a test program for you:

Code: Select all

#INCLUDE "dcdialog.ch"

FUNCTION Main()

LOCAL GetList[0], nPointer := 1, aFonts, oSay

aFonts := { ;
   '10.Arial Bold', ;
   '11.Arial Bold', ;
   '12.Arial Bold', ;
   '13.Arial Bold', ;
   '14.Arial Bold', ;
   '15.Arial Bold', ;
   '16.Arial Bold', ;
   '17.Arial Bold', ;
   '18.Arial Bold', ;
   '19.Arial Bold', ;
   '20.Arial Bold' }

@ 0,0 DCSAY {||'This is ' + aFonts[nPointer]} SAYSIZE 50,2 FONT {||aFonts[nPointer]} ;
             OBJECT oSay

@ 3,0 DCPUSHBUTTON CAPTION 'Change Font' SIZE 20,2 FONT '10.Arial Bold' ;
      ACTION {||nPointer++, IIF(nPointer>Len(aFonts),nPointer:=1,nil), ;
                DC_GetRefresh(GetList)}

DCREAD GUI FIT TITLE 'Font test'

RETURN nil

* -------

PROC appsys ; return