font on disabled combo

font on disabled combo

Postby José Luis Sánchez » Fri Nov 18, 2011 7: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.

Image

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

Re: font on disabled combo

Postby Wanderson » Sun Nov 20, 2011 5:33 pm

I confirm this behaviour.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: font on disabled combo

Postby Enrico Maria Giordano » Sun Nov 20, 2011 6:11 pm

Can you post a little sample showing the problem?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: font on disabled combo

Postby Wanderson » Sun Nov 20, 2011 7: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
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: font on disabled combo

Postby Enrico Maria Giordano » Sun Nov 20, 2011 9:21 pm

Please add:

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


in New() method of TComboBox class, just before

Code: Select all  Expand view
if nStyle == CBS_DROPDOWN


statement. Antonio, is it the right fix?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: font on disabled combo

Postby José Luis Sánchez » Tue Nov 22, 2011 5:51 pm

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

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

Re: font on disabled combo

Postby Enrico Maria Giordano » Tue Nov 22, 2011 6:24 pm

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: font on disabled combo

Postby mauri.menabue » Tue Nov 22, 2011 9:35 pm

Hi all
I confirm whit this modify work fine. :D
thank
User avatar
mauri.menabue
 
Posts: 155
Joined: Thu Apr 17, 2008 2:38 pm

Re: font on disabled combo

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

Re: font on disabled combo

Postby Antonio Linares » Wed Nov 23, 2011 4:15 pm

Jose Luis,

Try this workaround:

Code: Select all  Expand view
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42085
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 103 guests