xBrowse ARRAY SELECTBOX

xBrowse ARRAY SELECTBOX

Postby Otto » 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
Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: xBrowse ARRAY SELECTBOX

Postby James Bott » Fri Jul 24, 2009 1: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: xBrowse ARRAY SELECTBOX

Postby Otto » Fri Jul 24, 2009 1:46 pm

Hello James,
thank you for putting me in the right direction.
Now it is working.
Best regards,
Otto

Code: Select all  Expand view
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. )  }          
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: xBrowse ARRAY SELECTBOX

Postby nageswaragunupudi » Fri Jul 24, 2009 2: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
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse ARRAY SELECTBOX

Postby Otto » Fri Jul 24, 2009 2: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: Select all  Expand view
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. ))}

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: xBrowse ARRAY SELECTBOX

Postby Daniel Garcia-Gil » Fri Jul 24, 2009 3:00 pm

Hello Otto.

Please try with bStrDta := {|| NIL }
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: xBrowse ARRAY SELECTBOX

Postby Otto » Fri Jul 24, 2009 3: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: xBrowse ARRAY SELECTBOX

Postby nageswaragunupudi » Fri Jul 24, 2009 4:54 pm

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse ARRAY SELECTBOX

Postby Daniel Garcia-Gil » Fri Jul 24, 2009 5: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: Select all  Expand view
if ::bStrData != nil

change with
Code: Select all  Expand view
if ::bStrData != nil .and. ! ::hChecked

save file and include this in you project
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: xBrowse ARRAY SELECTBOX

Postby Otto » Fri Jul 24, 2009 5:33 pm

Hello Daniel,
thank you. Now it is ok.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 56 guests