FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index All products support cambio font su molteplici oggetti "say"
Posts: 130
Joined: Fri Jun 30, 2006 02:14 PM
cambio font su molteplici oggetti "say"
Posted: Tue Sep 02, 2008 10:12 AM

Ho una dialog abbastanza complessa con numerosi oggetti testo statici (say) scritti su una risorsa esterna attraverso workshop.
Ad alcuni di questi vorrei dare un certo font per evidenziarli dagli altri.
C'è un modo più semplificato che non procedere uno per uno con la REDEFINE, così come ho fatto finora? (vedi sotto)

local fnt1,oDLG,oSAY1,oSAY2,oSAY3,...., oSAY100
REDEFINE oSAY1 ID 1 of oDLG FONT fnt1
REDEFINE oSAY2 ID 2 of oDLG FONT fnt1
REDEFINE oSAY3 ID 3 of oDLG FONT fnt1
....
...
REDEFINE oSAY100 ID 100 of oDLG FONT fnt1

MT

FWH 8.04 - XHARBOUR 1.1.0

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
cambio font su molteplici oggetti "say"
Posted: Tue Sep 02, 2008 11:17 AM
Max,

When you build your dialogbox in the resources editor, you can set the font to use from it. In the RC it will be specified like this:

test DIALOG 40, 33, 194, 119
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "This is a test"
FONT 8, "MS Sans Serif"
{
...
}
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 130
Joined: Fri Jun 30, 2006 02:14 PM
cambio font su molteplici oggetti "say"
Posted: Tue Sep 02, 2008 12:15 PM

Antonio,
ok i can specify one font in my resource, but i need to declare one font not for all may object say but only just for some of them.
And another font for other type of say , ecc.ecc.
And if i don't wrong in the resource editor i can specify only one font, valid for all objects and controls of the dialogbox.

Or there is a syntax in the resource editor for declaring multiple font in the same dialogbox, assigning one font to each control?

Thank you.
bye

Max

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
cambio font su molteplici oggetti "say"
Posted: Tue Sep 02, 2008 03:21 PM
Max,

To use different fonts you have to do it programmatically:
ACTIVATE DIALOG oDlg ;
   ON INIT SetDifferentFonts( oDlg )

...

function SetDifferentFonts( oDlg )

   local n

   for n = 1 to Len( oDlg:aControls )
      do case
          case Upper( oDlg:aControls[ n ]:ClassName() ) == "TSAY"
                  oDlg:aControls[ n ]:SetFont( oFontForSays )

          ...
      endcase
   next

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion