Page 1 of 1

:bBmpData at TXBrowse Cols!

Posted: Wed Mar 19, 2008 3:03 pm
by JC
Hi again my friends..


I need a little help!

This a example of my code:

Code: Select all

...

oBrw:aCols[7]:addResource( "IMAGE_TRUE" )
oBrw:aCols[7]:addResource( "IMAGE_FALSE" )
oBrw:aCols[7]:bStrData := NIL
oBrw:aCols[7]:nDataStrAlign := AL_CENTER

oBrw:aCols[7]:bBmpData := {|| if( ( cAlias )->situacao, 1, 2 ) }

...
When the ( cAlias )->situacao is true, the xBrowse displays the image at position 1 of correct way.

But, when is false... it's not displays the image at position 2.

Where I'm wrong?

Posted: Wed Mar 19, 2008 5:33 pm
by nageswaragunupudi
Mr JC

There is nothing wrong with your code. ( By the way it is not necessary to assign any value to nDataStrAlign in this case. When bStrData is nil, Bmp is shown centered. ).

Please check if your RC file contains resource with the exact spelling IMAGE_FALSE. If the browse does not find a resource with the given name, it shows blank.

You can also check this if oBrw:aCols[7]:addResource( "IMAGE_FALSE" ) is true or false. It it is true, the browse could successfully load the resource. If it is false, the browse could not load the resource.

Posted: Wed Mar 19, 2008 7:06 pm
by JC
nageswaragunupudi wrote:Mr JC

There is nothing wrong with your code. ( By the way it is not necessary to assign any value to nDataStrAlign in this case. When bStrData is nil, Bmp is shown centered. ).

Please check if your RC file contains resource with the exact spelling IMAGE_FALSE. If the browse does not find a resource with the given name, it shows blank.

You can also check this if oBrw:aCols[7]:addResource( "IMAGE_FALSE" ) is true or false. It it is true, the browse could successfully load the resource. If it is false, the browse could not load the resource.
Dear Nageswara..

After adjusting my code.... this her!

Code: Select all


oBrw:aCols[7]:bStrData := NIL
oBrw:aCols[7]:addResource( "IMAGE_TRUE" ) <- this is the true position with a correctly resource name
oBrw:aCols[7]:addResource( "IMAGE_FALSE" )<- this is the false position with a correctly resource name
oBrw:aCols[7]:bBmpData := {|| if( ( cAlias )->situacao, 1, 2 ) } 

However, still an error :(

I'm testing passing the code block with the value 1 or 2... it's displays both images! So, the resource name is correctly!

Posted: Thu Mar 20, 2008 12:40 am
by nageswaragunupudi
Surprising.

It works in the sample testxbr3.prg and also in my regular programs.

Will you please try this alternative code ?

oBrw:aCols[7]:bEditValue := { || (cAlias)->situacao }
oBrw:aCols[7]:SetCheck( { "IMAGE_TRUE", "IMAGE_FALSE" } )

in the place of all the lines you have coded ?

Posted: Thu Mar 20, 2008 12:49 am
by JC
nageswaragunupudi wrote:Surprising.

It works in the sample testxbr3.prg and also in my regular programs.

Will you please try this alternative code ?

oBrw:aCols[7]:bEditValue := { || (cAlias)->situacao }
oBrw:aCols[7]:SetCheck( { "IMAGE_TRUE", "IMAGE_FALSE" } )

in the place of all the lines you have coded ?
Yes NageswaraRao.... I do try!

Posted: Thu Mar 20, 2008 12:59 am
by JC
Ate the test, I get this error:

Message not found: TXBRWCOLUMN:SETCHECK

My version of fivewin don't have a method setCheck in the class TXBrwColumn!! :(

Posted: Thu Mar 20, 2008 1:18 am
by nageswaragunupudi
I am sorry. I should have seen the FWH version you are using. SetCheck is available from 8.03.

Possible that in version 6 the bBmpData is not handled properly. I do not have source code of xbrowse.prg that version. May be we can examine how the paintdata method is dealing with bBmpData.

Posted: Thu Mar 20, 2008 1:33 am
by JC
nageswaragunupudi wrote:I am sorry. I should have seen the FWH version you are using. SetCheck is available from 8.03.

Possible that in version 6 the bBmpData is not handled properly. I do not have source code of xbrowse.prg that version. May be we can examine how the paintdata method is dealing with bBmpData.
Yes! I will try to get the most updated version of fivewin

Thanks very much Nageswara!!