:bBmpData at TXBrowse Cols!

Post Reply
User avatar
JC
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil
Contact:

:bBmpData at TXBrowse Cols!

Post 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?
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post 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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
JC
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil
Contact:

Post 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!
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post 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 ?
Regards

G. N. Rao.
Hyderabad, India
User avatar
JC
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil
Contact:

Post 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!
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil
Contact:

Post 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!! :(
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post 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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
JC
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil
Contact:

Post 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!!
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Post Reply