Page 1 of 2

FWH1009 CheckBox Prompt disappear

PostPosted: Thu Sep 30, 2010 7:09 pm
by renogam
Hi, When Click CheckBox Prompt disappear. When press ALT in active form CheckBox and Prompt disappear.

TIA

Re: FWH1009 CheckBox Prompt disappear

PostPosted: Fri Oct 01, 2010 5:58 am
by Antonio Linares
Please add this function to your main PRG:

function IsAppThemed()

return .F.

Re: FWH1009 CheckBox Prompt disappear

PostPosted: Fri Oct 01, 2010 4:11 pm
by renogam
Brilliant !
Best Regards.

Re: FWH1009 CheckBox Prompt disappear

PostPosted: Wed Oct 06, 2010 11:48 pm
by TimStone
I've had several strange behaviors associated with checkboxes. I used IsThemed() but that didn't help.

1) In some cases, clicking on a checkbox caused a screen flash but did not then show the checkmark
2) Checked values which didn't show were also not changed in the database
3) The screen flash is pretty vivid
4) In some cases, it required a double click to get a checkmark
5) Sometimes when a checkmark did appear, saving the data to the database reverted the value.

I tried a lot of "eliminations" and I was finally able to get the normal behavior back by revertion to FWH 10.6.

I am using xBuilder, xCC compiler, Windows 7 Ultimate ( 32 bit ).

Re: FWH1009 CheckBox Prompt disappear

PostPosted: Thu Oct 07, 2010 7:01 am
by Enrico Maria Giordano
We need of a clear sample of the problem. I wasn't able to reproduce any problems with checkboxes, sorry.

EMG

Re: FWH1009 CheckBox Prompt disappear

PostPosted: Thu Oct 07, 2010 2:20 pm
by James Bott
Enrico,

Well here is a strange one. I tried fw\samples\testchk2.prg and it works fine. I copied the file to a new filename testch2a.prg and it doesn't work--the prompts vanish when the checkbox is clicked and even more strange, when one checkbox is clicked it's prompt vanishes and the other checkbox's prompt reappears.

Both files are in the fwh\samples directory and are compiled using the default buildx.bat file.

I have no idea why the filename has an affect, but there must be some reason.

I would be interested to hear if you can repeat this behavior (or if anyone else can).

Regards,
James

Re: FWH1009 CheckBox Prompt disappear

PostPosted: Thu Oct 07, 2010 4:03 pm
by TimStone
Enrico,

My problem can be random. I can have 3 checkboxes on a page, and one of them simply doesn't work. They are coded exactly the same. All are REDEFINE CHECKBOX objects, and the resources ( .RC file ) are coded exactly the same.

What I do know is they do work as they should with FWH 10.06. The problem behavior starts with 10.07. So, whatever is causing it, and several people here have commented that problems do exist, was created in the upgrade posted at the end of July.

Tim

Re: FWH1009 CheckBox Prompt disappear

PostPosted: Thu Oct 07, 2010 8:13 pm
by Enrico Maria Giordano
James Bott wrote:Enrico,

Well here is a strange one. I tried fw\samples\testchk2.prg and it works fine. I copied the file to a new filename testch2a.prg and it doesn't work


You probably forgot to copy testchk2.rc as well. :-)

EMG

Re: FWH1009 CheckBox Prompt disappear

PostPosted: Thu Oct 07, 2010 9:18 pm
by James Bott
Enrico,

>You probably forgot to copy testchk2.rc as well.

Ah, logic is still working!

There were no REDEFINE's in the code so I didn't even think to look for a resource file.

So, now we know that if the app isn't themed, the checkboxes do strange things. Did you see this behavior too?

Regards,
James

Re: FWH1009 CheckBox Prompt disappear

PostPosted: Thu Oct 07, 2010 9:43 pm
by Enrico Maria Giordano
Yes! Found! The problem seems to be inside control.prg, in the following lines:

Code: Select all  Expand view
if IsAppThemed() .and. Upper( ::ClassName() ) $ "TCHECKBOX;TRADIO;TGROUP"
   DrawPBack( ::hWnd,  hDC )
endif


The function IsAppThemed() returns .T. even if the theme manifest is not linked in. So DrawPBack() is executed in a non-themed application and hides the checkboxes.

Antonio?

EMG

Re: FWH1009 CheckBox Prompt disappear

PostPosted: Mon Oct 11, 2010 8:08 am
by Antonio Linares
We need to find a way to improve IsAppThemed() for those circunstances

Actually we use this code:
Code: Select all  Expand view

      bIsThemed = ( ( ( BOOL ) FindResource( GetResources(), MAKEINTRESOURCE( 1 ),
                  MAKEINTRESOURCE( 24 ) ) ) ||
                  ( ( BOOL ) FindResource( GetInstance(), MAKEINTRESOURCE( 1 ),
                  MAKEINTRESOURCE( 24 ) ) ) || pIsAppThemed() );
 

that detects if the manifest file is linked in. The problem is that pIsAppThemed() (Microsoft themes API function) is returning true

Re: FWH1009 CheckBox Prompt disappear

PostPosted: Mon Oct 11, 2010 9:03 am
by Enrico Maria Giordano
Can you explain? I don't understand that code...

EMG

Re: FWH1009 CheckBox Prompt disappear

PostPosted: Mon Oct 11, 2010 10:45 am
by Antonio Linares
Enrico,

When we place the manifest file inside the resources we do:

1 24 "WindowsXP.Manifest"

thats why we use FindResource() to search for it.

In case it is not inside the EXE or the resources DLL, then we call IsAppThemed() from the Windows themes API (pIsAppThemed())

Re: FWH1009 CheckBox Prompt disappear

PostPosted: Mon Oct 11, 2010 11:37 am
by Enrico Maria Giordano
Ok, it is clear now. I didn't see the difference between GetResources() and GetInstance().

What if you remove pIsAppThemed() from the test?

EMG

Re: FWH1009 CheckBox Prompt disappear

PostPosted: Mon Oct 11, 2010 11:52 am
by Antonio Linares
Enrico,

What if you remove pIsAppThemed() from the test?


We did that in previous FWH version and Juan Galvez reported wrong results, so we had to revert the change.

We need a way to return the right result in all possible circunstances...