Page 1 of 2

setting font on Group Box

Posted: Sat May 24, 2008 2:10 am
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:

Posted: Sat May 24, 2008 9:06 am
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

Posted: Sat May 24, 2008 2:42 pm
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,

Posted: Sat May 24, 2008 11:18 pm
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 )

Posted: Mon May 26, 2008 12:26 am
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,

Posted: Mon May 26, 2008 12:03 pm
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.

Posted: Tue May 27, 2008 3:17 am
by fraxzi
Thank you so much for the immediate attention :D


Looking forward for the workaround...



Regards,

Posted: Tue Jun 10, 2008 4:03 pm
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,

Posted: Wed Sep 17, 2008 2:58 pm
by Maurizio
Antonio

Have you found a solution about this problem ?

Grazie MAurizio

FWH 8.11 problem with GROUPBOX within FOLDER

Posted: Sat Nov 29, 2008 1:03 am
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

Posted: Sat Nov 29, 2008 8:08 am
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 )

Posted: Sat Nov 29, 2008 8:18 am
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

Posted: Sat Nov 29, 2008 8:21 am
by Antonio Linares
Lets build a small example to reproduce it...

Posted: Sat Nov 29, 2008 8:24 am
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

Posted: Sat Nov 29, 2008 8:26 am
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