Cambiar fuente en una buttonbar (Para Antonio)

Cambiar fuente en una buttonbar (Para Antonio)

Postby fgondi » Mon Sep 07, 2009 5:11 pm

Estoy probando a intentar cambiar la fuente del texto en los botones de una barra de botones y no consiguo que lo cambie

El ejemplo con el que estoy probando es este (Copiado de samples/3dobj.prg):

Code: Select all  Expand view
function Main()

   local oBar, oFont2

   DEFINE FONT oFont2 Name "Ms Sans Serif" Size 0, -20
   
   DEFINE WINDOW oWnd TITLE "3D objects"

   DEFINE BUTTONBAR oBar _3D OF oWnd

   DEFINE BUTTON OF oBar Prompt 'Hola'

   SET MESSAGE OF oWnd TO "3D Objects" NOINSET CLOCK DATE KEYBOARD

   ACTIVATE WINDOW oWnd

return nil
 

Ya he probado con:
Code: Select all  Expand view
oBar:SetFont( oFont2 )
 

y con:
Code: Select all  Expand view
DEFINE BUTTON OF oBar Prompt 'Hola' Font oFont2


e incluso con las dos a la vez
Last edited by fgondi on Tue Sep 08, 2009 3:25 pm, edited 1 time in total.
Un saludo
Fernando González Diez
ALSIS Sistemas Informáticos
User avatar
fgondi
 
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España

Re: Cambiar fuente en una buttonbar

Postby jrestojeda » Mon Sep 07, 2009 8:03 pm

Hola amigo...
Yo me cruzé con ese tema en su momento.
La solución fue modificar la clase TBtnBmp.

Verifica esta pequeña modificación en el método Paint()
Antes:
Code: Select all  Expand view
if ::oWnd:oFont != nil
   if ::oWnd:oFont:cFaceName != "Tahoma"
      DEFINE FONT oFont NAME "Tahoma" SIZE 0, -11
      ::oWnd:SetFont( oFont )
   endif
else
   DEFINE FONT oFont NAME "Tahoma" SIZE 0, -11
   ::oWnd:SetFont( oFont )
endif
 


Después:
Code: Select all  Expand view
IF ::oFont == NIL
   if ::oWnd:oFont != nil
      if ::oWnd:oFont:cFaceName != "Tahoma"
         DEFINE FONT oFont NAME "Tahoma" SIZE 0, -11
      endif
   else
       DEFINE FONT oFont NAME "Tahoma" SIZE 0, -11
   endif
   ::oWnd:SetFont( oFont )
else
   ::oWnd:SetFont( ::oFont )
endif
 


Con esta modificación defino los botones de la siguiente manera:
Code: Select all  Expand view
DEFINE BUTTON oBtn5 OF oBar RESOURCE "AGENDA" LEFT;
   PROMPT "ABM de"+CRLF+"actividades diarias";
   TOOLTIP "ABM de actividades diarias";
   FONT oFont1 NOBORDER;
   ACTION Calendario(oWnd,Empresa)
 


Espero te sirva..
Ojeda Esteban Eduardo.
Buenos Aires - Argentina.
FWH - PellesC - DBF/CDX - ADS - Gloriosos .Bat - MySql - C# .net - FastReport
Skype: jreduojeda
User avatar
jrestojeda
 
Posts: 601
Joined: Wed Jul 04, 2007 3:51 pm
Location: Buenos Aires - Argentina

Re: Cambiar fuente en una buttonbar

Postby fgondi » Mon Sep 07, 2009 8:51 pm

jrestojeda,

Funciona a las mil maravillas.

Muchisimas gracias por tu ayuda
Un saludo
Fernando González Diez
ALSIS Sistemas Informáticos
User avatar
fgondi
 
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España

Re: Cambiar fuente en una buttonbar

Postby jrestojeda » Tue Sep 08, 2009 1:35 pm

Me alegro de saber que te funcionó perfectamente!
Saludos,
Ojeda Esteban Eduardo.
Buenos Aires - Argentina.
FWH - PellesC - DBF/CDX - ADS - Gloriosos .Bat - MySql - C# .net - FastReport
Skype: jreduojeda
User avatar
jrestojeda
 
Posts: 601
Joined: Wed Jul 04, 2007 3:51 pm
Location: Buenos Aires - Argentina

Re: Cambiar fuente en una buttonbar

Postby fgondi » Tue Sep 08, 2009 3:23 pm

Antonio,

¿Se puede incluir esta modificación para futuras revisiones?
Un saludo
Fernando González Diez
ALSIS Sistemas Informáticos
User avatar
fgondi
 
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España

Re: Cambiar fuente en una buttonbar (Para Antonio)

Postby Daniel Garcia-Gil » Tue Sep 08, 2009 5:33 pm

Saludos fgondi, jrestojeda

fgondi wrote:¿Se puede incluir esta modificación para futuras revisiones?


si, de hecho jrestojeda lo habia solicitado hace un tiempo y no se habia incluido, esperamos tenerlo incluido en la proxima version
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Cambiar fuente en una buttonbar (Para Antonio)

Postby Daniel Garcia-Gil » Tue Sep 08, 2009 5:40 pm

Listo...

el cambio esta incluido en la proxima version
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: cmsoft, Google [Bot] and 29 guests