setting font on Group Box

User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

setting font on Group Box

Post by fraxzi »

I observed that in .rc has [1 24 "WindowsXP.Manifest" ]

the font set in oFolder:SetFont( oFont ) is inherited by oGroup and direspecting oGroup:Setfont( oNewFont ) :( :( :(


sample .rc

1 24 "WindowsXP.Manifest"


INFOFLD DIALOG 1, 1, 200, 200
STYLE WS_CHILD
FONT 10, "Courier"
{
CONTROL "", 103, "SysTabControl32", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 1, 1, 198, 198
}

INFODLG DIALOG 1, 1, 597, 468
STYLE WS_CHILD
FONT 10, "Courier"
{
GROUPBOX "&Group", 130, 8, 10, 431, 74, BS_GROUPBOX | BS_LEFTTEXT | WS_GROUP
}
....


sample .prg

....
DEFINE DIALOG oDlg RESOURCE "INFOFLD"
....
REDEFINE FOLDER oFolder ID 103 OF oDlg;
PROMPT "INFO";
DIALOGS "INFODLG"

oFolder:SetFont( oFont ) //big font for folder title

REDEFINE GROUP;
ID 130 OF oFolder:aDialogs[ 1 ];
FONT oDlgFont TRANSPARENT //just courier 10


.....BUT..... the font of group box is font of oFolder!?? I even set it like this...


REDEFINE GROUP oGroup;
ID 130 OF oFolder:aDialogs[ 1 ];
FONT oDlgFont TRANSPARENT //just courier 10

oGroup:SetFont( oDlgFont ) // but still font of oFolder....


:? :? :? :? :?


but if i remove [ 1 24 "WindowsXP.Manifest" ] in .RC the groupbox is now controllable... font can be set accordingly.


BUG? :shock:
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Frances,

Here you have a working sample that is working fine here:

test.prg

Code: Select all

#include "FiveWin.ch"

function Main()

   local oDlg, oFont
   
   DEFINE FONT oFont NAME "Verdana" SIZE 0, -12

   DEFINE DIALOG oDlg RESOURCE "test"

   REDEFINE GROUP oGrp ID 100 OF oDlg

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT oGrp:SetFont( oFont )

   oFont:End()

return nil
test.rc

Code: Select all

1 24 "WindowsXP.Manifest"

test DIALOG 17, 36, 120, 116
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Test"
FONT 8, "MS Sans Serif"
{
 GROUPBOX "Group", 100, 9, 6, 103, 79, BS_GROUPBOX
 DEFPUSHBUTTON "OK", 1, 62, 93, 50, 14
}
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Post by fraxzi »

Thank you so much for your reply!


It is very clear in your code that dialog and group object from .rc are working pretty well....

But the issue is when you define folder with tab...or tabs... with define dialog and group object... that the font set to group is not possible ..? :? ? but using the font of folder wherein defined as bigger than it's child dialog with group object... thus making the group looks funny.... with xp manifest in the rc.

..but without xp manifest, the group object's font is showing correctly.



Please see the above code again.


regards,
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Frances,

Please try the call to oGroup:SetFont( oDlgFont ) from the ON INIT clause of your main dialog:

ACTIVATE DIALOG oDlg ON INIT oGroup:SetFont( oDlgFont )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Post by fraxzi »

Mr. Antonio,


Unfortunately same thing happened. Groupboxes fonts cannot be set under dialog of folder:adialogs[1] with defined xp manifest in .RC

Maybe really a bug in group class... ? :? ?



Regards,
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Frances,

We have reviewing the Class TGroup and it does not seem as a bug inside it as it does not paint the text at all.

It looks as a side effect of the use of themes and the use of a folder.

We keep doing tests to see if we can find a workaround for it.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Post by fraxzi »

Thank you so much for the immediate attention :D


Looking forward for the workaround...



Regards,
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Post by fraxzi »

Mr. Antonio,

The effect of themes + folder font + group box font is really an issue for me.

I cant find any solution with app on themed with folder font and groupbox font mix together...

oGroup:oFont.. is 'courier 10' but the display (under xp theme) oFolder's font ... 'times 22'

This is not only confusing.. :(


Regards,
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Post by Maurizio »

Antonio

Have you found a solution about this problem ?

Grazie MAurizio
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

FWH 8.11 problem with GROUPBOX within FOLDER

Post by fraxzi »

This is still an issue with FWH 8.11

If the groupbox has caption...

Image

a painful workaround is to define SAY object and put on top of groupbox (without caption) :cry: :cry: :cry: :cry:


any solution yet?

Regards
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Frances,

Each page of a folder contains a dialog that may be getting its font from its container (the folder), and the groupbox may be using the same font by default.

Have you tried to change the groupbox font ? oGroup:SetFont( oFont )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Post by fraxzi »

Yes. I assigned diff font to groupbox, say and get objects with expected results. Only that icon of folder affects the groupboxes (themed)..


I tried oGroup:SetFont( oFont ) on dialog init and other workarounds but to no avail.

this mystery does not exist on NON-THEMED apps... It should be solved by FWH8.11 :P :P :P :P


Please help for this is not convenient programming...


Regards
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Lets build a small example to reproduce it...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Code: Select all

#include "FiveWin.ch" 

function Main() 

   local oDlg, oFld, oGrp 
    
   DEFINE DIALOG oDlg SIZE 400, 300 

   @ 0.5, 1 FOLDER oFld OF oDlg SIZE 188, 138 ; 
      PROMPTS "One", "Two", "Three" 
      
   @ 1, 1 GROUP oGrp TO 5, 15 PROMPT "Test" OF oFld:aDialogs[ 1 ]
      
   ACTIVATE DIALOG oDlg CENTERED 

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Setting a font. Is this what you mean ? :-)

Code: Select all

#include "FiveWin.ch" 

function Main() 

   local oFnt, oDlg, oFld, oGrp 
    
   DEFINE FONT oFnt NAME "Verdana" SIZE 0, -16 BOLD 
    
   DEFINE DIALOG oDlg SIZE 400, 300 FONT oFnt

   @ 0.5, 1 FOLDER oFld OF oDlg SIZE 188, 138 ; 
      PROMPTS "One", "Two", "Three" 
      
   @ 1, 1 GROUP oGrp TO 5, 15 PROMPT "Test" OF oFld:aDialogs[ 1 ]
      
   ACTIVATE DIALOG oDlg CENTERED 

return nil 
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply