FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problems with Checkbox
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Problems with Checkbox
Posted: Mon May 09, 2011 07:31 AM
Ciao Enrico

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

but the problem persist in radio.


Uploaded with ImageShack.us
Regards MAurizio
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: Problems with Checkbox
Posted: Mon May 09, 2011 07:38 AM
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 (fw): Select all Collapse
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( ::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
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: Problems with Checkbox
Posted: Mon May 09, 2011 07:44 AM

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
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: Problems with Checkbox
Posted: Mon May 09, 2011 07:47 AM

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
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: Problems with Checkbox
Posted: Mon May 09, 2011 07:55 AM

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
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: Problems with Checkbox
Posted: Mon May 09, 2011 08:00 AM
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 ::hBrush


I tried this test
Code (fw): Select all Collapse
 #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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problems with Checkbox
Posted: Mon May 09, 2011 08:43 AM
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
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Problems with Checkbox
Posted: Mon May 09, 2011 10:12 AM

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

Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: Problems with Checkbox
Posted: Mon May 09, 2011 10:52 AM

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
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: Problems with Checkbox
Posted: Mon May 09, 2011 12:52 PM

Richard,

your modified control.prg is working perfectly for me, thank you very much :D

Windows 11 Pro 22H2 22621.1848

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Harbour 3.2.0dev (r2008190002)

FWH 23.10 x86
Posts: 1445
Joined: Mon Oct 10, 2005 02:38 PM
Re: Problems with Checkbox
Posted: Mon May 09, 2011 12:59 PM
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í:

viewtopic.php?f=6&t=20867

Un Saludo

Carlos G.



FiveWin 25.12 + Harbour 3.2.0dev (r2502110321), BCC 7.7 Windows 11 Home

Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Problems with Checkbox
Posted: Mon May 09, 2011 01:09 PM

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

Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: Problems with Checkbox
Posted: Mon May 09, 2011 03:39 PM
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








with gradient



Best Regards, Saludos



Falconi Silvio
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problems with Checkbox
Posted: Tue May 10, 2011 09:10 AM
Richard Chidiak wrote:
Code (fw): Select all Collapse
//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
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: Problems with Checkbox
Posted: Tue May 10, 2011 09:16 AM

No Emg,

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

this last year...

and there is another topic on forum
Remember ?

viewtopic.php?f=3t=19966hilit=DrawPBack

&&

Best Regards, Saludos



Falconi Silvio