FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse ARRAY SELECTBOX
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
xBrowse ARRAY SELECTBOX
Posted: Fri Jul 24, 2009 11:00 AM
To all,

Would someone be so kind to post an example how to make best
a xBrowse from an ARRAY with a select column (YES/NO).

I always change the array and then read the whole array again and do a refresh.
But I think this could be done easier.


Thanks in advance,
Otto
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: xBrowse ARRAY SELECTBOX
Posted: Fri Jul 24, 2009 01:00 PM

Otto,

Here is a copy of an old message about using a on/off bitmap in xBrowse. Is this what you are already doing? Why do you need to reload the array?

James


Post subject: Re: Xbrowse newbiePosted: Fri Mar 20, 2009 11:07 am
Joined: Fri Oct 07, 2005 5:50 am
Posts: 474
Location: Columbia, South Carolina USA Here is the answer to my own question .. for all those folks like me .. Txbrowse is very powerful .. especially using the EDIT_GET code block and notice the

oCol:SetCheck( { "ON", "OFF" } )

where "ON", "OFF" is a bitmap .. which is a resource .. that shows the checkbox column ..

Very Nice
Rick Lipkin

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: xBrowse ARRAY SELECTBOX
Posted: Fri Jul 24, 2009 01:46 PM
Hello James,
thank you for putting me in the right direction.
Now it is working.
Best regards,
Otto

Code (fw): Select all Collapse
oBrw:aCols[1]:cHeader         := 'Löschen'
    oBrw:aCols[1]:nWidth          := 90
     oBrw:aCols[1]:nEditType       := EDIT_BUTTON
     
    oBrw:aCols[1]:AddResource("OKKLEIN")
    oBrw:aCols[1]:AddResource("LEER")
    oBrw:aCols[1]:bBmpData       :=  { || iif(  aTageSort[oBrw:nArrayAt][1] = .t., 1, 2)}
      
    oBrw:aCols[1]:bEditBlock      :=   {|| iif( aTageSort[ oBrw:nArrayAt ][ 1 ] = .t.,;
    aTageSort[ oBrw:nArrayAt ][ 1 ] := .f. , ;
    aTageSort[ oBrw:nArrayAt ][ 1 ] := .t. )  }
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse ARRAY SELECTBOX
Posted: Fri Jul 24, 2009 02:11 PM

Mr Otto

Why all this code? I think this small function works well

oBrw:aCols[ 1 ]:SetCheck( { 'OKKLEIN', 'LEER' } )
oBrw:aCols[ 1 ]:nEditType := 1

Regards



G. N. Rao.

Hyderabad, India
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: xBrowse ARRAY SELECTBOX
Posted: Fri Jul 24, 2009 02:31 PM
Hello Mr. Rao,

thank you. You are right. May I ask for some more help.
How do I suppress the displaying of .T., .F. beside the bitmap?

I would like to lock some records from being able to be changed.
I tried like this. How would you suggest to implement this functionality.

Thanks in advance
Otto
Code (fw): Select all Collapse
 oBrw:aCols[1]:bEditBlock      :=   {|| iif( aTageSort[ oBrw:nArrayAt ][ 5]="NEIN",;
    Msginfo("Mindestsicherung"),;
    iif( aTageSort[ oBrw:nArrayAt ][ 1 ] = .t.,;
    aTageSort[ oBrw:nArrayAt ][ 1 ] := .f. , ;
    aTageSort[ oBrw:nArrayAt ][ 1 ] := .t. ))}

Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: xBrowse ARRAY SELECTBOX
Posted: Fri Jul 24, 2009 03:00 PM

Hello Otto.

Please try with bStrDta := {|| NIL }

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: xBrowse ARRAY SELECTBOX
Posted: Fri Jul 24, 2009 03:32 PM

Hello Daniel,

I tried
oBrw:aCols[1]:bStrData := {|| NIL } but with no success.
But on the PC I am working – production system – I have 9.01 installed.
I will try with a newer xBrowse later.
I will post the result tomorrow. Thanks again.
Best regards,
Otto

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse ARRAY SELECTBOX
Posted: Fri Jul 24, 2009 04:54 PM

this was a minor bug earlier.
In the present version it is automatically suppressed

Regards



G. N. Rao.

Hyderabad, India
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: xBrowse ARRAY SELECTBOX
Posted: Fri Jul 24, 2009 05:11 PM
Otto...

this is a easy way to solve your problem... but you need modify the xbrowse class

open xbrowse.prg
find METHOD PaintData
in method find ( aprox line 6834 )
Code (fw): Select all Collapse
if ::bStrData != nil

change with
Code (fw): Select all Collapse
if ::bStrData != nil .and. ! ::hChecked

save file and include this in you project
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: xBrowse ARRAY SELECTBOX
Posted: Fri Jul 24, 2009 05:33 PM

Hello Daniel,
thank you. Now it is ok.

Best regards,
Otto

Continue the discussion