Page 1 of 1

font on disabled combo

Posted: Fri Nov 18, 2011 7:27 am
by José Luis Sánchez
Hello,
I've noticed that disabled combos change the font. When the combo gets enabled, then takes the font of the dialog.
Does anybody knows how to achieve that the disabled combos gets the same font of the others controls of the dialog. I'm not talking about the color of the font, I'm talking about the type and size of the font.

In the image you can see what I'm talking about. The font of the combos from 1 to 6 are disabled with a WHEN clause. The combo of the 7th radiobutton are enabled.

Image

Regards,
José Luis

Re: font on disabled combo

Posted: Sun Nov 20, 2011 5:33 pm
by Wanderson
I confirm this behaviour.

Re: font on disabled combo

Posted: Sun Nov 20, 2011 6:11 pm
by Enrico Maria Giordano
Can you post a little sample showing the problem?

EMG

Re: font on disabled combo

Posted: Sun Nov 20, 2011 7:47 pm
by Wanderson
Enrico look at second combo, looks like a bold font.
Thanks in advance.


#include "FiveWin.ch"

function Main()

local oDlg, oCbx,oCbx1
local cText := " "
local cText1 := "TWO"

DEFINE DIALOG oDlg FROM 10, 10 TO 20, 50 ;
TITLE "DropDown ComboBox Test"

@ 0.5, 1 COMBOBOX oCbx VAR cText STYLE CBS_DROPDOWN ;
ITEMS { "ONE", "TWO", "THREE" } ;
ON CHANGE oDlg:SetText( cText )

@ 2, 1 COMBOBOX oCbx1 VAR cText1 STYLE CBS_DROPDOWN ;
ITEMS { "ONE", "TWO", "THREE" } ;
ON CHANGE oDlg:SetText( cText1 ) when .f.

ACTIVATE DIALOG oDlg CENTERED

return nil

procedure AppSys // Xbase++ requirement

return

Re: font on disabled combo

Posted: Sun Nov 20, 2011 9:21 pm
by Enrico Maria Giordano
Please add:

Code: Select all | Expand

  if Empty( ::oFont )
      DEFINE FONT ::oFont NAME GetSysFont() SIZE 0, -12
   endif


in New() method of TComboBox class, just before

Code: Select all | Expand

if nStyle == CBS_DROPDOWN


statement. Antonio, is it the right fix?

EMG

Re: font on disabled combo

Posted: Tue Nov 22, 2011 5:51 pm
by José Luis Sánchez
Enrico,
Thanks for your interest.
I tried you hack but it does not work. Any other idea ?

Regards,

Re: font on disabled combo

Posted: Tue Nov 22, 2011 6:24 pm
by Enrico Maria Giordano
It worked fine here. Did you recompile combobox.prg with your application?

EMG

Re: font on disabled combo

Posted: Tue Nov 22, 2011 9:35 pm
by mauri.menabue
Hi all
I confirm whit this modify work fine. :D
thank

Re: font on disabled combo

Posted: Wed Nov 23, 2011 3:33 pm
by José Luis Sánchez
Enrico,
I confirm that your changes has no effect in mu program. I use FWH 9.04. Maybe this is a very old version, and in recent ones the changes works fine.

Regards,

Re: font on disabled combo

Posted: Wed Nov 23, 2011 4:15 pm
by Antonio Linares
Jose Luis,

Try this workaround:

Code: Select all | Expand

ACTIVATE DIALOG oDlg CENTERED ;
   ON INIT oCbx1:oGet:SetFont( oCbx:oFont )
 


Enrico,

Your fix looks as a good one, thanks! Included for FWH 11.11 :-)