FWH1009 CheckBox Prompt disappear

FWH1009 CheckBox Prompt disappear

Postby renogam » Thu Sep 30, 2010 7:09 pm

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

TIA
User avatar
renogam
 
Posts: 4
Joined: Tue Jan 27, 2009 8:07 pm

Re: FWH1009 CheckBox Prompt disappear

Postby Antonio Linares » Fri Oct 01, 2010 5:58 am

Please add this function to your main PRG:

function IsAppThemed()

return .F.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH1009 CheckBox Prompt disappear

Postby renogam » Fri Oct 01, 2010 4:11 pm

Brilliant !
Best Regards.
User avatar
renogam
 
Posts: 4
Joined: Tue Jan 27, 2009 8:07 pm

Re: FWH1009 CheckBox Prompt disappear

Postby TimStone » 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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: FWH1009 CheckBox Prompt disappear

Postby Enrico Maria Giordano » Thu Oct 07, 2010 7:01 am

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

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

Re: FWH1009 CheckBox Prompt disappear

Postby James Bott » Thu Oct 07, 2010 2: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: FWH1009 CheckBox Prompt disappear

Postby TimStone » Thu Oct 07, 2010 4: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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: FWH1009 CheckBox Prompt disappear

Postby Enrico Maria Giordano » Thu Oct 07, 2010 8: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
User avatar
Enrico Maria Giordano
 
Posts: 8711
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: FWH1009 CheckBox Prompt disappear

Postby James Bott » Thu Oct 07, 2010 9: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: FWH1009 CheckBox Prompt disappear

Postby Enrico Maria Giordano » Thu Oct 07, 2010 9:43 pm

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
User avatar
Enrico Maria Giordano
 
Posts: 8711
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: FWH1009 CheckBox Prompt disappear

Postby Antonio Linares » Mon Oct 11, 2010 8:08 am

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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH1009 CheckBox Prompt disappear

Postby Enrico Maria Giordano » Mon Oct 11, 2010 9:03 am

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

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

Re: FWH1009 CheckBox Prompt disappear

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH1009 CheckBox Prompt disappear

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8711
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: FWH1009 CheckBox Prompt disappear

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 93 guests