Font in a RADIO Controll ?

Font in a RADIO Controll ?

Postby NK » Tue Jul 18, 2006 2:28 pm

Hallo,

how do I can set the Font of a RADIO controll in a Folder?
RADIO Controll from Source (@ x,y RADIO ...)

Best regards
Norbert
User avatar
NK
 
Posts: 97
Joined: Sun Nov 20, 2005 4:32 pm
Location: Germany

Re: Font in a RADIO Controll ?

Postby Enrico Maria Giordano » Tue Jul 18, 2006 4:48 pm

Can you show me a reduced and self-contained sample of the problem?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8600
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Font in a RADIO Controll ?

Postby NK » Tue Jul 18, 2006 5:01 pm

EnricoMaria wrote:Can you show me a reduced and self-contained sample of the problem?

EMG


Dear Enrico,

use the Sample TESTRAD2.PRG

Code: Select all  Expand view
function Main()

   local nValue := 3, oRad

   SET _3DLOOK ON
   SET HELPFILE TO "Test.hlp"

   DEFINE WINDOW oWnd ;
      TITLE "Testing a Radio Buttons Menu" COLOR "N/W"

   @ 1, 1 BUTTON "&Test" SIZE 70, 20 ;
      ACTION ( MsgInfo( nValue ), oRad:aItems[ 2 ]:SetText( "&Changed!" ) )

   @ 3, 2 RADIO oRad VAR nValue ;
      ITEMS "&One", "&Two", "T&hree" _3D SIZE 150, 25 ;
      HELPID 100, 101, 102 ;
      ON CHANGE MsgBeep()

   // adding an extra radio item at a different location
   @ 5, 25 RADIOITEM "Fo&ur" RADIOMENU oRad OF oWnd SIZE 150, 25

   ACTIVATE WINDOW oWnd

return nil


where can i change the Text "&One", "&Two", "T&hree" to an smaler font ?

Best regards, Norbert
User avatar
NK
 
Posts: 97
Joined: Sun Nov 20, 2005 4:32 pm
Location: Germany

Postby Antonio Linares » Tue Jul 18, 2006 6:09 pm

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

function Main()

   local nValue := 3, oRad, oFont, n

   SET _3DLOOK ON
   SET HELPFILE TO "Test.hlp"

   DEFINE WINDOW oWnd ;
      TITLE "Testing a Radio Buttons Menu" COLOR "N/W"

   @ 1, 1 BUTTON "&Test" SIZE 70, 20 ;
      ACTION ( MsgInfo( nValue ), oRad:aItems[ 2 ]:SetText( "&Changed!" ) )

   @ 3, 2 RADIO oRad VAR nValue ;
      ITEMS "&One", "&Two", "T&hree" _3D SIZE 150, 25 ;
      HELPID 100, 101, 102 ;
      ON CHANGE MsgBeep()

   // adding an extra radio item at a different location
   @ 5, 25 RADIOITEM "Fo&ur" RADIOMENU oRad OF oWnd SIZE 150, 25

   DEFINE FONT oFont NAME "Verdana" SIZE 0, -10

   for n = 1 to Len( oRad:aItems )
      oRad:aItems[ n ]:SetFont( oFont )
   next   

   ACTIVATE WINDOW oWnd

return nil
regards, saludos

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

Re: Font in a RADIO Controll ?

Postby Enrico Maria Giordano » Tue Jul 18, 2006 6:16 pm

Here it is:

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


function Main()

   local oWnd

   local nValue := 3, oRad

   local oFnt

   SET _3DLOOK ON
   SET HELPFILE TO "Test.hlp"

   DEFINE FONT oFnt NAME "Arial" SIZE 0, -8

   DEFINE WINDOW oWnd ;
      TITLE "Testing a Radio Buttons Menu" COLOR "N/W"

   @ 1, 1 BUTTON "&Test" SIZE 70, 20 ;
      ACTION ( MsgInfo( nValue ), oRad:aItems[ 2 ]:SetText( "&Changed!" ) )

   @ 1, 20 BUTTON "&Change font" SIZE 70, 20 ;
      ACTION ( oRad:aItems[ 2 ]:SetFont( oFnt ),;
               INVALIDATERECT( oRad:aItems[ 2 ]:hWnd ) )

   @ 3, 2 RADIO oRad VAR nValue ;
      ITEMS "&One", "&Two", "T&hree" _3D SIZE 150, 25 ;
      HELPID 100, 101, 102 ;
      ON CHANGE MsgBeep()

   // adding an extra radio item at a different location
   @ 5, 25 RADIOITEM "Fo&ur" RADIOMENU oRad OF oWnd SIZE 150, 25

   ACTIVATE WINDOW oWnd

   RELEASE FONT oFnt

return nil


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8600
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Font in a RADIO Controll ?

Postby NK » Wed Jul 19, 2006 7:14 am

EnricoMaria wrote:Here it is:

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


function Main()

   local oWnd

   local nValue := 3, oRad

   local oFnt

   SET _3DLOOK ON
   SET HELPFILE TO "Test.hlp"

   DEFINE FONT oFnt NAME "Arial" SIZE 0, -8

   DEFINE WINDOW oWnd ;
      TITLE "Testing a Radio Buttons Menu" COLOR "N/W"

   @ 1, 1 BUTTON "&Test" SIZE 70, 20 ;
      ACTION ( MsgInfo( nValue ), oRad:aItems[ 2 ]:SetText( "&Changed!" ) )

   @ 1, 20 BUTTON "&Change font" SIZE 70, 20 ;
      ACTION ( oRad:aItems[ 2 ]:SetFont( oFnt ),;
               INVALIDATERECT( oRad:aItems[ 2 ]:hWnd ) )

   @ 3, 2 RADIO oRad VAR nValue ;
      ITEMS "&One", "&Two", "T&hree" _3D SIZE 150, 25 ;
      HELPID 100, 101, 102 ;
      ON CHANGE MsgBeep()

   // adding an extra radio item at a different location
   @ 5, 25 RADIOITEM "Fo&ur" RADIOMENU oRad OF oWnd SIZE 150, 25

   ACTIVATE WINDOW oWnd

   RELEASE FONT oFnt

return nil


EMG


It functions, thank you very much at you.

Best regards, Norbert
User avatar
NK
 
Posts: 97
Joined: Sun Nov 20, 2005 4:32 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 119 guests