REDEFINE BUTTON with custom font

Post Reply
User avatar
Ruth
Posts: 172
Joined: Fri Dec 07, 2007 1:26 pm
Contact:

REDEFINE BUTTON with custom font

Post 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
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: REDEFINE BUTTON with custom font

Post 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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Ruth
Posts: 172
Joined: Fri Dec 07, 2007 1:26 pm
Contact:

Re: REDEFINE BUTTON with custom font

Post 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
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: REDEFINE BUTTON with custom font

Post by karinha »

Dear Ruth, I don't know this procedure.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
cmsoft
Posts: 1293
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: REDEFINE BUTTON with custom font

Post 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) } )
 
User avatar
Ruth
Posts: 172
Joined: Fri Dec 07, 2007 1:26 pm
Contact:

Re: REDEFINE BUTTON with custom font

Post 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
User avatar
cmsoft
Posts: 1293
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: REDEFINE BUTTON with custom font

Post 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) } )
User avatar
Ruth
Posts: 172
Joined: Fri Dec 07, 2007 1:26 pm
Contact:

Re: REDEFINE BUTTON with custom font

Post 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
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: REDEFINE BUTTON with custom font

Post by karinha »

Ruth, in workshop.exe, try Borland Checkbox Style.

Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Detlef
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm

Re: REDEFINE BUTTON with custom font

Post 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
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: REDEFINE BUTTON with custom font

Post 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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Ruth
Posts: 172
Joined: Fri Dec 07, 2007 1:26 pm
Contact:

Re: REDEFINE BUTTON with custom font

Post 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
User avatar
Detlef
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm

Re: REDEFINE BUTTON with custom font

Post by Detlef »

Many thanks João,

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

Best regards, Detlef
Post Reply