CJpushButton FONT
Posted: Thu Jul 01, 2010 10:14 pm
Hi,
I posted the FONT problem about a month ago to the codejock developer forum. There wasn't any response, their support could be better.
After testing a bit with the cjpushbutton, I realised that it should be possible to use the XAML possibilities to use a font, with the normal eXpress++ syntax. This is my workaround for the font problem.
If the command doesn't set the ENABLEMARKUP and there is a FONT defined, I added the following in the cjclass.prg.
This way a font can be used without a problem, and without any knowledge of the xaml possibilities.
I posted the FONT problem about a month ago to the codejock developer forum. There wasn't any response, their support could be better.

After testing a bit with the cjpushbutton, I realised that it should be possible to use the XAML possibilities to use a font, with the normal eXpress++ syntax. This is my workaround for the font problem.
Code: Select all
@ 10,10 CJPushButton oBut1 ;
Size 130,80 ;
BITMAP ABO_LEVERN ; // bitmap from resources
Caption "Testing font" ;
Font '12.Arial bold italic' ;
TextImageRelation xtpImageAboveText ;
Transparent ;
IMAGEALIGNMENT xtpAlignCenter ;
textalign xtpAlignCenter ;
Appearance xtpAppearanceOffice2007 ;
Style xtpButtonNormal ;
ACTION {|o| .... } PIXEL
Code: Select all
...
cCaption := aGetListItem[cGETLIST_CAPTION]
::caption := cCaption
// start workaround font lockup chris andries 01/07/10
// if enablemarkup is not set, and there is a font, create a simple xaml command to use the font.
if !aOptions[8] .and. !empty(cFont)
cFont = upper(cFont)
cPointSize := left(cFont,at('.',cFont)-1)
IF 'BOLD' $ Upper(cFont)
lBold := .T.
cFont := StrTran(cFont,' BOLD','')
ENDIF
IF 'ITALIC' $ Upper(cFont)
lItalic := .T.
cFont := StrTran(cFont,' ITALIC','')
ENDIF
cFont := Alltrim(StrTran(CJ_Token(cFont,'.',2),'.',' '))
cFont := StrTran(cFont,' ',' ')
cCaption := "<TextBlock FontFamily='"+cFont+"' FontSize='"+cPointSize+"'"
cCaption += iif(lBold, " FontWeight='Bold'","")
cCaption += iif(lItalic," FontStyle='Italic'","")
cCaption += ">" + aGetListItem[cGETLIST_CAPTION]+"</TextBlock>"
::enableMarkup := .T.
::caption := cCaption
endif
// stop workaround
::setColor( aGetListItem )
...