Problems with Checkbox

User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Re: Problems with Checkbox

Post by Maurizio »

Ciao Enrico

With fw 11.04
I insert METHOD HandleEvent() INLINE NIL in checkbox.prg

but the problem persist in radio.
Image

Uploaded with ImageShack.us
Regards MAurizio
Last edited by Maurizio on Mon May 09, 2011 8:02 am, edited 1 time in total.
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: Problems with Checkbox

Post by Richard Chidiak »

Maurizio

it has worked in my tests under win7 64 bits , can you tell us what OS you are testing on ? xp ? 7 ? with themes or without ?

I had a solution modifying control prg , here it is, please report back if it fixes the problem

Hth

Richard

Code: Select all


METHOD Colors( hDC ) CLASS TControl

   DEFAULT ::nClrText := GetTextColor( hDC ),;
           ::nClrPane := GetBkColor( hDC ),;
           ::oBrush   := TBrush():New( , ::nClrPane ),;
           ::lTransparent := .f.

   SetTextColor( hDC, ::nClrText )
   SetBkColor( hDC, ::nClrPane )

   if ::lTransparent
      SetBkMode( hDC, 1 ) // TRANSPARENT
      if IsAppThemed()
         if ! Empty( ::oBrush:hBitmap )
            SetBrushOrgEx( hDC, nBmpWidth( ::oBrush:hBitmap ) - ::nLeft, nBmpHeight( ::oBrush:hBitmap ) - ::nTop )
            FillRect( hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
         else            //  This condition is added by RAMESH BABU P on Nov. 06, 2006
            if Upper( ::ClassName() ) $ "TCHECKBOX;TRADIO;TGROUP"
                //DrawPBack( ::hWnd,  hDC )  // chidiak remove this line
               ParentImage( ::hWnd, hDC )    // chidiak fwh 11.04 may 08 2011
               if Upper( ::ClassName() ) != "TGROUP"
//                  SendMessage( ::oWnd:hWnd, WM_ERASEBKGND, hDC, 0 ) // to properly remove/set the dotted rect  // chidiak remove this line !!!!!!
               endif
            endif
         endif
      endif
   else
      if IsAppThemed() .and. Upper( ::ClassName() ) $ "TCHECKBOX;TRADIO;TGROUP"
           ParentImage( ::hWnd, hDC ) // chidiak
//         DrawPBack( ::hWnd,  hDC )  // chidiak remove this line
      endif
   endif

return ::oBrush:hBrush
 
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Problems with Checkbox

Post by Silvio »

This modifies has made from Linares from many mounth ago

but I saw it was never modfied on the fwh relase and the problem persisted.... as mant others problems corrected but not saved

I sad I found the solution on control.prg ( if you read my message at the top of this topic).
Best Regards, Saludos

Falconi Silvio
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: Problems with Checkbox

Post by Richard Chidiak »

Silvio

The control.prg published in this forum by Antonio several months ago is exactly the same in fwh 11.04 , and the problem is still there

In Maurizio's image , Checkbox is ok but not radios...


Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Problems with Checkbox

Post by Silvio »

I trying with radio now because I had problem this summer

with radio control but Now Not remember how I resolved it

I'm searching on my cds backup
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Problems with Checkbox

Post by Silvio »

here run ok now
please try to rem this line

if IsAppThemed() .and. Upper( ::ClassName() ) $ "TCHECKBOX;TRADIO;TGROUP"
// ParentImage( ::hWnd, hDC ) // chidiak
// DrawPBack( ::hWnd, hDC ) // chidiak remove this line
endif
endif

return ::oBrush:hBrush


I tried this test

Code: Select all

 #include"fivewin.ch"

FUNCTION TEST()
   LOCAL oDlg,oFont,aGet[14],oFld
   Local nRutipo:=4 ,  nRUPAG:=2
    LOCAL  cRUACT :=.f.
    LOCAL  cRUACT2 :=.f.
      LOCAL  cRUACT3 :=.f.


DEFINE FONT oFont NAME "MS Sans Serif" SIZE 0, 8
DEFINE DIALOG oDlg FROM 100, 100 TO 510,608;
                 TITLE "TEST" PIXEL FONT oFont



  @ 10, 50    RADIO aGet[1] VAR nRutipo PROMPT "&Utente registrato" PIXEL SIZE 50, 12  OF oDlg
         @ 10, 104  RADIOITEM "Elenco email" RADIOMENU aGet[1]  PIXEL SIZE 50, 12   OF oDlg
         @ 10, 155 RADIOITEM "&Amico personale" RADIOMENU aGet[1]  PIXEL SIZE 50, 12 OF oDlg
         @ 10, 210 RADIOITEM "Altro" RADIOMENU aGet[1]      PIXEL SIZE 40, 12    OF oDlg


              aGet[1]:aItems[ nRutipo ]:Check()



   @ 90, 142 SAY "Act.:" OF oDlg SIZE 27, 8 PIXEL FONT oFont
   @ 89, 154 CHECKBOX aGet[12] VAR    cRUACT  PROMPT ""  OF oDlg SIZE 10, 10 PIXEL FONT oFont   UPDATE
   @ 111, 154 CHECKBOX aGet[13] VAR    cRUACT2  PROMPT ""  OF oDlg SIZE 10, 10 PIXEL FONT oFont   UPDATE
   @ 121, 154 CHECKBOX aGet[14] VAR    cRUACT3  PROMPT ""  OF oDlg SIZE 10, 10 PIXEL FONT oFont   UPDATE



    ACTIVATE DIALOG oDlg




 
Best Regards, Saludos

Falconi Silvio
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Problems with Checkbox

Post by Enrico Maria Giordano »

Richard Chidiak wrote:I had a solution modifying control prg , here it is, please report back if it fixes the problem
Richard, please test it under all the conditions (transparent or not, themed or not, with background color, with background brush, with background gradient, ...).

EMG
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Re: Problems with Checkbox

Post by Maurizio »

Richard,

I use Windows XP .
I modify control.prg .
I try with BRUSH and without , with TRANSPARENT and without , but the problem persists :( .

The only workaround is :
function IsAppThemed()
return .F.

but is not the solution (there are a lot of messages in this forum )

Maurizio
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: Problems with Checkbox

Post by Richard Chidiak »

Maurizio

One solution you may consider , this is something we did with some of our customers having this problem under xp, is to change the actual theme to windows classic for example, validate and then go back to the theme you had before.

This has been successful in many cases for us (not all ).

As per control.prg , i just tested with the change on xp , i have things working correctly. Of course we need much more tests as Enrico said , it is a complex situation , with themes, without, brushes etc...
I tested as much as i could under win7 64 bits, win xp , the results seem OK for me. But this needs definitely to be confirmed by as many people as possible here in this forum. For example, i don't use bakground brushes in my application , still needs to be tested.

Maybe someone else can test ? It will be really appreciated.

We need to get rid of these ennoying problems introduced with "transparency" , i am refering to checkbox, radios, fixed says ... we need to solve this once for all ,

My 2 cents,

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
frose
Posts: 327
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Gütersloh
Contact:

Re: Problems with Checkbox

Post by frose »

Richard,

your modified control.prg is working perfectly for me, thank you very much :D
Last edited by frose on Mon May 09, 2011 1:43 pm, edited 1 time in total.
FiveWiDi
Posts: 910
Joined: Mon Oct 10, 2005 2:38 pm

Re: Problems with Checkbox

Post by FiveWiDi »

Maurizio wrote:Richard,

I use Windows XP .
I modify control.prg .
I try with BRUSH and without , with TRANSPARENT and without , but the problem persists :( .

The only workaround is :
function IsAppThemed()
return .F.

but is not the solution (there are a lot of messages in this forum )

Maurizio
Maurizio,

Quizás así:

http://forums.fivetechsupport.com/viewt ... =6&t=20867
Un Saludo
Carlos G.

FiveWin 19.06 + Harbour 3.2, BCC 7 Windows 10
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Re: Problems with Checkbox

Post by Maurizio »

FiveWidi,

I don't have this line in my RC file

1 24 "c:\Windows\WindowsShell.Manifest"

My resources are in a DLL ( Pelles) and this is my RC file for Manifest e Icon

LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US

1 MANIFEST "MANIFEST.XML"

ICO ICON "ALBE.ICO

Regards Murizio
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Problems with Checkbox

Post by Silvio »

FRIENDS ,

I HAVE 64 bit windows seven HOME Premium and here checkbox and radio controls run perfectly ,



only i must change tcontrol.prg ( see my message before at the top)



I not use isapptheme function ->nil


I use only xp windows effect resource as you can found at winxp folder on fwh/sample


no gradient



Image




with gradient



Image
Best Regards, Saludos

Falconi Silvio
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Problems with Checkbox

Post by Enrico Maria Giordano »

Richard Chidiak wrote:

Code: Select all

//DrawPBack( ::hWnd,  hDC )  // chidiak remove this line
Richard, the first thing we have to know is what DrawPBack() is for. Antonio (or anybody else)?

EMG
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Problems with Checkbox

Post by Silvio »

No Emg,

On Old Post on spanish forum Antonio Linares remmed this line !!!

this last year...

and there is another topic on forum
Remember ?
http://forums.fivetechsupport.com/viewt ... =DrawPBack
Best Regards, Saludos

Falconi Silvio
Post Reply