Page 1 of 1

Choosefont no funciona bien ? (fixed)

PostPosted: Tue Oct 11, 2005 11:22 pm
by Gabri
Hola


Estoy utilizando la funcion Choosefont(), cuando selecciono un tipo de letra y la pongo en negrita, en el array que me devuelve no me lo devuelve con un tipo de letra en negrita, es que funciona mal esta funcion ?


aFont:=Choosefont() > AFont[8] siempre me devuelve .f.

PostPosted: Fri Oct 28, 2005 6:29 am
by Antonio Linares
Gabri,

Acabo de probar este ejemplo, y funciona correctamente. Pulsa el botón, selecciona negrita y verás como el botón se ve en negrita y muestra .t.. Y si luego le quitas negrita, sucede lo contrario. (Que version y build estás usando?):

Code: Select all  Expand view
#include "FiveWin.ch"

static oWnd

function Main()

   local oBtn

   DEFINE WINDOW oWnd TITLE "Testing ChooseFont"

   @ 2, 2 BUTTON oBtn PROMPT "&Choose" OF oWnd ;
      ACTION ( oBtn:GetFont(),;
               oBtn:SelFont(), MsgInfo( oBtn:oFont:lBold ) ) ;  // nSize()
      SIZE 80, 25

   ACTIVATE WINDOW oWnd

return nil

Re: Choosefont no funciona bien ?

PostPosted: Fri Oct 28, 2005 6:45 am
by Antonio Linares
Gabri wrote:aFont:=Choosefont() > AFont[8] siempre me devuelve .f.


El valor negrita no se almacena en la posición 8. Se toma a partir del valor 5:

Code: Select all  Expand view
   
::lBold = If( lFromUser, ! ( ::nWeight == FW_NORMAL ), lBold )