cambio font su molteplici oggetti "say"

Moderator: Enrico Maria Giordano

cambio font su molteplici oggetti "say"

Postby max » 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
User avatar
max
 
Posts: 128
Joined: Fri Jun 30, 2006 2:14 pm
Location: Ancona - Italy

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby max » 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
User avatar
max
 
Posts: 128
Joined: Fri Jun 30, 2006 2:14 pm
Location: Ancona - Italy

Postby Antonio Linares » Tue Sep 02, 2008 3:21 pm

Max,

To use different fonts you have to do it programmatically:
Code: Select all  Expand view
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to All products support

Who is online

Users browsing this forum: No registered users and 11 guests