change font for TXBrowse()

change font for TXBrowse()

Postby edu_parada » Sun Sep 02, 2007 11:27 am

Hi,

I am trying to change font in XBrowse, allowing the user to change it in runtime. In listbox I did:

oBrowse:Selfont()
oBrowse:Refresh()

But It does not work. Also I have tried:

LOCAL oFont

DEFINE FONT oFont FROM USER

oBrowse:Setfont(oFont)
oBrowse:Refresh()

and it does not work too. How can i do it?. Thank you!!!!
edu_parada
 
Posts: 33
Joined: Sat Jul 07, 2007 5:53 pm

Postby Antonio Linares » Mon Sep 03, 2007 5:18 pm

Local oFont

DEFINE FONT oFont NAME "Arial" SIZE 0, -8 BOLD

...

oCol := oBrw:AddCol()
oCol:bStrData := { || _FIELD->First}
oCol:cHeader := "First"
oCol:oDataFont := oFont
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby edu_parada » Mon Sep 03, 2007 5:35 pm

Thanks, but I want that the user can change the font during the program execution.
edu_parada
 
Posts: 33
Joined: Sat Jul 07, 2007 5:53 pm

Postby edu_parada » Wed Sep 05, 2007 11:57 am

Please, any advice!!!!!!!!!!. Thank you.
edu_parada
 
Posts: 33
Joined: Sat Jul 07, 2007 5:53 pm

Postby Antonio Linares » Wed Sep 05, 2007 3:48 pm

Edu,

We are going to build a sample for you
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Thu Sep 06, 2007 9:29 am

Edu,

Please add this new method to Class TXBrowse:
Code: Select all  Expand view  RUN
METHOD SelFont() CLASS TXBrowse

   local oFont, n

   DEFINE FONT oFont FROM USER
   
   for n = 1 to Len( ::aCols )
      ::aCols[ n ]:oDataFont = oFont
   next
   
   ::Refresh()
   
return nil     

Then simply do:
oXBrowse:SelFont()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 79 guests