font on disabled combo

Post Reply
User avatar
José Luis Sánchez
Posts: 556
Joined: Thu Oct 13, 2005 9:23 am
Location: Novelda - Alicante - España
Contact:

font on disabled combo

Post 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
Wanderson
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: font on disabled combo

Post by Wanderson »

I confirm this behaviour.
User avatar
Enrico Maria Giordano
Posts: 8769
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 6 times
Contact:

Re: font on disabled combo

Post by Enrico Maria Giordano »

Can you post a little sample showing the problem?

EMG
Wanderson
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: font on disabled combo

Post 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
User avatar
Enrico Maria Giordano
Posts: 8769
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 6 times
Contact:

Re: font on disabled combo

Post 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
User avatar
José Luis Sánchez
Posts: 556
Joined: Thu Oct 13, 2005 9:23 am
Location: Novelda - Alicante - España
Contact:

Re: font on disabled combo

Post by José Luis Sánchez »

Enrico,
Thanks for your interest.
I tried you hack but it does not work. Any other idea ?

Regards,
User avatar
Enrico Maria Giordano
Posts: 8769
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 6 times
Contact:

Re: font on disabled combo

Post by Enrico Maria Giordano »

It worked fine here. Did you recompile combobox.prg with your application?

EMG
User avatar
mauri.menabue
Posts: 165
Joined: Thu Apr 17, 2008 2:38 pm

Re: font on disabled combo

Post by mauri.menabue »

Hi all
I confirm whit this modify work fine. :D
thank
User avatar
José Luis Sánchez
Posts: 556
Joined: Thu Oct 13, 2005 9:23 am
Location: Novelda - Alicante - España
Contact:

Re: font on disabled combo

Post 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,
User avatar
Antonio Linares
Site Admin
Posts: 42644
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 59 times
Been thanked: 93 times
Contact:

Re: font on disabled combo

Post 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 :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply