REDEFINE BUTTON with custom font

REDEFINE BUTTON with custom font

Postby Ruth » Thu Feb 01, 2024 2:44 pm

Dear friends,

I have a font
Code: Select all  Expand view

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 view
  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
Ruth
 
Posts: 169
Joined: Fri Dec 07, 2007 1:26 pm

Re: REDEFINE BUTTON with custom font

Postby karinha » Thu Feb 01, 2024 3:33 pm

Code: Select all  Expand view

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

Re: REDEFINE BUTTON with custom font

Postby Ruth » Thu Feb 01, 2024 6:23 pm

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
Ruth
 
Posts: 169
Joined: Fri Dec 07, 2007 1:26 pm

Re: REDEFINE BUTTON with custom font

Postby karinha » Thu Feb 01, 2024 6:45 pm

Dear Ruth, I don't know this procedure.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: REDEFINE BUTTON with custom font

Postby cmsoft » Thu Feb 01, 2024 8:13 pm

Tambien puedes hacerlo sobre el botón si es que lo asignas a una variable como objeto
Code: Select all  Expand view

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 view

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

Re: REDEFINE BUTTON with custom font

Postby Ruth » Fri Feb 02, 2024 7:14 pm

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
Ruth
 
Posts: 169
Joined: Fri Dec 07, 2007 1:26 pm

Re: REDEFINE BUTTON with custom font

Postby cmsoft » Sat Feb 03, 2024 11:09 am

El caso es similar:
Si lo de defines como objeto
Code: Select all  Expand view

REDEFINE CHECKBOX oChe ID 4006 OF oDlg
oChe:SetFont(oFontBold)
 

o a todos los del tipo checkbox
Code: Select all  Expand view

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

Re: REDEFINE BUTTON with custom font

Postby Ruth » Sat Feb 03, 2024 5:05 pm

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
Ruth
 
Posts: 169
Joined: Fri Dec 07, 2007 1:26 pm

Re: REDEFINE BUTTON with custom font

Postby karinha » Sun Feb 04, 2024 3:02 pm

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

Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: REDEFINE BUTTON with custom font

Postby Detlef » Sun Feb 04, 2024 9:25 pm

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

Re: REDEFINE BUTTON with custom font

Postby karinha » Mon Feb 05, 2024 12:15 pm

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/30233-contribui%C3%A7%C3%A3o-workshop-rodar-em-windows-64-bits/#comment-291687

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

https://forums.fivetechsupport.com/viewtopic.php?f=3&t=40827&p=244204&hilit=otvdmw&sid=205990b04a4baef0d071d40198f24082&sid=f5e3ea7830665c01e77212e01dc4d5fa#p244204

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: REDEFINE BUTTON with custom font

Postby Ruth » Mon Feb 05, 2024 1:27 pm

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
Ruth
 
Posts: 169
Joined: Fri Dec 07, 2007 1:26 pm

Re: REDEFINE BUTTON with custom font

Postby Detlef » Tue Feb 06, 2024 8:51 am

Many thanks João,

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

Best regards, Detlef
User avatar
Detlef
 
Posts: 207
Joined: Mon Feb 07, 2022 9:54 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 38 guests