BTNBMP FONT

Post Reply
Ladinilson
Posts: 14
Joined: Wed Feb 04, 2009 9:38 pm

BTNBMP FONT

Post by Ladinilson »

Hello everyone,

I am using BTNBMP to show a set of buttons but I have already modified the FONT several times and it does not change.

I can even set the font but I can't increase the size

Do any of you know any solutions?

Code: Select all

REDEFINE BTNBMP ButQST[nContST] ID nIDST OF oStObj FONT oFont13 PROMPT ALLTRIM(STR(nContST,2)) PIXELS ;
FILE "H:\LSOFT\BINGO\FIGURAS\BOLAQD.PNG" ADJUST CENTER NOBORDER TRANSPARENT

ButQST[nContST]:SETCOLOR( NRGB(180,180,180) )  
Thank you!
Last edited by Ladinilson on Thu Feb 11, 2021 9:15 pm, edited 1 time in total.
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: BTNBMP FONT

Post by nageswaragunupudi »

You can change font, size everything.
Let us know how you tried and what is not working for you.
Regards

G. N. Rao.
Hyderabad, India
Ladinilson
Posts: 14
Joined: Wed Feb 04, 2009 9:38 pm

Re: BTNBMP FONT

Post by Ladinilson »

I change the size of the FONT but it remains with a defined size ...

Code: Select all

DEFINE FONT oFont2000 NAME "ARIAL ROUNDED MT BOLD" SIZE 0,-14 BOLD

DEFINE FONT oFont2000 NAME "ARIAL ROUNDED MT BOLD" SIZE 0,-18 BOLD

DEFINE FONT oFont2000 NAME "ARIAL ROUNDED MT BOLD" SIZE 0,-32 BOLD

DEFINE FONT oFont2000 NAME "ARIAL ROUNDED MT BOLD" SIZE 0,-46 BOLD
 
I changed for all these sizes but it hasn't changed
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: BTNBMP FONT

Post by nageswaragunupudi »

If you want to change the font of BtnBmp (or any control, window, dialog)

DEFINE oNewFont NAME ....................
and then
oBtn:SetFont( oNewFont )
RELEASE FONT oNewFont
Regards

G. N. Rao.
Hyderabad, India
Ladinilson
Posts: 14
Joined: Wed Feb 04, 2009 9:38 pm

Re: BTNBMP FONT

Post by Ladinilson »

Yes i already tried this...

Code: Select all

ButQST[nContST]:SETFONT(oFont2000)
just like this ...

Code: Select all

ButQST[nContST]:oFontBold := oFont2000
and I didn't get any results
I think you are at REDEFINE this problem because using @ it seems that it works
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: BTNBMP FONT

Post by nageswaragunupudi »

I think you are at REDEFINE this problem because using @ it seems that it works
No. It is because you are not doing it correctly.

Please try this program:

Code: Select all

#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

   local oDlg, aBtn[ 3 ]
   local oFont1, oFont2

   DEFINE FONT oFont1 NAME "TAHOMA" SIZE 0,-12
   DEFINE DIALOG oDlg RESOURCE "Main" FONT oFont1

   REDEFINE BTNBMP aBtn[ 1 ] PROMPT "Change" + CRLF + "Font" ID 110 OF oDlg CENTER
   aBtn[ 1 ]:bAction := <||
      DEFINE FONT oFont2 NAME "VERDANA" SIZE 0,-16 BOLD
      AEval( aBtn, { |oBtn| oBtn:SetFont( oFont2 ), oBtn:Refresh() } )
      RELEASE FONT oFont2
      return nil
      >

   REDEFINE BTNBMP aBtn[ 2 ] PROMPT "Multi" + CRLF + "Line"    ID 120 OF oDlg CENTER ;
      ACTION AEval( aBtn, { |oBtn| oBtn:oFontBold := oFont1, oBtn:Refresh() } )

   REDEFINE BTNBMP aBtn[ 3 ] PROMPT "Old" + CRLF + "Font"  ID 130 OF oDlg CENTER ;
      ACTION AEval( aBtn, { |oBtn| oBtn:oFontBold := nil, oBtn:SetFont( oFont1 ), oBtn:Refresh() } )

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont1

return nil
 
rc file:

Code: Select all

#include "..\include\WinApi.ch"

main DIALOG 50, 67, 162, 76
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "FiveWin Class TBtnBmp"
FONT 12, "MS Sans Serif"
{
 CONTROL "", 110, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 9, 41, 43, 21
 CONTROL "", 120, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 60, 41, 43, 21
 CONTROL "", 130, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 110, 41, 43, 21
}
Image
Regards

G. N. Rao.
Hyderabad, India
Ladinilson
Posts: 14
Joined: Wed Feb 04, 2009 9:38 pm

Re: BTNBMP FONT

Post by Ladinilson »

Thanks G. N. Rao.!
Post Reply