FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse Multiselect - Selectall
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
xBrowse Multiselect - Selectall
Posted: Tue Apr 12, 2016 05:53 PM

Hi,

I have a multiselect xbrowse of an array, and want to select all items.
I have try oBrw:SelectAll(), but it only works if I allready selected at least 2 items.
Is there an other way to select all items.

I use FWH64 16.03

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse Multiselect - Selectall
Posted: Tue Apr 12, 2016 09:02 PM

For this browse please set
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROWMS

Regards



G. N. Rao.

Hyderabad, India
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: xBrowse Multiselect - Selectall
Posted: Wed Apr 13, 2016 05:39 AM

Thank you, now it's working :D

Another question about selecting rows. Is there a posibility to select records according to a condition.
I want for example select all raws where column 1 is holding the text '.CSV', after pressing a button.

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse Multiselect - Selectall
Posted: Wed Apr 13, 2016 07:43 AM
Assuming array browse, please try this:
Code (fw): Select all Collapse
oBrw:aSelected := {}
AEval( oBrw:aArrayData, { |a,i| If( Upper( cFileExt( Trim( a[ 1 ] ) ) ) == "CSV", AAdd( oBrw:aSelected, i ), nil ) }
oBrw:Refresh()
Regards



G. N. Rao.

Hyderabad, India
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: xBrowse Multiselect - Selectall
Posted: Wed Apr 13, 2016 09:56 AM

Thank you,

It's working fine.
I want to expand the possibility to deselect all files of one type.
Can I just set the value of the aSelected array to 0 for those records, or should I create a new one?

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: xBrowse Multiselect - Selectall
Posted: Wed Apr 13, 2016 01:00 PM
Marc Vanzegbroeck wrote:Thank you,

It's working fine.
I want to expand the possibility to deselect all files of one type.
Can I just set the value of the aSelected array to 0 for those records, or should I create a new one?


I deleted the record in the oBrw:aSelected array, and now it's working also for deselecting types.

I have another question. In the dialog, I show how many items are selected by showing len(oBrw:aSelected).
For the selections by my buttons, it's working fine.
But if i select by clicking the browse, it's not working.
I added the ON CLICK command by the xbrowse, and did an update uw the say. But it always show the previous amount of selected items.
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: xBrowse Multiselect - Selectall
Posted: Thu Apr 14, 2016 10:56 AM

Mr Roa,

Do you know how I can show the number of selected items.
Now it shows the previous selected items.

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse Multiselect - Selectall
Posted: Thu Apr 14, 2016 12:25 PM

Please try
oBrw:bOnRefresh := { || oSay:Refresh() }

where oSay is

@ r,c SAY oSay PROMPT Len( oBrw:aSelected ) SIZE ............. OF oDlg

Regards



G. N. Rao.

Hyderabad, India
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: xBrowse Multiselect - Selectall
Posted: Thu Apr 14, 2016 03:51 PM
nageswaragunupudi wrote:Please try
oBrw:bOnRefresh := { || oSay:Refresh() }

where oSay is

@ r,c SAY oSay PROMPT Len( oBrw:aSelected ) SIZE ............. OF oDlg


Thank you, its working fine.
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite

Continue the discussion