FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour font on disabled combo
Posts: 564
Joined: Thu Oct 13, 2005 09:23 AM
font on disabled combo
Posted: Fri Nov 18, 2011 07:27 AM
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.



Regards,
José Luis
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Re: font on disabled combo
Posted: Sun Nov 20, 2011 05:33 PM

I confirm this behaviour.

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: font on disabled combo
Posted: Sun Nov 20, 2011 06:11 PM

Can you post a little sample showing the problem?

EMG

Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Re: font on disabled combo
Posted: Sun Nov 20, 2011 07:47 PM

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

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: font on disabled combo
Posted: Sun Nov 20, 2011 09:21 PM
Please add:

Code (fw): Select all Collapse
   if Empty( ::oFont )
      DEFINE FONT ::oFont NAME GetSysFont() SIZE 0, -12
   endif


in New() method of TComboBox class, just before

Code (fw): Select all Collapse
if nStyle == CBS_DROPDOWN


statement. Antonio, is it the right fix?

EMG
Posts: 564
Joined: Thu Oct 13, 2005 09:23 AM
Re: font on disabled combo
Posted: Tue Nov 22, 2011 05:51 PM

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

Regards,

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: font on disabled combo
Posted: Tue Nov 22, 2011 06:24 PM

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

EMG

Posts: 181
Joined: Thu Apr 17, 2008 02:38 PM
Re: font on disabled combo
Posted: Tue Nov 22, 2011 09:35 PM

Hi all
I confirm whit this modify work fine. :D
thank

Posts: 564
Joined: Thu Oct 13, 2005 09:23 AM
Re: font on disabled combo
Posted: Wed Nov 23, 2011 03:33 PM

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,

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: font on disabled combo
Posted: Wed Nov 23, 2011 04:15 PM
Jose Luis,

Try this workaround:

Code (fw): Select all Collapse
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

Continue the discussion