FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWH1009 CheckBox Prompt disappear
Posts: 4
Joined: Tue Jan 27, 2009 08:07 PM
FWH1009 CheckBox Prompt disappear
Posted: Thu Sep 30, 2010 07:09 PM

Hi, When Click CheckBox Prompt disappear. When press ALT in active form CheckBox and Prompt disappear.

TIA

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH1009 CheckBox Prompt disappear
Posted: Fri Oct 01, 2010 05:58 AM

Please add this function to your main PRG:

function IsAppThemed()

return .F.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4
Joined: Tue Jan 27, 2009 08:07 PM
Re: FWH1009 CheckBox Prompt disappear
Posted: Fri Oct 01, 2010 04:11 PM

Brilliant !
Best Regards.

Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: FWH1009 CheckBox Prompt disappear
Posted: Wed Oct 06, 2010 11:48 PM

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 ).

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: FWH1009 CheckBox Prompt disappear
Posted: Thu Oct 07, 2010 07:01 AM

We need of a clear sample of the problem. I wasn't able to reproduce any problems with checkboxes, sorry.

EMG

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: FWH1009 CheckBox Prompt disappear
Posted: Thu Oct 07, 2010 02:20 PM

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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: FWH1009 CheckBox Prompt disappear
Posted: Thu Oct 07, 2010 04:03 PM

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

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: FWH1009 CheckBox Prompt disappear
Posted: Thu Oct 07, 2010 08:13 PM
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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: FWH1009 CheckBox Prompt disappear
Posted: Thu Oct 07, 2010 09:18 PM

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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: FWH1009 CheckBox Prompt disappear
Posted: Thu Oct 07, 2010 09:43 PM
Yes! Found! The problem seems to be inside control.prg, in the following lines:

Code (fw): Select all Collapse
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH1009 CheckBox Prompt disappear
Posted: Mon Oct 11, 2010 08:08 AM
We need to find a way to improve IsAppThemed() for those circunstances

Actually we use this code:
Code (fw): Select all Collapse
      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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: FWH1009 CheckBox Prompt disappear
Posted: Mon Oct 11, 2010 09:03 AM

Can you explain? I don't understand that code...

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH1009 CheckBox Prompt disappear
Posted: Mon Oct 11, 2010 10:45 AM

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())

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: FWH1009 CheckBox Prompt disappear
Posted: Mon Oct 11, 2010 11:37 AM

Ok, it is clear now. I didn't see the difference between GetResources() and GetInstance().

What if you remove pIsAppThemed() from the test?

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH1009 CheckBox Prompt disappear
Posted: Mon Oct 11, 2010 11:52 AM
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...
regards, saludos

Antonio Linares
www.fivetechsoft.com