Page 1 of 1

REDEFINE BUTTON with custom font

Posted: Thu Feb 01, 2024 2:44 pm
by Ruth
Dear friends,

I have a font

Code: Select all | Expand

local oFontBold         := TFont():New("Segoe Ui",,-18,,.T.,,,,.F.)
and tie this to
REDEFINE SAY oSay ID 4013 of oDlg FONT oFontBold
...working wonderfully.

now i wonder... is it possible to also style the fonts of buttons and please could you be so kind as to show me how.

this is where i would like to do it

Code: Select all | Expand

   REDEFINE BUTTON ID 4006 OF oDlg ACTION ( oSayAusgewaehlt:refresh(),;
        Ankunftsliste( cCombo, cComboAuswahl ),;
      oBrw:refresh(),;
      oBrw2:refresh(),;
      oSayTreffer:refresh() )
thank you so very much and kind regards to all
ruth

Re: REDEFINE BUTTON with custom font

Posted: Thu Feb 01, 2024 3:33 pm
by karinha

Code: Select all | Expand

STATIC oBtns

FUNCTION...

   LOCAL IDBottons

   oBtns    := ARRAY(12)

   //-> SET FONT OF oBtns[01] TO oFont 
   //-> SET FONT OF oBtns[02] TO oFont 
   //-> SET FONT OF oBtns[03] TO oFont 
   //-> SET FONT OF oBtns[04] TO oFont 
   //-> SET FONT OF oBtns[05] TO oFont 
   //-> SET FONT OF oBtns[06] TO oFont 
   //-> SET FONT OF oBtns[07] TO oFont 
   //-> SET FONT OF oBtns[08] TO oFont 
   //-> SET FONT OF oBtns[09] TO oFont 
   //-> SET FONT OF oBtns[10] TO oFont 
   //-> SET FONT OF oBtns[11] TO oFont 
   //-> SET FONT OF oBtns[12] TO oFont

   //-> .OR.
   FOR IDBottons = 1 TO 12
      SET FONT OF oBtns[IDBottons] TO oFont
   NEXT


RETURN...
 
Regards, saludos.

Re: REDEFINE BUTTON with custom font

Posted: Thu Feb 01, 2024 6:23 pm
by Ruth
Dear Mr. Santos,

this is wonderful :-) Thank you very much!!!
one question please...
is there also a way to say ARRAY(..) without knowing in advance how many elements it will have?

again thank you and kind regards
Ruth

Re: REDEFINE BUTTON with custom font

Posted: Thu Feb 01, 2024 6:45 pm
by karinha
Dear Ruth, I don't know this procedure.

Regards, saludos.

Re: REDEFINE BUTTON with custom font

Posted: Thu Feb 01, 2024 8:13 pm
by cmsoft
Tambien puedes hacerlo sobre el botón si es que lo asignas a una variable como objeto

Code: Select all | Expand

REDEFINE BUTTON oBot ID 4006 OF oDlg ACTION ( oSayAusgewaehlt:refresh(),;
        Ankunftsliste( cCombo, cComboAuswahl ),;
      oBrw:refresh(),;
      oBrw2:refresh(),;
      oSayTreffer:refresh() )
oBot:SetFont(oFontBold)
 
O si no quieres definir cada boton como variable, en el init del dialogo, puedes asignar el font a todos los que sean del tipo boton

Code: Select all | Expand

ACTIVATE DIALOG oDlg CENTERED ;
      VALID MsgYesNo( "Want to end ?" );
   ON INIT AEval( oDlg:aControls, { |o| IF(o:IsKindOf('TBUTTON'),o:SetFont(oFontBold),nil) } )
 

Re: REDEFINE BUTTON with custom font

Posted: Fri Feb 02, 2024 7:14 pm
by Ruth
Dear friends,

thank you very much for your nice anwers. I am gradually beginning to understand a little bit and it is great fun. so thank you again :-)

now the FONT for buttons is working wonderfully and i tried to give CHECKBOX the same font too which works also in a wonderful way.

please could you help me once again: how could i also increase the size of the box itself in CHECKBOX?

Kind regards to you all and have a nice evening
Ruth

Re: REDEFINE BUTTON with custom font

Posted: Sat Feb 03, 2024 11:09 am
by cmsoft
El caso es similar:
Si lo de defines como objeto

Code: Select all | Expand

REDEFINE CHECKBOX oChe ID 4006 OF oDlg 
oChe:SetFont(oFontBold)
 
o a todos los del tipo checkbox

Code: Select all | Expand

ACTIVATE DIALOG oDlg CENTERED ;
      VALID MsgYesNo( "Want to end ?" );
      ON INIT AEval( oDlg:aControls, { |o| IF(o:IsKindOf('TCHECKBOX'),o:SetFont(oFontBold),nil) } )

Re: REDEFINE BUTTON with custom font

Posted: Sat Feb 03, 2024 5:05 pm
by Ruth
Dear Mr. Gomez,

thank you very much -> this is wonderful. I was able to implement it and adjust the font-sizes.
Image

but now I still struggle with the box itself.
Maybe it is possible to have the square form of the checkbox also a little bit bigger?

again thank you and have a nice weekend
Ruth

Re: REDEFINE BUTTON with custom font

Posted: Sun Feb 04, 2024 3:02 pm
by karinha
Ruth, in workshop.exe, try Borland Checkbox Style.

Regards.

Re: REDEFINE BUTTON with custom font

Posted: Sun Feb 04, 2024 9:25 pm
by Detlef
karinha wrote:Ruth, in workshop.exe, try Borland Checkbox Style.

Regards.
Hi João,

do you mean Borland Resource Workshop?
If so, does workshop.exe run on your machine?
On my Windows 11 it crashes. :cry:

Kind regards, Detlef

Re: REDEFINE BUTTON with custom font

Posted: Mon Feb 05, 2024 12:15 pm
by karinha
Detlef wrote:
karinha wrote:Ruth, in workshop.exe, try Borland Checkbox Style.

Regards.
Hi João,

do you mean Borland Resource Workshop?
If so, does workshop.exe run on your machine?
On my Windows 11 it crashes. :cry:

Kind regards, Detlef
Hello friend, look:

https://fivewin.com.br/index.php?/topic ... ent-291687

https://github.com/otya128/winevdm/releases

https://forums.fivetechsupport.com/view ... fa#p244204

Regards, saludos.

Re: REDEFINE BUTTON with custom font

Posted: Mon Feb 05, 2024 1:27 pm
by Ruth
Dear friends,

thank you very much for the answer and also thank you for putting up so kindly with a beginner like me.

kind regards
Ruth

Re: REDEFINE BUTTON with custom font

Posted: Tue Feb 06, 2024 8:51 am
by Detlef
Many thanks João,

I didn't know this emulator.
It works fine. :D

Best regards, Detlef