FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour REDEFINE BUTTON with custom font
Posts: 179
Joined: Fri Dec 07, 2007 01:26 PM
REDEFINE BUTTON with custom font
Posted: Thu Feb 01, 2024 02:44 PM
Dear friends,

I have a font
Code (fw): Select all Collapse
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 (fw): Select all Collapse
   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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: REDEFINE BUTTON with custom font
Posted: Thu Feb 01, 2024 03:33 PM
Code (fw): Select all Collapse
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
Posts: 179
Joined: Fri Dec 07, 2007 01:26 PM
Re: REDEFINE BUTTON with custom font
Posted: Thu Feb 01, 2024 06: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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: REDEFINE BUTTON with custom font
Posted: Thu Feb 01, 2024 06:45 PM

Dear Ruth, I don't know this procedure.

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: REDEFINE BUTTON with custom font
Posted: Thu Feb 01, 2024 08:13 PM
Tambien puedes hacerlo sobre el botón si es que lo asignas a una variable como objeto
Code (fw): Select all Collapse
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 (fw): Select all Collapse
ACTIVATE DIALOG oDlg CENTERED ;
      VALID MsgYesNo( "Want to end ?" );
   ON INIT AEval( oDlg:aControls, { |o| IF(o:IsKindOf('TBUTTON'),o:SetFont(oFontBold),nil) } )
Posts: 179
Joined: Fri Dec 07, 2007 01:26 PM
Re: REDEFINE BUTTON with custom font
Posted: Fri Feb 02, 2024 07: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
Posts: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: REDEFINE BUTTON with custom font
Posted: Sat Feb 03, 2024 11:09 AM
El caso es similar:
Si lo de defines como objeto
Code (fw): Select all Collapse
REDEFINE CHECKBOX oChe ID 4006 OF oDlg 
oChe:SetFont(oFontBold)
o a todos los del tipo checkbox
Code (fw): Select all Collapse
ACTIVATE DIALOG oDlg CENTERED ;
      VALID MsgYesNo( "Want to end ?" );
      ON INIT AEval( oDlg:aControls, { |o| IF(o:IsKindOf('TCHECKBOX'),o:SetFont(oFontBold),nil) } )
Posts: 179
Joined: Fri Dec 07, 2007 01:26 PM
Re: REDEFINE BUTTON with custom font
Posted: Sat Feb 03, 2024 05:05 PM
Dear Mr. Gomez,

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


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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: REDEFINE BUTTON with custom font
Posted: Sun Feb 04, 2024 03:02 PM

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

Regards.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 218
Joined: Mon Feb 07, 2022 09:54 PM
Re: REDEFINE BUTTON with custom font
Posted: Sun Feb 04, 2024 09: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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: REDEFINE BUTTON with custom font
Posted: Mon Feb 05, 2024 12:15 PM
Detlef 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
Posts: 179
Joined: Fri Dec 07, 2007 01:26 PM
Re: REDEFINE BUTTON with custom font
Posted: Mon Feb 05, 2024 01: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

Posts: 218
Joined: Mon Feb 07, 2022 09:54 PM
Re: REDEFINE BUTTON with custom font
Posted: Tue Feb 06, 2024 08:51 AM
Many thanks João,

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

Best regards, Detlef

Continue the discussion